ROS2 Bag Problem: Data Loss and Frame Rate Below Expected 30 FPS
I've recorded a ROS2 bag file and upon reviewing it, I've noticed that there's significant data loss, which has resulted in a frame rate that is below the intended 30 FPS. The bag file contains messages from several topics, but the frame rate is not consistent with the default settings.
ROS2 Distribution: Humble Here is the ros2 bag info:
$: ros2 bag info human_test.bag/
Files: human_test.bag_0.db3
Bag size: 662.5 MiB
Storage id: sqlite3
Duration: 8.083090822s
Start: Dec 1 2024 11:27:57.011326543 (1733023677.011326543)
End: Dec 1 2024 11:28:05.094417365 (1733023685.094417365)
Messages: 1026
Topic information: Topic: /camera/color/camera_info | Type: sensor_msgs/msg/CameraInfo | Count: 153 | Serialization Format: cdr
Topic: /camera/depth/image_raw | Type: sensor_msgs/msg/Image | Count: 213 | Serialization Format: cdr
Topic: /camera/depth/points | Type: sensor_msgs/msg/PointCloud2 | Count: 242 | Serialization Format: cdr
Topic: /camera/color/image_raw | Type: sensor_msgs/msg/Image | Count: 174 | Serialization Format: cdr
Topic: /camera/depth/camera_info | Type: sensor_msgs/msg/CameraInfo | Count: 243 | Serialization Format: cdr
Topic: /camera/depth_to_color | Type: orbbec_camera_msgs/msg/Extrinsics | Count: 1 | Serialization Format: cdr
I would greatly appreciate any guidance into what might be causing this data loss and how I can resolve it.
It is recommended to use "ros2 topic hz /camera/color/image_raw /camera/depth/image_raw" respectively to check the specific frame rates of the color and depth streams. If the HZ frame rate is close to normal, it may be related to the writing speed of rosbag to Flash. You can consider switching to save to a partition with a faster rate. At the same time, you can also consider using mcap for recording, which relatively improves and optimizes the writing speed.