Create map with the playback from database file or bag file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Create map with the playback from database file or bag file

TMYNUS
Hi

My goal is to create a map from data that has been recorder beforehand. As far as I understand this can either be done with bag files or with the RTAB-Map data recorder, which records a database file. So far I have hit a roadblock with both of these options.

I am using an Intel Realsense L515. Below are the commands I use to start everything up:

roslaunch realsense2_camera rs_camera.launch     align_depth:=true     unite_imu_method:="linear_interpolation"     enable_gyro:=true      enable_accel:=true


rosrun imu_filter_madgwick imu_filter_node _use_mag:=false _publish_tf:=false _world_frame:="enu" /imu/data_raw:=/camera/imu /imu/data:=/rtabmap/imu

rosrun nodelet nodelet standalone rtabmap_ros/point_cloud_xyz _approx_sync:=false /depth/image:=/camera/depth/image_rect_raw /depth/camera_info:=/camera/depth/camera_info _decimation:=4


I have tried recording a bag file and playing it back while opening RTAB-Map, but I get an odometry error. New stamps should be greater than previous stamps.

My second approach was to use the data-recorder launch file provided by RTAB-Map ROS. Below is the command I used to record the scan session:

roslaunch rtabmap_ros data_recorder.launch subscribe_scan_cloud:=true approx_sync:=false scan_cloud_topic:=/cloud depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw rgb_info_topic:=/camera/color/camera_info


Here is a screenshot of the rqt graph if it helps:



After the recording is finished, a ".db" file can be found in "home/.ros" If I open this file with RTAB-Map I can import the database, but nothing much after that. If I open RTAB-Map database viewer, I can play back the database but only the images are shown. The database has no graph or anything else. The map and Odom windows are blank. Am I doing something wrong?

If it helps, here is the command I use to start RTAB-Map normally and do online mapping:

roslaunch rtabmap_ros rtabmap.launch    rtabmap_args:="\
      --delete_db_on_start \
      --Icp/VoxelSize 0.05 \
      --Icp/PointToPlaneRadius 0 \
      --Icp/PointToPlaneK 20 \
      --Icp/CorrespondenceRatio 0.2 \
      --Icp/PMOutlierRatio 0.65 \
      --Icp/Epsilon 0.005 \
      --Icp/PointToPlaneMinComplexity 0 \
      --Odom/ScanKeyFrameThr 0.7 \
      --OdomF2M/ScanMaxSize 15000 \
      --Optimizer/GravitySigma 0.3 \
      --RGBD/ProximityPathMaxNeighbors 1 \
      --Reg/Strategy 1 --Odom/ResetCountdown 10 --Vis/EstimationType 1 "  publish_tf:=false publish_null_when_lost:=true guess_from_tf:=true cloud_noise_filtering_radius:=0.05 queue_size:=200 DetectionRate:=30 icp_odometry:=true     scan_cloud_topic:=/cloud     subscribe_scan_cloud:=true     depth_topic:=/camera/aligned_depth_to_color/image_raw     rgb_topic:=/camera/color/image_raw     camera_info_topic:=/camera/color/camera_info     approx_sync:=false     wait_imu_to_init:=true     imu_topic:=/rtabmap/imu  


Any help in the right direction would be greatly appreciated. Thanks in advance

T
Reply | Threaded
Open this post in threaded view
|

Re: Create map with the playback from database file or bag file

matlabbe
Administrator
Hi,

when recording a database like that, only images are recorded, there is no odometry or map created. You should replay it in rtabmap app, by selecting Detection->Select source->More options, then select Database as source type, then under Database group below, click on "..." to select the recorded database. It will ask if you want to use odometry inside the dataabse, say "No" to recompute odometry, then "No" again to process all frames (as we assumed you recorded at 30 Hz).

Otherwise, while the data recorder is useful in some cases, I recommend to use rosbags instead, so you can re-use the same command line you used online (if you record compressedDepth and compressed topics, set compressed:=true so that rtabmap.launch subscribe to compressed topics recorded in the bag).

cheers,
Mathieu