Rosanswers logo

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/empty.world" 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?

Originally posted by davinci on ROS Answers with karma: 2573 on 2012-12-21

Post score: 0


1 Answer 1


Rosanswers logo

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.

Originally posted by joq with karma: 25443 on 2012-12-22

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by davinci on 2012-12-24:
Thanks for your response. But it does not work. I should be able to see a camera1_ns using rostopic list?

Comment by davinci on 2012-12-29:
I am indeed remapping camera to camera1_ns But still not getting it to work...no camera1_ns is appearing in rostopic list. Tried it in several ways. Is the position of the remap argument okay?

Comment by joq on 2012-12-29:
It is inside the spawn_arm node. Maybe you should move it to the gazebo node?

Comment by davinci on 2012-12-30:
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.


Your Answer

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