introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.8k stars 787 forks source link

RTabmap DB doesn't save optimized pose but only odometry pose #1110

Closed guoqingzh closed 1 year ago

guoqingzh commented 1 year ago

Hi All,

I noticed that Rtabmap DB doesn't have optimized pose saved but only odometry pose, sensor data (RGB, depth) and loop closure constraints. It seems to do optimization on the fly when the database is opened.

@matlabbe Is this the case ? Can you confirm ?

matlabbe commented 1 year ago

Yes most of time, though for different purposes, we also keep the optimized graph under Admin table. https://github.com/introlab/rtabmap/blob/6d36fc1fcd8e1f6855d245cbe8b104ba0b05516e/corelib/src/resources/DatabaseSchema.sql.in#L123-L124

hellovuong commented 1 year ago

Wow, That is a surprise, I also noticed that rtabmap optimizes the pose during initializing. Can you explain why rtabmap does that instead of saving optimized poses? By saving opt poses, will save init time and give more deterministic performance?

matlabbe commented 1 year ago

It uses the optimized poses on initialization, that one of the purposes. After that there will be a reoptimization from those poses as guess if there is a loop closure or other events triggering a reoptimization.

arjay55 commented 1 year ago

Hi. I am doing post processing to the saved database map. The poses are better after post-processing. However when viewed using rtabmap GUI, the occupancy grid map looks like the original unprocessed map, but when opened using rtabmap-databaseViewer, the occupancy grid map is updated/fixed. Is the difference related to this issue?

matlabbe commented 1 year ago

From the databaseViewer, you may have to trigger a new optimized map. File->Regenerate Optimizied 2d map...

arjay55 commented 1 year ago

Hello.

I tried it already, but still the old occupancy grid persist. There is no save button in rtabmap-databaseViewer right? So I just exit the program and the database should be overwritten right? I am using ros2 humble. Thanks.

arjay55 commented 1 year ago

Found a solution. Upon loading the db file in RTABMAP, I have to choose "Local Map Optimized" to show the grid same as in databaseViewer.