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

Gazebo_ros spawn_model reference_frame not working

asked 2016-03-22 12:38:04 -0500

Hi there,

I am launching the following world with the empty_world.launch file:

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

Where world.world is:

<sdf version="1.5">
  <world name="default">
    <include>
      <uri>model://sun</uri>
    </include>
    <include>
      <uri>model://ground_plane</uri>
    </include>


    <!-- Extra objects -->
    <model name='unit_cylinder_1'>
        <pose>0 0 2 3.141592 0 1.57</pose>
    ...

I am also launching the following:

<node ns="alpha" name="spawn_robot" pkg="gazebo_ros" type="spawn_model" output="screen"
      args="-param robot_description
            -urdf -model alpha
            -robot_namespace alpha
            -reference_frame unit_cylinder_1
            -x 2
            -y 4
            -z 0"/>

But I keep getting this error: Spawn status: SpawnModel: reference reference_frame not found, did you forget to scope the link by model name? Parameter robot_description is in the alpha namespace and it is a valid URDF (it works if I remove the -reference_frame).

Basically, my question is: is there a bug on the -reference_frame argument or is there something else I am missing? Maybe is related with namespaces or something.

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2016-09-07 20:19:39 -0500

mrjogo gravatar image

(cross-answered in http://answers.gazebosim.org/question... )

From experimentation, the -reference_frame option in spawn_model must be relative to a link in a model in the world. So in your case, the following modifications should work:

world.world:

...
<!-- Extra objects -->
<model name='unit_cylinder_1'>
    <pose>0 0 2 3.141592 0 1.57</pose>
    <link name='my_link'>
        ....
   </link>
...

And in your node args -reference_frame unit_cylinder_1::my_link

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-03-22 12:38:04 -0500

Seen: 4,310 times

Last updated: Sep 07 '16