From 0e6676c082816481080ddaf01895983d12b8e94b Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Mon, 9 Jan 2023 12:30:44 -0500 Subject: [PATCH] BatchFixedLagSmoother: add ability to limit warning debug prints This mimics the behavior of `LevenbergMarquardtOptimizer.cpp`. --- gtsam_unstable/nonlinear/BatchFixedLagSmoother.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtsam_unstable/nonlinear/BatchFixedLagSmoother.cpp b/gtsam_unstable/nonlinear/BatchFixedLagSmoother.cpp index fd18e7c6dc..18c664934d 100644 --- a/gtsam_unstable/nonlinear/BatchFixedLagSmoother.cpp +++ b/gtsam_unstable/nonlinear/BatchFixedLagSmoother.cpp @@ -282,9 +282,12 @@ FixedLagSmoother::Result BatchFixedLagSmoother::optimize() { // Reject this change if (lambda >= lambdaUpperBound) { // The maximum lambda has been used. Print a warning and end the search. - cout + if(parameters_.verbosity >= NonlinearOptimizerParams::TERMINATION + || parameters_.verbosityLM == LevenbergMarquardtParams::SUMMARY) { + cout << "Warning: Levenberg-Marquardt giving up because cannot decrease error with maximum lambda" << endl; + } break; } else { // Increase lambda and continue searching