Re: Drift and Odometry Issues with RTAB-Map (ROS2)
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Drift-and-Odometry-Issues-with-RTAB-Map-ROS2-tp10761p10764.html
Hi,
1. It could be related to some error between the base frame of the camera and the imu frame. I tried your rosbag with this:
ros2 launch rtabmap_launch rtabmap.launch.py \
rgb_topic:=/left/image_rect \
depth_topic:=/stereo/depth \
camera_info_topic:=/left/camera_info \
imu_topic:=/imu/data args:="-d" \
use_sim_time:=true \
frame_id:=oak-d-base-frame \
approx_sync:=true \
approx_sync_max_interval:=0.002 \
wait_imu_to_init:=true
ros2 run imu_filter_madgwick imu_filter_madgwick_node --ros-args -r imu/data_raw:=/imu -p use_mag:=false -p publish_tf:=false -p use_sim_time:=true
ros2 bag play THU_W_01_0.db3 --clock
Without graph optimization (ignoring gravity links):

With graph optimization (with gravity links):

With and without gravity links respectively:

It seems with gravity links, the error along z-axis is almost null, so the error may be coming from camera->imu TF frame. See
Kalibr camera-imu for example.
2. This drift is expected. Ideally, when finishing your loop, rotate the camera in same orientation than at the beginning to detect the loop closure and correct the map.
cheers,
Mathieu