Fixed g2o version not correctly used, D400: set default to IR+Depth

This commit is contained in:
matlabbe
2023-03-13 22:10:24 -07:00
parent 92b9cc89e0
commit 6fe5e6375f
2 changed files with 8 additions and 4 deletions

View File

@@ -153,7 +153,7 @@ OptimizerG2O::OptimizerG2O(const ParametersMap & parameters) :
// Issue on android, have to explicitly register this type when using fixed root prior below // Issue on android, have to explicitly register this type when using fixed root prior below
if(!g2o::Factory::instance()->knowsTag("CACHE_SE3_OFFSET")) if(!g2o::Factory::instance()->knowsTag("CACHE_SE3_OFFSET"))
{ {
#if defined(RTABMAP_G2O_CPP11) and RTABMAP_G2O_CPP11 == 1 #if defined(RTABMAP_G2O_CPP11) && RTABMAP_G2O_CPP11 == 1
g2o::Factory::instance()->registerType("CACHE_SE3_OFFSET", g2o::make_unique<g2o::HyperGraphElementCreator<g2o::CacheSE3Offset> >()); g2o::Factory::instance()->registerType("CACHE_SE3_OFFSET", g2o::make_unique<g2o::HyperGraphElementCreator<g2o::CacheSE3Offset> >());
#else #else
g2o::Factory::instance()->registerType("CACHE_SE3_OFFSET", new g2o::HyperGraphElementCreator<g2o::CacheSE3Offset>); g2o::Factory::instance()->registerType("CACHE_SE3_OFFSET", new g2o::HyperGraphElementCreator<g2o::CacheSE3Offset>);
@@ -1414,7 +1414,7 @@ std::map<int, Transform> OptimizerG2O::optimizeBA(
{ {
g2o::SparseOptimizer optimizer; g2o::SparseOptimizer optimizer;
//optimizer.setVerbose(ULogger::level()==ULogger::kDebug); //optimizer.setVerbose(ULogger::level()==ULogger::kDebug);
#if defined(RTABMAP_G2O_CPP11) and not defined(RTABMAP_ORB_SLAM) #if defined(RTABMAP_G2O_CPP11) && !defined(RTABMAP_ORB_SLAM)
std::unique_ptr<g2o::BlockSolver_6_3::LinearSolverType> linearSolver; std::unique_ptr<g2o::BlockSolver_6_3::LinearSolverType> linearSolver;
#else #else
g2o::BlockSolver_6_3::LinearSolverType * linearSolver = 0; g2o::BlockSolver_6_3::LinearSolverType * linearSolver = 0;
@@ -1478,7 +1478,7 @@ std::map<int, Transform> OptimizerG2O::optimizeBA(
else else
#endif #endif
{ {
#if defined(RTABMAP_G2O_CPP11) and not defined(RTABMAP_ORB_SLAM) #if defined(RTABMAP_G2O_CPP11) && !defined(RTABMAP_ORB_SLAM)
optimizer.setAlgorithm(new g2o::OptimizationAlgorithmLevenberg( optimizer.setAlgorithm(new g2o::OptimizationAlgorithmLevenberg(
g2o::make_unique<g2o::BlockSolver_6_3>(std::move(linearSolver)))); g2o::make_unique<g2o::BlockSolver_6_3>(std::move(linearSolver))));
#else #else

View File

@@ -3921,12 +3921,16 @@ void PreferencesDialog::selectSourceDriver(Src src, int variant)
_ui->spinBox_rs2_width->setValue(1280); _ui->spinBox_rs2_width->setValue(1280);
_ui->spinBox_rs2_height->setValue(720); _ui->spinBox_rs2_height->setValue(720);
_ui->spinBox_rs2_rate->setValue(30); _ui->spinBox_rs2_rate->setValue(30);
_ui->checkbox_rs2_irMode->setChecked(false);
_ui->checkbox_rs2_emitter->setChecked(true);
} }
else else // D400
{ {
_ui->spinBox_rs2_width->setValue(848); _ui->spinBox_rs2_width->setValue(848);
_ui->spinBox_rs2_height->setValue(480); _ui->spinBox_rs2_height->setValue(480);
_ui->spinBox_rs2_rate->setValue(60); _ui->spinBox_rs2_rate->setValue(60);
_ui->checkbox_rs2_irMode->setChecked(true);
_ui->checkbox_rs2_emitter->setChecked(false);
} }
} }
} }