realsense-ros: setting align_depth causes misaligned coloured point cloud

When I set the parameter align_depth.enable to True, the coloured point cloud will have misaligned colour, i.e. the colour will not be correctly registered to the points.

Consider the following ROS2 launch file:

launch:
- node_container:
    pkg: rclcpp_components
    exec: component_container
    name: camera_container
    namespace: realsense
    composable_node:
    -   pkg: realsense2_camera
        plugin: realsense2_camera::RealSenseNodeFactory
        name: camera
        param:
        -   name: rgb_camera.profile
            value: 640x480x30
        -   name: "align_depth.enable"
            value: True
        -   name: pointcloud.enable
            value: True
        -   name: pointcloud.stream_filter
            value: 2 # RS2_STREAM_COLOR

The launch file will start the node, set VGA resolution @ 30 fps (rgb_camera.profile), align the colour with the depth (align_depth.enable) and publish a coloured point cloud (pointcloud).

With

        -   name: "align_depth.enable"
            value: True

the point cloud is shown in RViz2 with misaligned colour: rs_not_aligned.zip. The image shows the point cloud of a RealSense box. It is clearly visible that the white background is registered to the majority of the box points in the foreground.

When set to False or removed, the colour is correctly aligned with the points: rs_aligned.zip

It looks like the colour is registered twice before it is assigned to the points.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Thanks very much @cardboardcode for your report.

Hi @christian-rauch & @cardboardcode, Could you please try the PR #2775 and let us know if that works?

Thanks.

Will update here once I have done so. Thanks @Arun-Prasad-V 😄 👍

Hi @christian-rauch & @cardboardcode, Could you please try the PR #2775 and let us know if that works?

Thanks.