Open1

ROS2 - Realsense

Min Pyae SoneMin Pyae Sone

The following methods are inspired from
http://docs.ros.org/en/humble/Tutorials/Advanced/Recording-A-Bag-From-Your-Own-Node-Py.html
https://github.com/IntelRealSense/realsense-ros/blob/ros2-master

First run the realsense camera node with

ros2 run realsense2_camera realsense2_camera_node

To record the raw bag file, simply run ros2 bag program subscribing the image_raw topic

ros2 bag record /camera/camera/color/image_raw

If you want to decrease the frame rate and record with rosbag, this might help
https://github.com/IntelRealSense/librealsense/issues/3537

This command will help change frame rate. The first value after color_profile is width, then height and framerate. The size of bag after recording for one minute reduces to under 200 MB.

ros2 launch realsense2_camera rs_launch.py rgb_camera.color_profile:=1280,720,10