Using gazebo_ros_control with SDF instead of URDF
My robot has a closed loop linkage, and therefore I cant use a URDF file as URDF only supports tree strucutres. Since SDF supports graph structures, I need to use that in order to simulate my robot. With that being said, I have a 2 actuators as well as a servo that I need to control. Normally, if I was to use an URDF, I would setup the
All the ros_control tutorials are based upon URDF, although there are lines in the tutorials stating "for your URDF/SDF file".
Currently, im simply adding this tag to the bottom of my SDF file (i wont include the whole thing for space reasons, for now at least):
....
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/surus_sim</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</model>
</sdf>
And when i launch the simulation, this is the error I receive in which i cant pinpoint where it comes from (searched through the ros_control plugin code):
[INFO] [WallTime: 1451341627.255617] [0.000000] Loading model xml from ros parameter
[INFO] [WallTime: 1451341627.264068] [0.000000] Waiting for service /gazebo/spawn_sdf_model
[INFO] [WallTime: 1451341628.176358] [0.000000] Calling service /gazebo/spawn_sdf_model
[INFO] [WallTime: 1451341629.094573] [0.001000] Spawn status: SpawnModel: Successfully spawned model
[spawn_model-3] process has finished cleanly
log file: /home/krystian/.ros/log/1fbfd810-adb2-11e5-9876-001c4239cab7/spawn_model-3*.log
[ INFO] [1451341632.830481140, 0.001000000]: Loading gazebo_ros_control plugin
[ INFO] [1451341632.830768827, 0.001000000]: Starting gazebo_ros_control plugin in namespace: /surus_sim
[ INFO] [1451341632.832180175, 0.001000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.
[ERROR] [1451341633.054706078, 0.001000000]: Could not find the 'robot' element in the xml file
[ INFO] [1451341633.104100859, 0.001000000]: Loaded gazebo_ros_control.
[ INFO] [1451341633.150833544, 0.022000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1451341633.232730090, 0.053000000]: Physics dynamic reconfigure ready.
The error [ERROR] [1451341633.054706078, 0.001000000]: Could not find the 'robot' element in the xml file
is what I cannot figure out as only a URDF file contains the <robot> tag and SDF file does not. surus_sim
is the name of the model in the sdf as well.
Any help would be appreciated. Would anyone know if the gazebo_ros_control plugin is meant to work directly with a SDF file? Ive looked around and a few people asked the question a while back but received no responses.