This repository provides a simple ROS 2 pipeline for passive stereo depth estimation using Retinify and conversion to 3D colored point clouds.
-
🔹 Disparity Estimation A node that runs the Retinify disparity network on rectified stereo pairs and publishes the disparity image.
-
🔹 Disparity → PointCloud2 A node that converts the disparity map into a
sensor_msgs/PointCloud2, using camera calibration parameters. The left rectified image is used as the RGB texture of the 3D point cloud. -
🔹 ROS 2 native (tested on Humble + JetPack 6.2 / x86_64).
- ROS 2 Humble
- OpenCV 4.5.4
- Retinify
Clone into your workspace:
cd ~/ros2_ws/src
git clone https://github.com/Projeto-Voris/passive_stereo.git
cd ..
colcon build
source install/setup.bashRuns Retinify disparity estimation.
Subscribed topics:
/stereo/left/image_raw(sensor_msgs/Image)/stereo/right/image_raw(sensor_msgs/Image)/stereo/left/camera_info(sensor_msgs/CameraInfo)/stereo/right/camera_info(sensor_msgs/CameraInfo)
Published topics:
/stereo/disparity/image(stereo_msgs/DisparityImage)/stereo/disparity/debug/image(sensor_msgs/Image)/stereo/left/rect_image(sensor_msgs/Image)/stereo/right/rect_image(sensor_msgs/Image)
Parameters
| Parameter | Description | Value |
|---|---|---|
publish_rectified |
Publish rectified images | True |
debug_image |
Publish debug disparity image | False |
Converts disparity to colored point cloud from left rectified image.
Subscribed topics:
/stereo/disparity(stereo_msgs/DisparityImage)/stereo/left/image_rect(sensor_msgs/Image)/stereo/left/camera_info(sensor_msgs/CameraInfo)
Published topics:
/stereo/points2(sensor_msgs/PointCloud2)
Parameters
| Parameter | Description | Value |
|---|---|---|
frame_id |
Pointcloud frame ID | left_camera_link |
sampling_factor |
Publish debug disparity image | 0.8 |
crop_factor |
Maximum occupancy threshold | 0.9 |
-
Launch your stereo camera drivers (e.g. FLIR, RealSense, ZED) that publish raw images and camera info.
-
Run:
ros2 launch passive_stereo passive_stereo.launch.py
MIT License. See LICENSE for details.