diff --git a/CMakeLists.txt b/CMakeLists.txt index 5371daf..cf44a00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/externals/install) find_package(Eigen3 3.3.5 REQUIRED NO_MODULE) # Ceres to solve the NLS problem -find_package(Ceres 2.0 REQUIRED) +find_package(Ceres 2.1 REQUIRED) # Simple multi-threading set(CMAKE_THREAD_PREFER_PTHREAD ON) diff --git a/externals/ceres-solver b/externals/ceres-solver index 399cda7..f68321e 160000 --- a/externals/ceres-solver +++ b/externals/ceres-solver @@ -1 +1 @@ -Subproject commit 399cda773035d99eaf1f4a129a666b3c4df9d1b1 +Subproject commit f68321e7de8929fbcdb95dd42877531e64f72f66 diff --git a/include/FactorGraph.h b/include/FactorGraph.h index b994c4c..ee8a3e7 100644 --- a/include/FactorGraph.h +++ b/include/FactorGraph.h @@ -439,7 +439,8 @@ namespace libRSF /** default settings for new ceres::Problems, especially enable_fast_removal = true */ const ceres::Problem::Options DefaultProblemOptions_ = {ceres::Ownership::TAKE_OWNERSHIP, // cost_function_ownership ceres::Ownership::TAKE_OWNERSHIP, // loss_function_ownership - ceres::Ownership::TAKE_OWNERSHIP, // local_parameterization_ownership + ceres::Ownership::TAKE_OWNERSHIP, // local_parameterization_ownership (deprecated in 2.1) + ceres::Ownership::TAKE_OWNERSHIP, // manifold_ownership (new in 2.1) true, // enable_fast_removal false, // disable_all_safety_checks nullptr, // context diff --git a/include/error_models/MaxMixture.h b/include/error_models/MaxMixture.h index 055db92..cbe52df 100644 --- a/include/error_models/MaxMixture.h +++ b/include/error_models/MaxMixture.h @@ -93,7 +93,7 @@ namespace libRSF sqrt(ceres::fmax(-2.0 * T(log(Mixture_.template getLinearPartOfComponent(nComponent, RawError) / Normalization_)), T(1e-10)));/** fmax() is required to handle numeric tolerances */ /** keep only the most likely component */ - if(ErrorShadow.squaredNorm() < Loglike || ceres::IsNaN(Loglike)) + if(ErrorShadow.squaredNorm() < Loglike || ceres::isnan(Loglike)) { Loglike = ErrorShadow.squaredNorm(); ErrorShadowBest = ErrorShadow; diff --git a/src/FactorGraph.cpp b/src/FactorGraph.cpp index b0e5856..f946c24 100644 --- a/src/FactorGraph.cpp +++ b/src/FactorGraph.cpp @@ -283,7 +283,7 @@ namespace libRSF StateData_.getElement(State.ID, State.Timestamp, State.Number).getMeanPointer()); /** compute size of the marginalized system */ - MarginalSize += Graph_.ParameterBlockLocalSize(MarginalStates.back()); + MarginalSize += Graph_.ParameterBlockTangentSize(MarginalStates.back()); } /** get connected states */ diff --git a/src/FactorGraphStructure.cpp b/src/FactorGraphStructure.cpp index 7588ae6..0f438d6 100644 --- a/src/FactorGraphStructure.cpp +++ b/src/FactorGraphStructure.cpp @@ -97,7 +97,7 @@ namespace libRSF { ConnectedStates.emplace_back(State); StateDims.emplace_back(Graph_->ParameterBlockSize(State)); - StateDimsLocal.emplace_back(Graph_->ParameterBlockLocalSize(State)); + StateDimsLocal.emplace_back(Graph_->ParameterBlockTangentSize(State)); /** find state info */ StateInfo Info = States_.at(State);