Ask Your Question
1

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:

<launch>
  <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"/>
    </include>
  </group>

</launch>

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

Comments

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 imageDelb ( 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):

/my_namespace/camera/color/camera_info
/my_namespace/camera/color/image_raw
/my_namespace/camera/color/image_raw/compressed
jcgarciaca gravatar imagejcgarciaca ( 2018-10-23 14:24:17 -0500 )edit

...

/my_namespace/camera/color/image_raw/compressed/parameter_descriptions
/my_namespace/camera/color/image_raw/compressed/parameter_updates
/my_namespace/camera/color/image_raw/compressedDepth
/my_namespace/camera/color/image_raw/compressedDepth/parameter_descriptions

...

jcgarciaca gravatar imagejcgarciaca ( 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 imagejcgarciaca ( 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 imageDelb ( 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 imageDelb ( 2018-10-24 01:59:37 -0500 )edit

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

jcgarciaca gravatar imagejcgarciaca ( 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 imageDelb ( 2018-10-25 11:23:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

Comments

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 289 times

Last updated: Feb 12