Home | Tutorials | Wiki | Issues
Ask Your Question

Import URDF Model into SDF

asked 2017-08-28 01:23:51 -0500

jmare gravatar image

I am trying to attach the urdf.xacro models here: https://bitbucket.org/DataspeedInc/ve...

Into a existing SDF model.

Does anyone know if this can be directly imported and how? Or do i need to convert the urdf into SDF.

I am aware that the urdf.xacro needs to be converted to urdf. Using gazebo 8


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-08-29 09:32:06 -0500

SorinV gravatar image

updated 2017-08-29 09:40:27 -0500

These are the two lines of code you need:

rosrun xacro xacro --inorder robot.xacro > robot.urdf
gz sdf -p robot.urdf > robot.sdf

Keep in mind that sometimes not all the parameters will survive the conversion, so check the file before using it.

edit flag offensive delete link more


Thank you, this worked for me after some playing around!

jmare gravatar imagejmare ( 2017-08-30 06:25:02 -0500 )edit

answered 2017-08-29 05:37:34 -0500

Carlos Agüero gravatar image

updated 2017-08-29 05:41:10 -0500

You'll have to generate the URDF files from your .xacro files. Then, Gazebo can directly read URDF files, the conversion to SDF will happen internally. Here's a related tutorial and here a similar question.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-08-28 01:23:51 -0500

Seen: 143 times

Last updated: Aug 29 '17