mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-12 21:09:50 +08:00
Updated Robust Graph Optimization (markdown)
+51
-15
@@ -1,13 +1,16 @@
|
||||
* [Introduction](#introduction)
|
||||
* [Configuration](#configuration)
|
||||
* [ROS](#ros)
|
||||
* [Example](#example)
|
||||
* [Without Vertigo](#without-vertigo)
|
||||
* [Issues](#issues)
|
||||
* [Single Session](#single-session)
|
||||
* [Introduction](#introduction)
|
||||
* [Configuration](#configuration)
|
||||
* [ROS](#ros)
|
||||
* [Example](#example)
|
||||
* [Without Vertigo](#without-vertigo)
|
||||
* [Issues](#issues)
|
||||
* [Multi Session](#multi-session)
|
||||

|
||||
***
|
||||
|
||||
# Introduction
|
||||
# Single Session
|
||||
## Introduction
|
||||
**RTAB-Map >=0.10.6 required** (built with g2o or GTSAM)
|
||||
|
||||
Even if RTAB-Map has a [good](https://introlab.3it.usherbrooke.ca/mediawiki-introlab/images/b/bc/TRO2013.pdf) Recall/Precision performance for loop closure detection, it is not perfect! It may happens that some objects very similar (even identical) in different locations could cause wrong loop closure detections. Optimizing the graph with these wrong loop closures will add significant errors to the generated map. Hopefully, some approaches [1, 2] can deal with a lot of wrong loop closures. [Vertigo](https://openslam.org/vertigo.html) has been integrated in RTAB-Map to increase robustness to graph optimization. To use it, you must have RTAB-Map built with [g2o](https://openslam.org/g2o.html) or [GTSAM](https://collab.cc.gatech.edu/borg/gtsam) support (you can see that in the About dialog or with "WITH_G2O=YES" and "WITH_GTSAM=YES" on cmake). The next video shows a comparison without and with robust graph optimization.
|
||||
@@ -19,12 +22,12 @@ Even if RTAB-Map has a [good](https://introlab.3it.usherbrooke.ca/mediawiki-intr
|
||||
|
||||
[2] Sunderhauf N and Protzel P (2012) Towards a robust back-end for pose graph SLAM. In: Proc. IEEE Int. Conf. on Robotics and Automation. pp. 1254–1261.
|
||||
|
||||
# Configuration
|
||||
## Configuration
|
||||
In the Preferences dialog under RGBD-SLAM panel and "Graph optimization" group, choose either g2o or GTSAM for the optimization algorithm, then click on "Robust graph optimization using Vertigo..." and set "Reject loop closures if..." to 0 (this cannot be used at the same time than Vertigo):
|
||||
|
||||
[[doc/Tutorials/RobustGraphOptimization/rgbdslam.png]]
|
||||
|
||||
## ROS
|
||||
### ROS
|
||||
If you are using ROS, you can set the parameters of the rtabmap node like that in a launch file:
|
||||
```xml
|
||||
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap">
|
||||
@@ -35,7 +38,7 @@ If you are using ROS, you can set the parameters of the rtabmap node like that i
|
||||
</node>
|
||||
```
|
||||
|
||||
# Example
|
||||
## Example
|
||||
The video above can be reproduced with this database: [robust_graph_optimization_stereo.db](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/RobustGraphOptimization/robust_graph_optimization_stereo.db) (32 MB).
|
||||
|
||||
1. Open RTAB-Map.
|
||||
@@ -52,9 +55,9 @@ The video above can be reproduced with this database: [robust_graph_optimization
|
||||
|
||||
You should then see mapping like the introduction video. **Note**: to actually see the black lines as in the video, you should set "Reject loop closures if optimization error is greater than this value (0=disabled)." to 0, then when back to the main window right-click on the Graph View -> "Set link color..." -> "Set outlier threshold..." and set value to 1 m.
|
||||
|
||||
## Without Vertigo
|
||||
An option can be also used with TORO (it works for the other algorithms too) to detect wrong loop closures and reject them. Under RGB-D SLAM panel in the Preferences dialog, there is this parameter (`RGBD/OptimizeMaxError`, default 1 m):
|
||||
* "Reject loop closures if optimization error is greater than this value (0=disabled)."
|
||||
### Without Vertigo
|
||||
An option can be also used with TORO (it works for the other algorithms too) to detect wrong loop closures and reject them. Under RGB-D SLAM panel in the Preferences dialog, there is this parameter (`RGBD/OptimizeMaxError`, default 1):
|
||||
* "Reject loop closures if optimization error ratio is greater than this value (0=disabled). Ratio is computed as absolute error over standard deviation of each link. This will help to detect when a wrong loop closure is added to the graph. Not compatible with "`Optimizer/Robust`" if enabled."
|
||||
|
||||
When large graph optimization errors are detected after a loop closure, this means that the last loop closure is a wrong loop closure. RTAB-Map can detect this and remove the link from the graph directly.
|
||||
|
||||
@@ -65,7 +68,7 @@ $ roslaunch rtabmap_ros stereo_mapping.launch left_image_topic:=/left/image righ
|
||||
$ rosrun rtabmap_ros data_player _rate:=1 _database:=/home/mathieu/Documents/RTAB-Map/robust_graph_optimization_stereo.db
|
||||
```
|
||||
|
||||
# Issues
|
||||
## Issues
|
||||
The above example doesn't work when link's covariances are Identity. There are some [cases](https://www.tu-chemnitz.de/etit/proaut/mitarbeiter/rsrc/IROS12-switchableConstraints.pdf) where Vertigo cannot correctly ignore **all** wrong loop closures. Even one left can cause large errors in the map. With the combination of the parameter explained in the section [Without Vertigo](#without-vertigo), this can give less chance of accepting a wrong loop closure.
|
||||
|
||||
If someone has an approach that can solve this demo in any cases (with or without Identity covariance), contact me! Here the g2o outputs:
|
||||
@@ -86,4 +89,37 @@ $ g2o_viewer without_vertigo_constraints_identity_cov.g2o
|
||||
$ g2o_viewer -typeslib libvertigo-g2o.so with_vertigo_constaints.g2o
|
||||
$ g2o_viewer -typeslib libvertigo-g2o.so with_vertigo_constaints_identity_cov.g2o
|
||||
```
|
||||
Screenshot of the correct one after optimization: [[doc/Tutorials/RobustGraphOptimization/g2o_viewer.png]]
|
||||
Screenshot of the correct one after optimization: [[doc/Tutorials/RobustGraphOptimization/g2o_viewer.png]]
|
||||
|
||||
# Multi Session
|
||||
In previous section, two approaches have been presented to be more robust to bad loop closures. We will test them again in a multi session experiment with this database: [loop_3it_gps.db](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/RobustGraphOptimization/loop_3it_gps.db). This database was captured with [RTAB-Map Tango](https://play.google.com/store/apps/details?id=com.introlab.rtabmap) with GPS enabled:
|
||||
|
||||
[[doc/Tutorials/RobustGraphOptimization/loop_3it_gps.jpg]]
|
||||
|
||||
The same box has been placed at two different locations. We oriented the camera at those locations to see only the box, so that images are identical. First, we will see how the robust approaches perform on this new database in a single session, then we will test again by splitting the database into two sessions.
|
||||
|
||||
## On same session
|
||||
* Without robust approaches (`RGBD/OptimizeRobust=false` and `RGBD/OptimizeMaxError=0`):
|
||||
[[doc/Tutorials/RobustGraphOptimization/single_session_not_robust.png]]
|
||||
* With Vertigo (`RGBD/OptimizeRobust=true` and `RGBD/OptimizeMaxError=0`):
|
||||
[[doc/Tutorials/RobustGraphOptimization/single_session_vertigo.png]]
|
||||
* With max optimization error: `RGBD/OptimizeRobust=false` and `RGBD/OptimizeMaxError=3`:
|
||||
[[doc/Tutorials/RobustGraphOptimization/single_session_max_error.png]]
|
||||
|
||||
## On multi session
|
||||
In this example, at node 50 (the pink line in the screenshot), we clicked Edit->"Trigger a new map" to split the database into two sessions so that the opposite images of the same box are not in the same session. This would make the robust approaches detecting large graph deformation not working (for loop closures between the sessions).
|
||||
|
||||
### Without GPS
|
||||
* Without robust approaches (`RGBD/OptimizeRobust=false` and `RGBD/OptimizeMaxError=0`):
|
||||
[[doc/Tutorials/RobustGraphOptimization/multi_session_not_robust.png]]
|
||||
* With Vertigo (`RGBD/OptimizeRobust=true` and `RGBD/OptimizeMaxError=0`):
|
||||
[[doc/Tutorials/RobustGraphOptimization/multi_session_vertigo.png]]
|
||||
* With max optimization error: `RGBD/OptimizeRobust=false` and `RGBD/OptimizeMaxError=3`:
|
||||
[[doc/Tutorials/RobustGraphOptimization/multi_session_max_error.png]]
|
||||
|
||||
### With GPS (`Rtabmap/WithGPS=false` and `RGBD/LocalRadius=20`)
|
||||
In GUI, parameter `Rtabmap/WithGPS` is under Preferences->"Loop Closure detection" panel and parameter `RGBD/LocalRadius` is under RGBD-SLAM panel. Without or with robust approaches, they give all the same results (the red dots on right show which locations are used for loop closure detection within local radius of current GPS location):
|
||||
|
||||
[[doc/Tutorials/RobustGraphOptimization/multi_session_gps.png]]
|
||||
|
||||
The opposite boxes are not compared for loop closure detection (outside GPS radius), but the boxes between the first and last images are.
|
||||
|
||||
Reference in New Issue
Block a user