Gazebo | Ignition | Community
Ask Your Question

Using SDF instead of URDF with ROS Robot State Publisher

asked 2020-07-13 07:31:12 -0500

teshansj gravatar image

With URDF models, you can use robot_state_publisher to have the joints published in tf. Since this needs the <robot> tag, it does not work with SDF models. If you try to roslaunch for a SDF it would say

Could not find the 'robot' element in the xml file

Everything else works fine in gazebo but the state publisher dies

Is there any way I can use robot state publisher with SDF? Maybe include URDF into the SDF? Or specify the <robot> tag in it somehow?


I have found many other questions related to this question but none had a positive answer and most of them are more than 5 years old. However,

  • This answer suggests that you can do anything with SDF that is possible in URDF.
  • This question has an answer suggesting an alternative by having both URDF and SDF but it's an ugly solution
  • There's this old unanswered question as well

I want to create a 6 wheeled robot model with two wheels having shock absorbers (prismatic joints with damping and spring actions). To my understanding, this cannot be done using URDF

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-07-15 11:03:32 -0500

teshansj gravatar image

My problem was URDF not being able to do some stuff SDF can. But I wasn't aware of the <gazebo> tags at the time. Using them, I was able to do what I wanted and no need of SDF has come up after that.

I got an answer in answers.gazebo. Linked for future reference for anyone in need

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-07-13 07:31:12 -0500

Seen: 960 times

Last updated: Jul 15 '20