Home | Tutorials | Wiki | Issues
Ask Your Question
0

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

Cheers

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

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
0

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

Comments

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

jmare gravatar imagejmare ( 2017-08-30 06:25:02 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 407 times

Last updated: Aug 29 '17