Home | Tutorials | Wiki | Issues
Ask Your Question

Multiple instances of same sensor publishing to same topic

asked 2020-01-07 03:08:46 -0500

wongrufus gravatar image

updated 2020-01-07 20:44:00 -0500

I have my simulated depth sensor configured as follows


    <plugin name="camera_plugin" filename="libgazebo_ros_openni_kinect.so">
      <!-- Keep this zero, update_rate in the parent <sensor> tag
        will control the frame rate. -->

Whenever I have more than 1 sensor in my gazebo world (created through the Insert tab in the gazebo GUI), the topics published by the sensors get mixed together and the following error message appears:

I've tried adding a robotNamespace for the plugin but that does not solve the problem, the same problem persists, just with the same robotNamespace added in front of all the topics.

This answer that says using an empty robotnamespace doesn't seem to work.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-01-09 01:48:24 -0500

wongrufus gravatar image

updated 2020-01-09 01:49:51 -0500

The key is to not use global names for all names


(Notice the starting / removed)

And follow the instructions here of setting up the group namespace and tf prefix.

Something along the followings in the launch file will do:

<param name="robot_description_sdf" textfile="kinect/model.sdf"/>

<group ns="kinect1">
    <param name="tf_prefix" value="kinect1_tf" />
    <node pkg="gazebo_ros" type="spawn_model" name="spawn_sdf" args="-sdf -param /robot_description_sdf -model kinect1 -x -3 -y 0 -z 1" />

<group ns="kinect2">
    <param name="tf_prefix" value="kinect2_tf" />
    <node pkg="gazebo_ros" type="spawn_model" name="spawn_sdf" args="-sdf -param /robot_description_sdf -model kinect2 -x -3 -y 1 -z 1" />
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-01-07 03:08:46 -0500

Seen: 95 times

Last updated: Jan 09