On 24-4-2015 23:13, Lucas Chavez wrote:
> The Karel code translated successfully and is now on the controller. Yay!
> We do not have Multi-Tasking (J600). I have not done anything further than
> transfer the .pc files. I believe I need to change my Karel code because I
> do not have Multi-Tasking. I wanted your opinion and advice before
> proceeding. See my full response in line.
Multi-tasking is not needed for the Karel programs, the option extends
TP to allow running multiple programs in parallel.
Responses in-line again (I normally don't top-post, so all my responses
will be in-line).
[..]
>>>> - URDF: I have an experimental pkg I made for another user some time
>>>> ago (he never returned, so it isn't finished). It's missing meshes
>>>> (currently using the 200i meshes), as I don't have them for the 200iB.
>>>> The kinematic structure is there though. If you provide me with meshes
>>>> for the 200iB I can easily update the pkg. If not, this should provide
>>>> you with a starting point. I've pushed it to my personal fork, see [1].
>>>>
>>>
>>> Ok great. I'll look into acquiring the meshes. How are these typically
>>> found with Fanuc?
>>
>> Newer robots may come with a CD/DVD with the manuals and some CAD
>> models. I don't know how this was done back in 2003, but you could try
>> and see whether you have anything there.
>>
>> Alternatively, you might ask Fanuc if they could supply you with them if
>> you are still in contact with them.
>>
>> If we cannot get hold of actual meshes, approximations using geometric
>> primitives are also acceptable, but things will look a lot less nice in
>> RViz.
>>
> We do not have access to the meshes. I will search the internet. But for
> right now, thank you for pushing that branch to fanuc_experimental with the
> 200i meshes.
Note that for simple control of the robot you don't need the meshes:
RViz will show a robot that does not correspond to your own, but that is
only visualisation.
However, if you plan to use MoveIt and want to rely on its collision
detection / avoidance, you _will_ need the correct meshes, as it relies
on them for that piece of functionality. As I wrote earlier: you can
work around this a bit by piecing together your collision model from
geometric primitives.
>>>> - IKFast: I never got round to creating an IKFast plugin for the
>>>> 200iB, but it isn't too difficult. Latest versions of collada_to_urdf
>>>> segfault though, so it's easiest to do on a Hydro installation. If I get
>>>> some time next week I can probably do it (I've made a simple pkg that
>>>> automates most of the steps. Works only for simple serial chains though.
>>>> See [2]), but you're free to try yourself.
>>>>
>>>
>>> I installed Ubuntu 14.04 so that is why I installed Indigo. Do you think it
>>> will be worth me changing to Ubuntu 13.04 in order to run Hydro? I was
>>> hoping to run the latest version of everything, but I can change that if it
>>> will mean less headaches.
>>
>> The plugin needs to be generated only once, after that it is just a
>> static source file. You could take the 200ib pkg I pushed and use a
>> Hydro system just once to get the plugin generated.
>>
>> It would also obviously be very much appreciated if someone finally
>> solved the collada / assimp issues with the collada_to_urdf node on
>> Indigo, but that may be a bit out of scope :).
>>
> Do I need the IKFast plugin to run:
>
http://wiki.ros.org/fanuc/Tutorials/Running ? Prerequisites say just the
> MoveIt package. But I'm not quite sure what IKFast is for. My current plan
> (after running that tutorial) is to try and generate the plugin. I have
> some background in C++ so if it's easy maybe I can fix it and be a good
> open source user. If not, I'll create a virtual machine of Ubuntu 13 in
> Ubuntu 14 :)
No you don't need it. In fact, it is never really 'needed', as the
default KDL based ik plugin also works. IKFast is just much faster and
is what we typically use in ROS-I (or at least: I try to release IKFast
based plugins for all the Fanuc pkgs I create).
>>>> - MoveIt config: as I didn't have the correct meshes, creating a
>>>> MoveIt config didn't make sense (collision matrix would be bogus fi).
>>>> Creating these is trivial though and should take no more than a few
>>>> minutes.
>>>>
>>>> - Driver: the biggest challenges with these old(er) controllers are
>>>> multi-tasking and socket comm. Afaik, R-J3iB always have socket comm
>>>> (SKMG) and Karel support (KARL) installed, but multi-tasking (J600) is
>>>> not standard. You'll have to check that. If you don't have it, we can
>>>> probably write a Karel program that starts everything. The driver runs a
>>>> state reporter and a traj relay, so we need to be able to run those two
>>>> in parallel.
>>>>
>>
> This is the main issue! How can I write a Karel program that starts
> everything? How much help are you willing to give here? Any is fine but I
> am asking because you mentioned "we." What can I do to make this happen?
>
>>>
>>> Ok. I will check, but I doubt we have that option.
>>
>> We can always opt for the Karel program, it should work just as well.
>>
> We don't have the Multi-Tasking option.
I've pushed a small utility Karel program to [3] that you should be able
to use instead of J600. It uses the Karel RUN_TASK() routine to start a
program 'in the background', then quits.
I've also updated the main ROS tp program (in 'tpe/
ros.ls') to show you
how to use it. We could've written a Karel program that started
everything, but this is less invasive.
>>>> As to motion, the TP based proxy probably works, but personally I
>>>> think a Karel only approach makes more sense. I've pushed a version of
>>>> the driver that should be 6.11 compatible *and* uses Karel motion to my
>>>> personal fork [3]. Using the Makefile (and a Windows version of GNU
>>>> make) building should be easy (try: 'make SUPPORT_VER=V6.11-1', make
>>>> sure 'ktrans.exe' is on your path). It doesn't do TP programs yet
>>>> though, but you don't really need those, depending on your setup.
>>>>
>>>> Keep in mind that this is all rather experimental, so you're bound to
>>>> run into *some* issues.
>>>>
>>> Ok. I will look into that. Thanks for pushing that. Would it be worth
>>> adding some code to the main driver in order to make it v6 backward
>>> compatible "out of the box?" Or am I an outside case? I think we could make
>>> it compatible if there were Karel code that would allow it to check at
>>> translate time what version it is running. I could be responsible for
>>> pushing that to the hydro-devel branch if you think it would be a nice
>>> addition.
>
> The code translated and is now on the controller. I don't know what you
> mean by "karel motion"
There are two ways to control motion on a Fanuc controller: the
recommended way nowadays is through TP programs. Karel programs can also
command motion, but that has been deprecated. On a R-J3iB though, I
think we can still use the Karel motion instructions.
>> I'm a bit confused about what you mean with 'at translate time': Karel
>> is a compiled language with no 'preprocessor' kind-of front-end, so I'm
>> not sure we can 'detect' anything then.
>>
>
> Right I wasn't making sense there. I meant just to put checks in the karel
> code to see if the version is older. This is because the difference between
> your v6_karel_moveto branch and the current hydro-devel isn't much. If we
> can do checks we could combine the two fanuc_driver folders and it would
> work for v6 and v7. For example, in libind_log.kl the main difference is
> the message doesn't have color options. In your v6_karel_moveto branch
> these lines are simply commented out. I'm saying something like (in
> pseudocode):
>
> if v7
>
> message print using code from current hydro-devel branch
>
> else
> message print using code from v6_karel_moveto
> end
>
>
>> It is certainly possible to detect some things at runtime though, but
>> the current version of the driver is rather minimal in its
>> functionality, and especially system variable access is hard coded. A
>> future revision will probably rectify these kind of things (and more).
>>
>
> It seems v6 doesn't define the variable "cc_yellow" (see libind_log.kl).
> Do you think that is a reliable way to see if the karel code is running on
> a v6 controller?
'cc_yellow' is not a variable, it is a constant, defined in a header
supplied by Fanuc. We cannot use it to detect things at runtime. But it
is possible in some cases to do runtime detection of features, and I do
agree that is a much better approach than hard-coding things.
Furthermore, the support for colours is not only determined by which
system version is running on the controller: it is the display device
that needs to support them. I'd consider detecting what kind of pendant
is connected a more robust way of knowing when to use colour.
>> You're certainly not an outside case, but I'd rather keep the focus on
>> post V7.20 systems for the time being (there are enough quirks already).
>>
> I understand that. The thing I was trying to avoid was someone developing
> on the hydro-devel in the fanuc_driver folder and then having to transfer
> to a separate v6 specific branch like your v6_karel_moveto. Mainly it's not
> obvious where to get it from. Also, all the horrors of duplicate code and
> stuff. So just to double check, since it seems you have the greatest
> knowledge slash investment in this repo, if I made a pull request in the
> karel_drive folder with if statements similar to the pseudocode above do
> you think it will help the repo?
I'll always consider PRs and I welcome your contributions, but to get
proper support for older controller / system versions into the driver
requires more than just the changes I pushed to [3]. I just wanted to
make something available to you quickly. That is also the reason it was
'not obvious where to get it from': not all existing code is up on
github, and I just branched the repo for you on my personal fork. It is
not intended to become the 'official' way of maintaining versions of the
driver targeting different runtime systems.
As to adding checks: the logging code is currently part of the critical
path in the programs and I'd like to avoid adding too many branching
statements there. It's only a single branch now, but I prefer a more
structured approach (such as refactoring the logging infrastructure to
run in a separate program).
>>>> The tutorials should give you an idea of what you need to do to
>>>> configure everything, but obviously the screenshots and key sequences
>>>> will not be correct for your pendant. You also probably need to
>> recreate
>>>> the TP programs, as importing them could prove difficult.
>>>>
>>
> So I will need the TP programs?
I recommend you create at least one TP program that just starts
everything up, as this will be easier to manage, especially if you don't
have too much experience yet.
Look at the 'tpe/
ros.ls' file for an example. That should be easy to
recreate using the pendant. Alternatively, you could translate it using
WinOLPC and then copy it to your controller.
Obviously, you'll have to adjust some of the instructions given in the
tutorials, as some will not apply to your situation. In general it
should still all work though.