How to align depth using realsense2_camera_node and RealSense D435?

Hi,
I cannot align depth frames to color when receiving camera’s stream over ros topic.
I’m using the GitHub - IntelRealSense/realsense-ros: Intel(R) RealSense(TM) ROS Wrapper for Depth Camera package, it provides following topics:

/color/camera_info
/color/image_raw
/color/metadata
/depth/camera_info
/depth/image_rect_raw
/depth/metadata
/extrinsics/depth_to_color
/extrinsics/depth_to_infra1
/extrinsics/depth_to_infra2
/imu
/infra1/camera_info
/infra1/image_rect_raw
/infra1/metadata
/infra2/camera_info
/infra2/image_rect_raw
/infra2/metadata
/parameter_events
/rosout
/tf_static

When I use the camera directly this code snippet (simplified) works fine

import pyrealsense2 as rs
pipeline = rs.pipeline()
align_to = rs.stream.color
align = rs.align(align_to)

while True:
        # Get frameset of color and depth
        frames = pipeline.wait_for_frames()

        # Align the depth frame to color frame
        aligned_frames = align.process(frames)

        # Get aligned frames
        aligned_depth_frame = aligned_frames.get_depth_frame()

But when I subscribe to /depth/image_rect_raw and /color/image_raw there is obviously no pipeline and all my attempts to align failed so far.

Could someone suggest how to solve this?
Thanks

Hi,
A user has shared some guidance in
https://jetsonhacks.com/2019/10/25/realsense-ros-wrapper-jetson-nano/

It may not work on latest r32.7.3(Jetpack 4.6.3). You may install r32.3.1 and give it a try.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.