This package contains nodes for subscribing to and processing RGB and depth images from an Orbbec camera. It includes functionality for image viewing, alignment, and obstacle detection based on depth information.
Subscribes to raw RGB and depth images and displays them in separate windows.
Features:
- Subscribes to
/camera/color/image_rawfor RGB images - Subscribes to
/camera/depth/image_rawfor depth images - Displays images at 30 FPS
- Press ESC to exit
To run:
ros2 run camera_subscriber image_viewerSubscribes to raw RGB and depth images, processes them, and publishes aligned images.
Processing steps:
- Crops the RGB image to 640x400 (rows 35-435) to focus on the central region
- Flips the depth image horizontally to align with the RGB image
- Publishes processed images at 30 FPS
Published topics:
/aligned/rgb/image_raw- Aligned RGB image (640x400)/aligned/depth/image_raw- Aligned depth image (640x400)
To run:
ros2 run camera_subscriber aligned_image_publisherSubscribes to the aligned RGB and depth images and displays them in separate windows.
Features:
- Subscribes to
/aligned/rgb/image_rawfor aligned RGB images - Subscribes to
/aligned/depth/image_rawfor aligned depth images - Displays images at 30 FPS
- Press ESC to exit
To run:
ros2 run camera_subscriber aligned_image_viewerAnalyzes depth images to detect obstacles and potential drop-offs in front of the robot.
Detection logic:
- Focuses on the bottom 20% of the depth image
- Divides the area into left, center, and right regions
- Evaluates average depth in each region:
- < 0.3m: Obstacle detected (danger zone)
- 0.3m-0.8m: Safe zone
-
0.8m: Potential drop-off risk (stairs/cliff)
Parameters:
depth_image_topic: Topic for depth images (default:/camera/depth/image_raw)bottom_roi_height_ratio: Ratio of image height to analyze (default: 0.2)safe_distance_min: Minimum safe distance in meters (default: 0.3)safe_distance_max: Maximum safe distance in meters (default: 0.8)roi_side_width_ratio: Width ratio for side regions (default: 0.3)
To run with default parameters:
ros2 run camera_subscriber detectorTo run with custom parameters:
ros2 run camera_subscriber detector --ros-args -p safe_distance_min:=0.5 -p safe_distance_max:=1.0/camera/color/image_raw(sensor_msgs/msg/Image) - Raw RGB image/camera/depth/image_raw(sensor_msgs/msg/Image) - Raw depth image
/aligned/rgb/image_raw(sensor_msgs/msg/Image) - Aligned RGB image (640x400)/aligned/depth/image_raw(sensor_msgs/msg/Image) - Aligned depth image (640x400)
-
First, make sure your Orbbec camera is properly connected and the drivers are running.
-
To view raw images:
ros2 run camera_subscriber image_viewer
-
To process and publish aligned images:
ros2 run camera_subscriber aligned_image_publisher
-
To view the aligned images:
ros2 run camera_subscriber aligned_image_viewer
-
To detect obstacles based on depth information:
ros2 run camera_subscriber detector
- All nodes operate at approximately 30 FPS (33ms intervals)
- Press ESC to exit any of the viewer nodes
- Depth images are normalized for display purposes (scaled by 0.03)
- The obstacle detector logs warnings and alerts based on detected conditions