This docker file can be used to setup automatically realsense and make it publish topics on ROS2 Humble.
Digit the following command (in the folder where Dockerfile is located) to create the docker image:
docker build -t realsense_ros2 .From the same folder, digit the following command:
./docker_run.shInstallation guide for realsense:
https://github.com/IntelRealSense/realsense-ros
To check whether realsense is connected:
lsusb | grep RealSenseOnce inside the container, you can start your ROS2 node by launching realsense node:
ros2 launch realsense2_camera rs_launch.pyros2 launch realsense2_camera rs_launch.py \
rgb_camera.color_profile:=640,480,15 \
depth_module.depth_profile:=640,480,15 \
enable_depth:=true \
align_depth.enable:=trueCompute pointcloud:
ros2 launch realsense2_camera rs_launch.py \
rgb_camera.color_profile:=640,480,15 \
depth_module.depth_profile:=640,480,15 \
align_depth.enable:=true \
pointcloud.enable:=trueNote: To visualize the pointcloud in RViz, select the frame = camera_link.
Important topics:
ros2 topic hz /camera/camera/aligned_depth_to_color/image_raw
ros2 topic hz /camera/camera/aligned_depth_to_color/image_raw/compressedros2 topic hz /camera/camera/color/image_raw
ros2 topic hz /camera/camera/color/image_raw/compressedTo visualize:
ros2 run rqt_image_view rqt_image_viewFor additional info, make reference to: