You can use
data_recorder.launch. See the launch arguments.
Example from a rosbag of Kinect data:
Record a sample bag:
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ rosbag record -O kinect /camera/rgb/image_rect_color /camera/rgb/camera_info /camera/depth_registered/image_raw /tf
Convert rosbag to RTAB-Map's database:
$ roslaunch rtabmap_ros data_recorder.launch
$ rosbag play --clock kinect.bag
Example with
demo_mapping.bag (recording also odometry + laser scan):
$ rosbag info demo_mapping.bag
path: demo_mapping.bag
version: 2.0
duration: 4:05s (245s)
start: May 16 2013 14:46:43.35 (1368730003.35)
end: May 16 2013 14:50:49.29 (1368730249.29)
size: 295.6 MB
messages: 89770
compression: none [383/383 chunks]
types: nav_msgs/Odometry [cd5e73d190d741a2f92e81eda573aca7]
sensor_msgs/CameraInfo [c9a58c1b0b154e0e6da7578cb991d214]
sensor_msgs/CompressedImage [8f7a12909da2c9d3332d540a0977563f]
sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369]
tf/tfMessage [94810edda583a504dfda3829e70d7eec]
topics: /az3/base_controller/odom 11936 msgs : nav_msgs/Odometry
/jn0/base_scan 9843 msgs : sensor_msgs/LaserScan
/tf 61934 msgs : tf/tfMessage
data_throttled_camera_info 2019 msgs : sensor_msgs/CameraInfo
data_throttled_image/compressed 2019 msgs : sensor_msgs/CompressedImage
data_throttled_image_depth/compressedDepth 2019 msgs : sensor_msgs/CompressedImage
$ roslaunch rtabmap_ros data_recorder.launch subscribe_depth:=true subscribe_odometry:=true subscribe_laserScan:=true frame_id:=base_link odom_topic:=/az3/base_controller/odom scan_topic:=/jn0/base_scan rgb_topic:=data_throttled_image rgb_info_topic:=data_throttled_camera_info depth_topic:=data_throttled_image_depth rgb_image_transport:=compressed depth_image_transport:=compressedDepth
$ rosbag play --clock demo_mapping.bag
You can verify that the data are recorded with database viewer:
$ rtabmap-databaseViewer ~/.ros/output.db
You can use the resulting database in the standalone application as source: Preferences->Source->Database...