Robotics StackExchange | Archived questions

Xacro model spawn issues

Hey guys,

I need to simulate a custom robot model in Gazebo (I'm using Ubuntu 14.04.4 with ROS Indigo and Gazebo 7.1, which I have manually installed using the osrf repository). The xacro file I have works with Rviz just fine, but despite running without errors, I get nothing in Gazebo. I'm using the xacro files from here.

Also, here is my launch file:

    <launch>
         <include file="$(find gazebo_ros)/launch/empty_world.launch">
              <arg name="world_name" value="$(find yumi_gazebo)/worlds/yumi.world"/>
        </include>

       <param name="robot_description" command="$(find xacro)/xacro.py $(find yumi_description)/urdf/yumi.xacro" />

       <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model yumi" />

</launch>

I'm sorry if this is a repeat question, but I've tried quite a few of the other solutions, and I'm not really sure how to manually convert the xacro in question to SDF.

Asked by karthikj219 on 2016-05-18 22:09:03 UTC

Comments

Can you add the output from Gazebo when it's run in verbose mode?

Asked by nkoenig on 2016-05-19 08:44:40 UTC

Error [parser_urdf.cc:3408] Unable to call parseURDF on robot model Error [parser.cc:309] parse as old deprecated model file failed. [Err] [Server.cc:380] Unable to read sdf file[src/yumi_gazebo/launch/yumitest.launch]

This is what I get.

Asked by karthikj219 on 2016-05-19 22:12:50 UTC

Answers

You can pass your xacro file through the xacro.py script to produce a urdf file. This urdf file can be passed to gazebo, which will internally convert urdf to sdf.

Asked by nkoenig on 2016-05-18 23:53:47 UTC

Comments

@nkoenig, if you see the launch file above, I've done that, as was done in the tutorial, but still the same result.

Asked by karthikj219 on 2016-05-19 05:17:15 UTC

I'm not entirely sure if that is your intention, but you are using "yumi.xacro" as the model.

"yumi.xacro" only has definitions for macros in it and no real models.

I believe you meant to use "yumi.urdf.xacro", which has the actual models in it and not only macro definitions.

Asked by jwidauer on 2016-05-21 06:43:59 UTC

Comments

Invalid tag: Cannot load command parameter [robot_description]: command [/opt/ros/indigo/share/xacro/xacro.py /home/karthik/ws/src/yumi_description/urdf/yumi.urdf.xacro] returned with code [1]. Param xml is The traceback for the exception was written to the log file.

If I use the urdf.xacro, I get the above error, Which means I cant use it.

Asked by karthikj219 on 2016-05-22 22:47:50 UTC

Well that looks like your xacro files are not well formed. Try running the following command and post the results: "rosrun xacro xacro.py $(find yumi_description)/urdf/yumi.urdf.xacro" If you get an error message read through it and it should tell you where you have the problem in the model description.

Asked by jwidauer on 2016-05-24 16:16:43 UTC

Thanks for your help, I managed to create a SDF file for my robot manually. I'm using that now.

Asked by karthikj219 on 2016-05-25 02:58:52 UTC