0
$\begingroup$

Rosanswers logo

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)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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";

Originally posted by Cdfghglz with karma: 16 on 2019-02-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by kivrakh on 2019-07-01:
Instead, you can directly use the remap statement by putting just before the node description in the launch file

Comment by BCJ on 2020-06-23:
@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.

Comment by kivrakh on 2020-06-23:
put remap statement before the group namespace definition. I solved this issue like that.

Comment by BCJ on 2020-06-23:
@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"/>
  </include>

Comment by kivrakh on 2020-06-23:
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

Comment by BCJ on 2020-06-23:
@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 :)

Comment by BCJ on 2020-06-24:
@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 [email protected]

Comment by Alessandro Melino on 2021-03-09:
@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.

Comment by BCJ on 2021-03-09:
@Alessandro Melino Yes I run the package successfully. May I know what is your error? If the error is same as above, you can follow the solution that have been mentioned there.

Comment by Alessandro Melino on 2021-03-09:
@BCJ my problem is that the upper body detector seems to not receive any image, I desribed the problem in this issue if you can check it: https://github.com/spencer-project/spencer_people_tracking/issues/91 Thanks for your quick answer.

$\endgroup$

Your Answer

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