Connecting gazebo and ros_control while using SDF files

asked 2016-01-08 02:46:54 -0600

medrimonia gravatar image

updated 2016-01-09 21:30:23 -0600

I start briefly by introducing why I need to use SDF files instead of URDF files, and then I'll explain my problem.

I am currently trying to simulate a robot with servomotors, due to some constraints, I need to simulate the reduction gear which has a significant inertia since the gear ratio is 200. I was first using URDF file and I hoped to use the tag "mimic" on the joints to obtain the desired behavior. Since this tag is not implemented yet (according to this comment), I tried to use the proposed solution and switched to a sdf file, using gearbox joint. I received a very clear message indicating that gearbox joint was not handled. Therefore I switched from ros indigo to ros jade in order to be able to use gazebo 5 (following the advice given on gazebosim.org).

Finally, I managed to get a model running properly with a gearbox joint, but when I tried to control it, I suddenly realized that most of the documentation concerning ros_control was written for URDF descriptions of the robots. Particularly the transmission/actuator part.

After a few hours of research on how to declare the hardware interfaces in the sdf file, I found the following page which explained how to declare a differential drive controller in a SDF file. Over I did not manage to understand how to declare a basic EffortJointInterface from this example.

Did I miss a good documentation/tutorial/answer about how to declare ros_controllers in sdf files? Has anyone already faced this situation and found a convenient solution?

EDIT:

By digging into the source code of gazebo_ros_pkgs, I managed to 'publish' some information to ros. By using directly the joint_state_publisher plugin with the xml usage information provided here. However, only the position of the joint is published.

I inspected the '~/.gazebo/server-11345/default.log' file and got the following output

(1452366688 566076394) Init world[default]
(1452366688 772933540) GetAngle not implemented for gearbox
(1452366688 772962055) GetParam not implemented for gearbox
(1452366688 772969982) GetAngle not implemented for gearbox
(1452366688 772980746) GetParam not implemented for gearbox
(1452366688 773485760) ODEGearboxJoint::SetAnchor not implemented.
(1452366688 773521743) SetParam not implemented for gearbox
(1452366688 773533748) SetParam not implemented for gearbox
(1452366688 773544211) SetParam not implemented for gearbox
(1452366688 773575698) GetAngle not implemented for gearbox
(1452366688 773589635) GetParam not implemented for gearbox
(1452366688 773598048) GetAngle not implemented for gearbox
(1452366688 773609559) GetParam not implemented for gearbox
(1452366688 773751752) [Err] [Plugin.hh:153] Failed to load plugin libgazebo_ros_control.so: libgazebo_ros_control.so: cannot open shared object file: No such file or directory
(1452366688 777779032) GetVelocity not implemented for gearbox
(1452366688 777803674) GetAngle not implemented for gearbox
(1452366688 777819891) SetForce not implemented for gearbox
(1452366688 777831749) GetVelocity not implemented for gearbox
(1452366688 777843411) GetAngle not implemented for gearbox
(1452366688 777854909) SetForce not implemented for gearbox
...

Firstly, it seems that GetVelocity and other accessors are not implemented for gearbox joints, is this right? If it is, is it 'hopeless' to control a gearbox joint without programming my ... (more)

edit retag flag offensive close merge delete

Comments

I don't think there's a publicly visible tutorial as yet, but it seems that the tutorials page is changing as we speak. The team at osrf is probably super swamped. It seems that much (but not all!) of the URDF history is relevant for "sdformat.org"... and if you/we had experience with URDF then digging into the API, things would make sense. The catch is that much of the URDF tutorial content is no longer accessible (even via archive.org), so there's not much we can do but ask questions and try.

SL Remy gravatar imageSL Remy ( 2016-02-16 09:35:40 -0600 )edit

If a plugin is listed in the sdf, but the file isn't found, it appears to not throw an error or a warning.

SL Remy gravatar imageSL Remy ( 2016-02-16 09:39:59 -0600 )edit

Were you able to simulate a robot with highly geared servomotors? I am facing the same problem. Do you have any advice or any model to share with me? Thanks!

Marcos Maximo gravatar imageMarcos Maximo ( 2017-09-02 23:48:46 -0600 )edit