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

Is it possible to remap /camera/color topics in realsense2_camera

asked 2018-10-22 22:40:11 -0500

jcgarciaca gravatar image

I am working with a realsense camera (relasense2_camera package), such that I need to remap the /my_namespace/camera/color/* topics to /my_namespace/camera/rgb/*. I have tried with a launch file as below:

  <group ns="my_namespace">
    <remap from="/my_namespace/camera/color" to="/my_namespace/camera/rgb" />
    <remap from="/my_namespace/camera/depth/image_rect_raw" to="/my_namespace/camera/depth/image_rect" />
    <include file="$(find realsense2_camera)/launch/rs_rgbd.launch">
        <arg name="namespace" value="camera"/>
        <arg name="rgb" value="rgb"/>


Nevertheless, when launching the file and checking the rostopic list outuput, I noted those topic didn't change. Is it possible to remap them?

From my launch file, the second remap (from="/my_namespace/camera/depth/image_rect_raw" to="/my_namespace/camera/depth/image_rect") works well.

Thank you

edit retag flag offensive close merge delete


Are you sure you actually have a topic /my_namespace/camera/color when doing rostopic list ? (and without the remapping obviously).

Also this (<arg name="namespace" value="camera"/>) shouldn't work since there are no arguments namespace defined in the launch file (unless you've modified it ?)

Delb gravatar image Delb  ( 2018-10-23 01:57:44 -0500 )edit

Hi, it is not actually just a topic but a set of topics. When I do rostopic list, the following topics appear (among others):

jcgarciaca gravatar image jcgarciaca  ( 2018-10-23 14:24:17 -0500 )edit




jcgarciaca gravatar image jcgarciaca  ( 2018-10-23 14:24:55 -0500 )edit

those are the topics I need to remap (color to rgb). About the namespace argument @Delb is right, it seems I used a previous version. After an update it is <arg name="camera" value="camera"/> now.

jcgarciaca gravatar image jcgarciaca  ( 2018-10-23 14:27:51 -0500 )edit

You can get rid of your first remap, you have to remap a topic but you can't for a set of topics. But you did well setting the arg rgb to rgb, its default value is color so I'm not sure why it's not affected correctly.

Delb gravatar image Delb  ( 2018-10-24 01:58:07 -0500 )edit

Can you try to replace <arg name="camera" value="camera"/> by something like <arg name="camera" value="other_camera"/> just to see if you will actually get a set of topics like /my_namespace/other_camera/ ?

Delb gravatar image Delb  ( 2018-10-24 01:59:37 -0500 )edit

Yes, I replaced camera argument to other_camera, and all topics changed

jcgarciaca gravatar image jcgarciaca  ( 2018-10-25 09:36:25 -0500 )edit

But you still have the /color/ set of topics ? It's weird that when you change the arg camera it works but not with rgb, are you sure you have <arg name="rgb" default="color" /> in your rs_rgbd.launch ? You can even change the default value directly to rgb.

Delb gravatar image Delb  ( 2018-10-25 11:23:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-12 12:36:46 -0500

Cdfghglz gravatar image

For some reason it seems to be hardcoded in base_realsense_node.cpp on line 116 (as of 2.1.4)

    _stream_name[COLOR] = "color";
edit flag offensive delete link more


Instead, you can directly use the remap statement by putting just before the node description in the launch file

kivrakh gravatar image kivrakh  ( 2019-07-01 07:30:01 -0500 )edit

@kivrakh May I know how to remap?

I tried in command line color:=rgb and also in launch file <remap from="color" to="rgb" /> But both ways don't work for me.

BCJ gravatar image BCJ  ( 2020-06-23 00:59:03 -0500 )edit

put remap statement before the group namespace definition. I solved this issue like that.

kivrakh gravatar image kivrakh  ( 2020-06-23 01:40:51 -0500 )edit

@kivrakh I tried the following setup in my launch file but still didn't manage to solve it. Btw do you test the spencer package with D435 successfully?

  <remap from="color" to="rgb"/> 

  <include file="$(find realsense2_camera)/launch/rs_rgbd.launch">
    <arg name="camera" value="/spencer/sensors/rgbd_front_top"/>
    <arg name="tf_prefix" value="rgbd_front_top"/>
BCJ gravatar image BCJ  ( 2020-06-23 02:28:45 -0500 )edit

I could not find my packages to verify the exact solution. As far as I remember, try to remap in rs_rgbd.launch. If you still could not manage, use the hardcoded solution in base_realsense_node.cpp.

<remap from="color" to="rgb"/> 
<group ns="$(arg camera)">
<!-- Launch the camera device nodelet-->
<include file="$(find realsense2_camera)/launch/includes/nodelet.launch.xml">

Yes, I test spencer package with D435, it can be somehow painfull. Upper_body_detector uses message time synchronizer applied to the depth, camera_info and ground plane topics. Make sure you synchronize all these topics. Also upper_body_detector is tied to a fixed 640x480 resolution, you may need scale your input image (1280x720) appropriately

kivrakh gravatar image kivrakh  ( 2020-06-23 03:39:04 -0500 )edit

@kivrakh, I have remapped successfully and however only have detection result but not tracking.

I have seen what you mentioned in the issue. I have checked all three topics and all is around 30hz. The resolution is set to 640x480 when I launch the rs_rgbd.launch so I assume that I no need to rescale the input image. Do you have any rosbag file that you record from D435 before? For me do to the testing and debugging.

Thanks for your help :)

BCJ gravatar image BCJ  ( 2020-06-23 21:13:17 -0500 )edit

@kivrakh Can I contact you in person? I have struggled for the package using D435 for few weeks and might need your help really. My email address is

BCJ gravatar image BCJ  ( 2020-06-24 21:21:51 -0500 )edit

@BCJ did you finally make the upper body detector work with Intel Realsense D435? I am having same issues that you related. Thanks in advance.

Alessandro Melino gravatar image Alessandro Melino  ( 2021-03-09 06:08:55 -0500 )edit

Question Tools

1 follower


Asked: 2018-10-22 22:40:11 -0500

Seen: 1,428 times

Last updated: Feb 12 '19