Can you specify how can I record data in ROS for rtabmap. Which topics I should record to store into the rosbag and how to play it back using rtabmap. Should I run the rtabmap launch file when playing back the rosbag. Actually, I want to recreate the whole map that was built step by step as can be shown in the your video. Right now I am only getting the whole point cloud data (rtabmap.db). I would like to view the data for future processing since I do not have a screen on my pc which is attached to robot. Can you explain in steps. Thank you
Note that the resulting database generated on your robot during the mapping session can be replayed directly at the rate of loop closure detection. This is what I've done to reproduce the IROS video after the actual mapping of the robot and taking the resulting "rtabmap.db" as input:
You can open RTAB-Map (standalone, not the ros-pkg) using the configuration file above, then set "Source from database" and select the database above. Set Source rate to 2 Hz and press start, this should reproduce the video above.
sorry for so late reply. This solved my problem of visualization. However, is there a way to do the same in rviz. My recorded bag files are way to large when recording the rtabmap (~10 GB) for a 5 minute run. I am not sure what might be the reason. I looked at your launch files for recording the rosbag but somehow it does not work for my system. What topics I should be recording when using rosbag for the openni2 topics to get the optimum results.
1) If you want to save some memory when recording a rosbag at the cost of a decompression time on playing, you can record the compressed topics (don't forget the TF). For example:
$ rosbag record /camera/rgb/image_rect_color/compressed /camera/depth_registered/image_raw/compressedDepth /camera/depth_registered/camera_info /tf
When playing a rosbag with compressed image topics, you should set the "image_transport" parameter for each node subscribing to these topics (republish nodes can also be used as in the last example below):
3) If you don't use RTAB-Map's odometry node to feed rtabmap with an odometry (e.g. you are using the robot odometry), you can record at a lowest rate since by default rtabmap update rate is 1 Hz. Set 1 Hz above and record with odometry:
$ rosbag record /data_throttled_image/compressed /data_throttled_image_depth/compressedDepth /data_throttled_camera_info /tf /odom
4) To play the rosbag, here an example to re-use the default launch file like rgbd_mapping_rviz.launch, just add these lines at the top of the launch file to remap/decompress topics to those set in the launch file: