Skip to content

Commit a406c37

Browse files
committed
gtsam: Fixed metis linker errors on windows. Ceres: updated default solver options (working for BA and pose-graph optimizations, fixed #966)
1 parent 1cb7f3f commit a406c37

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

corelib/src/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,13 @@ IF(GTSAM_FOUND)
715715
${LIBRARIES}
716716
gtsam # Windows: Place static libs at the end
717717
)
718+
IF(WIN32)
719+
#explicitly add metis target on windows (after gtsam target)
720+
SET(LIBRARIES
721+
${LIBRARIES}
722+
metis
723+
)
724+
ENDIF(WIN32)
718725
ENDIF(GTSAM_FOUND)
719726

720727
IF(WITH_MADGWICK)

corelib/src/optimizer/OptimizerCeres.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ std::map<int, Transform> OptimizerCeres::optimize(
238238
UINFO("Ceres optimizing begin (iterations=%d)", iterations());
239239

240240
ceres::Solver::Options options;
241+
options.linear_solver_type = ceres::ITERATIVE_SCHUR;
242+
options.sparse_linear_algebra_library_type = ceres::SUITE_SPARSE;
241243
options.max_num_iterations = iterations();
242-
options.linear_solver_type = ceres::SPARSE_NORMAL_CHOLESKY;
243244
options.function_tolerance = this->epsilon();
244245
ceres::Solver::Summary summary;
245246
UTimer timer;
@@ -457,7 +458,8 @@ std::map<int, Transform> OptimizerCeres::optimizeBA(
457458
// standard solver, SPARSE_NORMAL_CHOLESKY, also works fine but it is slower
458459
// for standard bundle adjustment problems.
459460
ceres::Solver::Options options;
460-
options.linear_solver_type = ceres::DENSE_SCHUR;
461+
options.linear_solver_type = ceres::ITERATIVE_SCHUR;
462+
options.sparse_linear_algebra_library_type = ceres::SUITE_SPARSE;
461463
options.max_num_iterations = iterations();
462464
//options.linear_solver_type = ceres::SPARSE_NORMAL_CHOLESKY;
463465
options.function_tolerance = this->epsilon();

0 commit comments

Comments
 (0)