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

Remapping topics in gazebo, not working?

asked 2012-12-21 04:52:27 -0600

davinci gravatar image

updated 2012-12-24 07:52:15 -0600

I am trying to remap a camera stream from /camera to /camera1_ns in gazebo.

  <!-- set use_sim_time flag -->
  <param name="/use_sim_time" value="true" />

  <!-- start gazebo with an empty plane -->
  <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/" respawn="false" output="screen"/>

<!-- start gui -->
<node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>

<!-- spawn model -->
 <node name="spawn_arm" pkg="gazebo" type="spawn_model" args="-file simple_arm.model -gazebo -model     simple_arm" respawn="false" output="screen" >

<!-- remapping topics -->

<remap from="/camera1_ns" to="/camera" />


But there is no /camera1_ns listed with rostopic list. Is this approach correct or should it be done otherwise?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-12-22 04:59:35 -0600

joq gravatar image

updated 2012-12-31 07:59:49 -0600

Does it help to delete the leading '/' in the remapped names?

<remap from="camera" to="camera1_ns" />

EDIT: Maybe I got the names backwards from what you intended?

EDIT2: Move the remap from the arm_spawn node to the gazebo node.

edit flag offensive delete link more


Thanks for your response. But it does not work. I should be able to see a camera1_ns using rostopic list?

davinci gravatar image davinci  ( 2012-12-24 06:59:28 -0600 )edit

I am indeed remapping camera to camera1_ns But still not getting it to camera1_ns is appearing in rostopic list. Tried it in several ways. Is the position of the remap argument okay?

davinci gravatar image davinci  ( 2012-12-29 02:20:40 -0600 )edit

It is inside the spawn_arm node. Maybe you should move it to the gazebo node?

joq gravatar image joq  ( 2012-12-29 04:42:23 -0600 )edit

Yes, that works! Thanks! Seemed illogical as the simulation doesn't know anything yet about camera's at that point, but it seems to be the correct way.

davinci gravatar image davinci  ( 2012-12-30 03:37:06 -0600 )edit

answered 2017-08-19 14:20:42 -0600

is better to change the topic in the urdf file, check this example, specifically in the "xxxTopicName" tags:

 <!-- ASUS Xtion PRO camera for simulation -->
  <gazebo reference="${name}_depth_frame">
    <sensor type="depth" name="${name}">
      <horizontal_fov>${60.0 * M_PI/180.0}</horizontal_fov>
      <plugin name="${name}_camera_controller" filename="">
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-12-21 04:52:27 -0600

Seen: 2,302 times

Last updated: Aug 19 '17