diff --git a/src/mmSolver/adjust/adjust_ceres_lmder.cpp b/src/mmSolver/adjust/adjust_ceres_lmder.cpp index fc820c8d..d690e13e 100644 --- a/src/mmSolver/adjust/adjust_ceres_lmder.cpp +++ b/src/mmSolver/adjust/adjust_ceres_lmder.cpp @@ -226,15 +226,6 @@ bool solve_3d_ceres_lmder(SolverOptions& solverOptions, options.logging_type = ::ceres::PER_MINIMIZER_ITERATION; } - // // TODO: Add parameter bounds. - // for (int i = 0; i < numberOfParameters; i++) { - // if (paramWeightList[i] < 1.0) { - // // TODO: Set parameter bounds. - // problem.SetParameterLowerBound(param_ptr, i, -1e8); - // problem.SetParameterUpperBound(param_ptr, i, 1e8); - // } - // } - ::ceres::Solver::Summary summary; ::ceres::Solve(options, &problem, &summary); @@ -256,7 +247,6 @@ bool solve_3d_ceres_lmder(SolverOptions& solverOptions, if (solveResult.success) { // NOTE: Parameters are updated in-place. - // errorList = std::vector(numberOfErrors); errorList.resize(numberOfErrors); cost_function->Evaluate(¶m_ptr, errorList.data(), nullptr); } diff --git a/src/mmSolver/adjust/adjust_defines.h b/src/mmSolver/adjust/adjust_defines.h index e0d7ee21..8b973cc7 100644 --- a/src/mmSolver/adjust/adjust_defines.h +++ b/src/mmSolver/adjust/adjust_defines.h @@ -170,7 +170,7 @@ // auto-differentiation #define CERES_LMDIF_SUPPORT_AUTO_DIFF_FORWARD_VALUE false #define CERES_LMDIF_SUPPORT_AUTO_DIFF_CENTRAL_VALUE false -#define CERES_LMDIF_SUPPORT_PARAMETER_BOUNDS_VALUE false +#define CERES_LMDIF_SUPPORT_PARAMETER_BOUNDS_VALUE true #define CERES_LMDIF_SUPPORT_ROBUST_LOSS_VALUE false // Ceres Levenberg-Marquardt Solver default flag values, using custom @@ -190,7 +190,7 @@ #define CERES_LMDER_ROBUST_LOSS_SCALE_DEFAULT_VALUE (1.0) #define CERES_LMDER_SUPPORT_AUTO_DIFF_FORWARD_VALUE true #define CERES_LMDER_SUPPORT_AUTO_DIFF_CENTRAL_VALUE true -#define CERES_LMDER_SUPPORT_PARAMETER_BOUNDS_VALUE false +#define CERES_LMDER_SUPPORT_PARAMETER_BOUNDS_VALUE true #define CERES_LMDER_SUPPORT_ROBUST_LOSS_VALUE false