In that particular demo, the images were throttled at ~10 Hz and the compressed topics were recorded:
<!-- Throttling messages -->
<group ns="camera">
<node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/data_throttle camera_nodelet_manager" output="screen">
<param name="rate" type="double" value="10.0"/>
<remap from="rgb/image_in" to="rgb/image_rect_color"/>
<remap from="depth/image_in" to="depth_registered/image_raw"/>
<remap from="rgb/camera_info_in" to="rgb/camera_info"/>
<remap from="rgb/image_out" to="/data_throttled_image"/>
<remap from="depth/image_out" to="/data_throttled_image_depth"/>
<remap from="rgb/camera_info_out" to="/data_throttled_camera_info"/>
</node>
</group>
Record:
$ rosbag record /odom /data_throttled_image/compressed /data_throttled_image_depth/compressedDepth /data_throttled_camera_info /tf -O kinect
Tip 1
If you are using freenect_launch, it may be more efficient to set data_skip
instead of using the data_throttle
nodelet above:
$ roslaunch freenect_launch freenect.launch depth_registration:=true data_skip:=3
$ rosbag record /odom /camera/rgb/image_rect_color/compressed camera/depth_registered/image_raw/compressedDepth /camera/rgb/camera_info /tf -O kinect
Tip 2
If you don't want to save compressed images in the rosbag, you may compress to rosbag after the recording to save some space when storing it:
$ rosbag compress kinect.bag
Make sure to decompress before replaying it:
$ rosbag decompress kinect.bag
$ rosbag play --clock kinect.bag
cheers