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
Originally posted by jcgarciaca on ROS Answers with karma: 67 on 2018-10-22
Post score: 1
Original comments
Comment by Delb on 2018-10-23:
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 ?)
Comment by jcgarciaca on 2018-10-23:
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
Comment by jcgarciaca on 2018-10-23:
...
/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
...
Comment by jcgarciaca on 2018-10-23:
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.
Comment by Delb on 2018-10-24:
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.
Comment by Delb on 2018-10-24:
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/
?
Comment by jcgarciaca on 2018-10-25:
Yes, I replaced camera argument to other_camera
, and all topics changed
Comment by Delb on 2018-10-25:
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
.
Comment by jcgarciaca on 2018-10-25:
Yes, I still have the set of /color
topics and the launch file has <arg name="rgb" default="color" />
, but even if I do <arg name="rgb" default="rgb" />
the topics keep as /color
.
Comment by Delb on 2018-10-26:
So it's probably "hard coded" somewhere, I've found in realsense2_camera/scripts/rs2_listener.py
l42 : 'topic': '/camera/color/image_raw'
. Can you try to see if modifying this to 'topic': '/camera/rgb/image_raw' change something ? (eventhough it's not recommended to change the source files)