Parameters: updated default of Icp/CorrespondenceRatio and Icp/PMOutlierRatio. Fixed OptimizerG2O build with ORB_SLAM2. Fixed seg fault after restarting ORB_SLAM2 odometry.

This commit is contained in:
matlabbe
2018-03-17 18:20:32 -04:00
parent ecf598e412
commit 436e82653c
3 changed files with 5 additions and 5 deletions

View File

@@ -296,7 +296,7 @@ protected:
// FIXME: Memory leak: ORB_SLAM2 doesn't delete after removing from the map...
// Not sure when it is safe to delete it, as if I delete just
// after setting the bad flag, the app crashes.
iter->second->SetBadFlag();
iter->second->SetErase();
}
else
{

View File

@@ -790,7 +790,7 @@ std::map<int, Transform> OptimizerG2O::optimizeBA(
{
g2o::SparseOptimizer optimizer;
optimizer.setVerbose(ULogger::level()==ULogger::kDebug);
#ifdef RTABMAP_G2O_CPP11
#if defined(RTABMAP_G2O_CPP11) and not defined(RTABMAP_ORB_SLAM2)
std::unique_ptr<g2o::BlockSolver_6_3::LinearSolverType> linearSolver;
#else
g2o::BlockSolver_6_3::LinearSolverType * linearSolver = 0;
@@ -854,7 +854,7 @@ std::map<int, Transform> OptimizerG2O::optimizeBA(
else
#endif
{
#ifdef RTABMAP_G2O_CPP11
#if defined(RTABMAP_G2O_CPP11) and not defined(RTABMAP_ORB_SLAM2)
optimizer.setAlgorithm(new g2o::OptimizationAlgorithmLevenberg(
g2o::make_unique<g2o::BlockSolver_6_3>(std::move(linearSolver))));
#else