introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
1.01k stars 558 forks source link

Map broken when use ros2_control #1243

Open AnhHazz opened 6 days ago

AnhHazz commented 6 days ago

I'm following the demo with turtlebot3 model and my model. Both work fine when using libgazebo_ros_diff_drive.so Screenshot from 2024-11-23 21-24-10 The rqt_graph show Screenshot from 2024-11-23 22-38-06

But when i change to gazebo ros2_control plugin, it the map look really bad Screenshot from 2024-11-23 22-26-32 The rqt_graph for this image

I see that the only difference between those two plugins is the odom so maybe the problem is in there. But i haven't find out how to fix. Edit: the hz of depth camera also decrease so much when running rtabmap, from 20hz to 5hz but this also happen with the demo It also show warnings: [ WARN] (2024-11-23 23:06:05.325) Rtabmap.cpp:3036::process() Rejected loop closure 73 -> 102: Not enough inliers 14/20 (matches=24) between 73 and 102

Tks for reading and i hope you guys help me solve this problem

matlabbe commented 5 days ago

Which example are you using? The one with wheel odometry and RGB-D image requires relatively good odometry. If the new plugin gives very bad odometry, it won't work as expected. The rejected loop closure is because there is not enough visual features.

AnhHazz commented 5 days ago

Hi @matlabbe , i'm using turtlebot3_rgbd launch file which mean it's using differential_drive plugin. Everything in this example work perfectly with odometry and RGBD camera.

With the ros2_control plugin i use robot_localization to fusion plugin's odom and imu. It show in the under rqt_graph and the final odom looks quiet good. But the problem still the same

Should i change to another map with more feature? But in your example there still enough features to loop closure so i think it's not cause by map

matlabbe commented 4 days ago

Switching to a map with more visual features won't fix the odometry drifting issue. Note that odometry is looking fine with ros2_control, maybe I didn't see if there was a bad loop closure. Can you share the database with the wrong result? Maybe the covariance in the resulting odometry topic is too large.

AnhHazz commented 4 days ago

Switching to a map with more visual features won't fix the odometry drifting issue. Note that odometry is looking fine with ros2_control, maybe I didn't see if there was a bad loop closure. Can you share the database with the wrong result? Maybe the covariance in the resulting odometry topic is too large.

https://drive.google.com/file/d/12Rz1XZm0XG331Y1bCgEiyz2lvRp2JcPD/view?usp=drive_link Here is the link to .db file. Is that the database you mentioned? If not please tell me what to do. I'm new to this