Import URDF Model into SDF
I am trying to attach the urdf.xacro models here: https://bitbucket.org/DataspeedInc/velodyne_simulator/src/d967d5a0fdacebdebcd3b24f1db1bcc70dc5c656/velodyne_description/urdf/?at=master
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
Asked by jmare on 2017-08-28 01:23:51 UTC
Answers
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.
Asked by Carlos Agüero on 2017-08-29 05:37:34 UTC
Comments
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.
Asked by SorinV on 2017-08-29 09:32:06 UTC
Comments
Thank you, this worked for me after some playing around!
Asked by jmare on 2017-08-30 06:25:02 UTC
Comments