Skip to content

WarriorHanamy/ros_ws

Repository files navigation

ROS2 RealSense Workspace

This workspace contains the Intel RealSense ROS2 packages for working with RealSense cameras in ROS2 Humble.

Prerequisites

  • ROS2 Humble
  • Intel RealSense camera (D400 series)

Build

Use the provided ros_exec script to build:

./ros_exec build

To clean build artifacts:

./ros_exec clean

Usage

Start the Camera Node

With ros2 run:

./ros_exec ros2 run realsense2_camera realsense2_camera_node

With parameters (e.g., enable temporal and spatial filters):

./ros_exec ros2 run realsense2_camera realsense2_camera_node --ros-args \
  -p enable_color:=false \
  -p spatial_filter.enable:=true \
  -p temporal_filter.enable:=true

With ros2 launch:

./ros_exec ros2 launch realsense2_camera rs_launch.py

With parameters:

./ros_exec ros2 launch realsense2_camera rs_launch.py \
  depth_module.depth_profile:=1280x720x30 \
  pointcloud.enable:=true

With parameters file:

./ros_exec ros2 launch realsense2_camera rs_launch.py \
  params_file:=config/camera_params.yaml \
  camera_namespace:=robot1 \
  camera_name:=D455_1

Camera Name and Namespace

Set camera namespace and name to distinguish between cameras and platforms.

Example with ros2 launch:

./ros_exec ros2 launch realsense2_camera rs_launch.py \
  camera_namespace:=robot1 \
  camera_name:=D455_1

Example with ros2 run:

./ros_exec ros2 run realsense2_camera realsense2_camera_node \
  --ros-args \
  -r __node:=D455_1 \
  -r __ns:=/robot1

Result Topics

After launching with camera_namespace:=robot1 camera_name:=D455_1:

Nodes:

/robot1/D455_1

Topics:

/robot1/D455_1/color/camera_info
/robot1/D455_1/color/image_raw
/robot1/D455_1/color/metadata
/robot1/D455_1/depth/camera_info
/robot1/D455_1/depth/image_rect_raw
/robot1/D455_1/depth/metadata
/robot1/D455_1/extrinsics/depth_to_color
/robot1/D455_1/extrinsics/depth_to_depth

Services:

/robot1/D455_1/calib_config_read
/robot1/D455_1/calib_config_write
/robot1/D455_1/device_info
/robot1/D455_1/hw_reset

Configuration Files

Camera Parameters (config/camera_params.yaml)

enable_color: true
rgb_camera.color_profile: 1280x720x30
enable_depth: true
depth_module.depth_profile: 1280x720x30
align_depth.enable: true
enable_sync: true
publish_tf: true
tf_publish_rate: 1.0
pointcloud.enable: true

RViz Configuration (config/realsense.rviz)

Pre-configured RViz2 setup for visualizing:

  • Color camera stream
  • Depth camera stream
  • Point cloud (if enabled)
  • TF frames

Start RViz2 with config:

./ros_exec rviz2 -d config/realsense.rviz

Visualization with RViz2

1. Start RViz2:

./ros_exec rviz2

2. Add Display for Color Image:

  • Click "Add" button (or press Ctrl+N)
  • Select "Image" and click "OK"
  • Set Image Topic to: /robot1/D455_1/color/image_raw
  • Optional: Set Transport Hint to "raw"

3. Add Display for Depth Image:

  • Click "Add" button
  • Select "Image" and click "OK"
  • Set Image Topic to: /robot1/D455_1/depth/image_rect_raw
  • Optional: Set Transport Hint to "raw"

4. Add Display for Point Cloud (if enabled):

  • Click "Add" button
  • Select "PointCloud2" and click "OK"
  • Set Topic to: /robot1/D455_1/depth/points (if pointcloud.enable:=true)
  • Set Size (m): 0.01 or desired size
  • Set Color Transformer to "RGB8" or "Intensity"

5. Optional - Add Camera Display:

  • Click "Add" button
  • Select "Camera" and click "OK"
  • Set Image Topic to: /robot1/D455_1/color/image_raw
  • Set Camera Info Topic to: /robot1/D455_1/color/camera_info
  • Adjust visibility and clipping distance as needed

Script

The ros_exec script automatically:

  • Uses system Python
  • Sources ROS environment if install/setup.bash exists
  • Supports build, clean, and custom commands

Submodules

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors