ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Importing XML to gazebo

asked 2011-02-28 13:44:48 -0600

Nikita gravatar image

Hello. I want to import a CAD model to use it in Gazebo for simulation and control. I used the SimMechanics Link (ver. 3.1) to export it as XML from Solidworks and then tried converting it to Gazebo friendly XML using simmechanics_to_urdf package. However it doesn´t work when I spawn it showing: GazeboROSNode SpawnModel Failure: input model_xml not Gazebo XML, or cannot be converted to Gazebo XML I see no modifications in the original file, but I am not very familiar with XML or URDF, so I can´t tell if the convert.py is really getting the work done. Is it supposed to create a new file or modify the old one? How can I be sure that the conversion is taking place?

If anyone can help I will be very thankful.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2011-03-01 04:20:41 -0600

David Lu gravatar image

The simmechanics_to_urdf package will output a URDF file to standard out (if run using the xml option, which I assume you are). You should save this to a separate file and use that as your URDF file. You may want to run it like so...

rosrun simmechanics_to_urdf convert.py YOUR_XML.xml YOUR_CONFIG.yaml xml > YOUR_NEW_URDF.urdf

...and then use YOUR_NEW_URDF.urdf when trying to spawn in Gazebo.

edit flag offensive delete link more
0

answered 2011-03-02 06:02:28 -0600

Nikita gravatar image

Thanks for your help, when calling convert.py I forgot to put the output URDF file.

Another problem that I had was in the URDF file: the STL files didn´t have the full path and the object couldn´t be spawned when it has multiple parts.

I changed the SRT_FILENAME.srt with <path>/SRT_FILENAME.srt and now it works perfect for me.

Thanks again, now it works like a charm. Cheers.

edit flag offensive delete link more

Comments

Did you use the filenameformat option in the config file to fix it?
David Lu gravatar image David Lu  ( 2011-03-02 06:19:01 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2011-02-28 13:44:48 -0600

Seen: 1,778 times

Last updated: Mar 02 '11