Hi! Sorry if it's a trivial question, but I am very new to this topic. I have a task in which I need to test an algorithm with different graph optimization approaches. The algorithm uses the GTSAM library by default, and we'd like to see whether trying g2o improves performance and accuracy. Can somebody explain to me how to implement g2o in this case? If I know well the two methods utilize different kind of data. Is there anything in GTSAM that g2o requires, too, or can I convert the first to the second?
|
Administrator
|
Hi,
g2o is also built-in rtabmap (if rtabmap is built with g2o support). You can switch between optimization strategies with Optimizer/Strategy parameter: $ rtabmap --params | grep Optimizer/Strategy Param: Optimizer/Strategy = "2" [Graph optimization strategy: 0=TORO, 1=g2o and 2=GTSAM.] $ rtabmap --params | grep Optimizer/ Param: Optimizer/Epsilon = "0.00001" [Stop optimizing when the error improvement is less than this value.] Param: Optimizer/Iterations = "20" [Optimization iterations.] Param: Optimizer/PriorsIgnored = "true" [Ignore prior constraints (global pose or GPS) while optimizing. Currently only g2o and gtsam optimization supports this.] Param: Optimizer/Robust = "false" [Robust graph optimization using Vertigo (only work for g2o and GTSAM optimization strategies). Not compatible with "RGBD/OptimizeMaxError" if enabled.] Param: Optimizer/Strategy = "2" [Graph optimization strategy: 0=TORO, 1=g2o and 2=GTSAM.] Param: Optimizer/VarianceIgnored = "false" [Ignore constraints' variance. If checked, identity information matrix is used for each constraint. Otherwise, an information matrix is generated from the variance saved in the links.] Param: RGBD/OptimizeMaxError = "1.0" [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.] ### Optimizer specific parameters: $ rtabmap --params | grep g2o/ Param: g2o/Baseline = "0.075" [When doing bundle adjustment with RGB-D data, we can set a fake baseline (m) to do stereo bundle adjustment (if 0, mono bundle adjustment is done). For stereo data, the baseline in the calibration is used directly.] Param: g2o/Optimizer = "0" [0=Levenberg 1=GaussNewton] Param: g2o/PixelVariance = "1.0" [Pixel variance used for bundle adjustment.] Param: g2o/RobustKernelDelta = "8" [Robust kernel delta used for bundle adjustment (0 means don't use robust kernel). Observations with chi2 over this threshold will be ignored in the second optimization pass.] Param: g2o/Solver = "0" [0=csparse 1=pcg 2=cholmod 3=Eigen] $ rtabmap --params | grep GTSAM Param: GTSAM/Optimizer = "1" [0=Levenberg 1=GaussNewton 2=Dogleg] If you need to change some more specific parameters of GTSAM and g2o, you can look at the implementation: OptimizerGTSAM.cpp and OptimizerG2O.cpp. You didn't mention if you are using rtabmap_ros or the standalone. For ROS, add "--Optimizer/Strategy 1" to rtabmap_args. For standalone, go in Preferences->RTAB-Map Settings (advanced) -> RGB-D SLAM -> Graph optimization panel. cheers, Mathieu |
Free forum by Nabble | Edit this page |