How can I transform an URDF file to an SDF file?
Hello, I want to know if there is any way to transform an URDF file to an SDF file. How can I transform an URDF file to an SDF file?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hello, I want to know if there is any way to transform an URDF file to an SDF file. How can I transform an URDF file to an SDF file?
Hello.
You can use the following command:
$GAZEBO_PATH/Gazebo/Bin: ./gzsdf print your_urdf_file.urdf
and copy result to sdf-file.
I used this method in Groovy.
which sdf version please? because it is not working for sdf 1.4 :(
It seems I have used the version 1.3. But I don't sure that it is important. Which version of ROS have you used? What is your error?
@Alexandr Buyval I tried in both fuerte and groovy. The errors were: XML Element[turnGravityOff], child of element[link] not defined in SDF; Error reading element <link>,<model>,<sdf>. But, after modifying the tags according to the new sdf format manually I could convert the urdf to sdf. thanks
In newer versions of gazebo, the correct tool is now a flag on the gz
executable: gz sdf -p my_urdf.urdf > my_sdf.sdf
Asked: 2013-01-30 11:54:07 -0600
Seen: 5,355 times
Last updated: Jan 30 '13
it didnt work @Alexandr Buyval
john@john-K53SD:/opt/ros/fuerte/stacks/simulator_gazebo/gazebo/bin$ ./gzsdf print /home/john/ros/01-myfirstyo.urdf
bash: ./gzsdf: (the file or the directory doesnt exist)
Maybe it happens because I am using ros fuerte. What do you think?
it's broken in fuerte, please ticket. Conversion works in groovy. Here's another way to source setup in groovy:
source
rospack find gazebo
/scripts/setup.shthen, you can run:
gzsdf print [your urdf file]