Gazebo | Ignition | Community
Ask Your Question

Import URDF Model into SDF

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

jmare gravatar image

I am trying to attach the urdf.xacro models here:

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 -0600

SorinV gravatar image

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

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 -0600 )edit

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

Carlos Agüero gravatar image

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

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

Question Tools

1 follower


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

Seen: 3,063 times

Last updated: Aug 29 '17