0
$\begingroup$

Gazebo Answers logo

Hello all.

I know already how to use the sdf by following the tutorials here. However, most models offered online sources are still in .xacro or .urdf file.

With sdf, we put "model.sdf" file under ~/.gazebo/model directory, then create model.config file also. I am wondering is this still applies to .xacro or .urdf file? (I tried rosrun xacro xacro.py to convert .xacro file to urdf, but it fails in converting it.)

Thus, I don't know how to spawn them in gazebo.

I am using the ros_gazebo_simulator ( gazebo version 1.5), but I don't think it makes any difference between this and the standalone version.

So I have 2 questions:

  1. how to spawn the .xacro model

  2. how to spawn the .urdf model

    without doing any conversion to sdf. Thanks!


Originally posted by gazer on Gazebo Answers with karma: 5 on 2013-07-03

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

You have to run a xacro file through xacro.py in order to first create a urdf file. Then you can pass the urdf file directly into Gazebo, just as you would an sdf file. Gazebo will handle the conversion for you.


Originally posted by nkoenig with karma: 7676 on 2013-07-03

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by FiliusFortunae on 2013-07-09:
Hello, I am working on the same thing and I got xacro to convert to urdf, and have been getting compile errors like: https://gist.github.com/ftalex/5961582 Has the formats changed? I am not clear when the urdf I am working with was made but I am also using the integrated gazebo with ros

Comment by FiliusFortunae on 2013-07-09:
When I got rid of the joint:hinge element and the controller:ackermann_plugin it loaded. So I am going to look if there is a new version of these elements. I wonder if the plugin code will need to change as well.

Comment by Ben B on 2013-07-11:
Filius, I've had similar problems before. Some element of the URDF isn't parsed properly and breaks the conversion. I deal with it in the same way: try to find and remove the offending element.

$\endgroup$

Your Answer

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