Rosanswers logo

I want to create my own robot model and simulate that with C or C++ code through gazebo. First I create my own robot model by Solidwork software and export the model to xml and STl files by using the plug-in SimMechanics Link. Then I transformed urdf fil from the xml file by the simmechanics_to_urdf packet. my code likes below:

rosrun simmechanics_to_urdf convert.py jixiebi.xml xml > jixiebi.urdf

After that, I copy all of the STL files to the catalog of /simulator_gazebo/gazebo_worlds/Media/models. Finally,I run the below code

rosrun gazebo spawn_model -file `pwd`/jixiebi.urdf -urdf -z 1 -model my_jixiebi

and now I can see my model. But the model goes to mess. I guess it's the coordinate error, but I don't know how to deal with. I know the urdf has origin tag but I find it's very difficult to fix all link's and joint's coordinate correctly. What's worse, my model has hundreds of links and joints. So, here is my questions.

  1. Is there any wrongs in my process?
  2. How to deal with my problem?
  3. If the mess model problem could figure out, the next step is how to do?

Thanks a lot and look forward to your answer.

Originally posted by shenhaobin on ROS Answers with karma: 19 on 2011-08-03

Post score: 1


1 Answer 1


Rosanswers logo

simmechanics_to_urdf is desiged to save a lot of work when creating a URDF file for a complex robot, but it does not do everything. Definitely check out this tutorial. Also, before moving into gazebo, I would ensure that your model looks right and moves correctly in rviz first.

Originally posted by David Lu with karma: 10932 on 2011-08-04

This answer was ACCEPTED on the original site

Post score: 4

Original comments

Comment by Martin Günther on 2011-08-05:
It's all explained in the tutorial linked by David. If you have a question concerning a specific step, ask.

Comment by shenhaobin on 2011-08-05:
how to import my model to the rviz? And if the model would not look right in rviz, how to correct it?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.