Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Connecting gazebo and ros_control while using SDF files

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?

Connecting gazebo and ros_control while using SDF files

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 own controller?

Secondly, I did not found the libgazebo_ros_control.so anywhere, I checked and the ros-jade-gazebo-ros-pkgs is properly installed from the repository. Is there a problem with this package? I think that the main header concerning this file is the following. An odd fact is that I had not a single warning concerning ros_control plugin when launching my gazebo simulation.