CentroEPiaggio / kuka-lwr

Software related to the KUKA LWR 4+: for real and for simulation.
The Unlicense
104 stars 81 forks source link

Support for versions of gazebo other than 4 #29

Closed nrontsis closed 7 years ago

nrontsis commented 9 years ago

I am trying to integrate kuka-lwr with SHADOW hand.

I see that in your requirements you state "gazebo 4 or higher".

What are the problems on running on gazebo 2.2 (the default for indigo)?

Thank you!

Nikitas

carlosjoserg commented 9 years ago

The main difference is how to access the joint angles/positions here in API terms. It could be easily solved using a macro like this one.

The reason why I didn't do it is basically to promote the use of newer versions of gazebo, since the install procedure is not so tedious.

nrontsis commented 9 years ago

Okay thank you a lot. I will come back in the next few days, to close the issue or comment further.

Cheers!

nrontsis commented 9 years ago

After experimenting a bit the package, I think that there is currently no issue with using Gazebo 2.2.1. It compiles, and runs out of the box. [I definitely do not like to use outdated versions, but unfortunately, in the project I work we have decided on ros-indigo and gazebo 2.2.1 :/ ]

In contrast, vito robot and the kuka version that it used there https://github.com/CentroEPiaggio/kuka-lwr/commit/b91e1944e3eaa3ac67c4664b4cff1e55c1a237af requires Gazebo 4, due to the reasons @carlosjoserg mentioned before (and especially due to Joint::SetStiffness() to which I couldn't find any alternative available in Gazebo 2.2.1).

I am closing the issue, but feel free to comment to what I wrote. :)

carlosjoserg commented 9 years ago

Thanks.

However, it is strange that it compiles and run out of the box, it shouldn't, are you sure? I see in your timeline you are actually not using the lwr gazebo plugin here, and in fact, this is why the robot falls in simulation without controllers as you mentioned in https://github.com/shadow-robot/sr-ros-interface/issues/333.

The Joint::SetStiffness() is not in the kuka package, but in the Pisa/IIT SoftHand, as an attempt to introduce springs in joints, but didn't work for me. I sent you to Vito to show you how I implemented a custom transmission for the hand that is compatible with ros control as an example to implement shadow robot transmissions, and how everything is assembled using the kuka as well.

nrontsis commented 9 years ago

@carlosjoserg according to the code you sent me, for the difference in API terms of gazebo 4 vs gazebo 2:

#if GAZEBO_MAJOR_VERSION >= 4
        sim_joints_[j]->SetPosition(0, joint_position_command_[j]);
#else
        sim_joints_[j]->SetAngle(0, joint_position_command_[j]);
#endif

Hence gazebo 2.2.1 should replace SetPosition to SetAngle. However you do not use at all the SetPosition function in kuka-lwr package.

I tested again using kuka-lwr package (untouched) in Gazebo 2.2.1, and I did not find any issue.

You are right however that my issues for Vito robot in Gazebo 2.2.1 came from Pisa/IIT SoftHand. And vito example indeed helped me in connecting shadow with kuka.

carlosjoserg commented 9 years ago

However you do not use at all the SetPosition function in kuka-lwr package.

You are absolutely right, I was thinking in the hand, hence vito.

However, I plan to use the SetPosition next week, if it is only one place that I have to do that, no problem to add it, if there are more places, I would prefer not.

So, yes, thanks for re-opening the issue, keep it that way until that is done.

nrontsis commented 9 years ago

Okay, nice :blush:

In case where you use extensively the SetPosition I can easily put macros to handle it in a branch of my fork.

[Btw, I removed the lwr gazebo plugin in my branch because it was conflicting with the sr_gazebo_plugins used in SHADOW hand. I will ask the SHADOW guys [@ugocupcic] about it and maybe I will come back to you with a few more questions :innocent:]

Cheers!

ugocupcic commented 9 years ago

@nrontsis we have some plans to get rid of that sr_gazebo_plugins package but need to look into it a bit more as it's not trivial.

What has been done in other projects is to spawn the 2 robot models separately in gazebo (one for the arm, one for the hand). But then it leads to quite a few nightmares (need to run some joint states merger etc...)

nrontsis commented 9 years ago

@ugocupcic @carlosjoserg I think it is best to continue the discussion about kuka+shadow in https://github.com/shadow-robot/sr-ros-interface/issues/333

carlosjoserg commented 9 years ago

@nrontsis I added the check for the version in the gazebo interface here, could you confirm it works for you and close the issue if so? Thanks.

gpldecha commented 8 years ago

I have installed gazebo6 and when I launch the simulator I get:

[WARN] [WallTime: 1450348091.185336] [14.746000] Controller Spawner couldn't find the expected controller_manager ROS interface.

carlosjoserg commented 8 years ago

Could deveop more the question? How are you launching? Are you using fully the example given here or your own?

gpldecha commented 8 years ago

Sorry about my hast no issue. I made a mistake.

carlosjoserg commented 8 years ago

No worries.

Anyway, looked like the lwr plugin was not loaded... might be things like gazebo is started with pause on or the tag not being converted to SDF...

Let us know if it is gazebo6 compatible ;) On Dec 17, 2015 12:49 PM, "gpldecha" notifications@github.com wrote:

Sorry about my hast no issue. I made a mistake.

— Reply to this email directly or view it on GitHub https://github.com/CentroEPiaggio/kuka-lwr/issues/29#issuecomment-165433046 .

gpldecha commented 8 years ago

It is indeed gazebo compatible.

carlosjoserg commented 8 years ago

:+1: thanks !