From 1c5061cf3cf4064ed429479452b0458e13f3c8fc Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Fri, 17 May 2013 08:06:06 +0000 Subject: [PATCH] Added optional flag to ConcurrentBatchFilter to control relinearization during syncs. --- gtsam_unstable/nonlinear/ConcurrentBatchFilter.cpp | 2 +- gtsam_unstable/nonlinear/ConcurrentBatchFilter.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gtsam_unstable/nonlinear/ConcurrentBatchFilter.cpp b/gtsam_unstable/nonlinear/ConcurrentBatchFilter.cpp index c0dab4d83..1e1e39e10 100644 --- a/gtsam_unstable/nonlinear/ConcurrentBatchFilter.cpp +++ b/gtsam_unstable/nonlinear/ConcurrentBatchFilter.cpp @@ -126,7 +126,7 @@ void ConcurrentBatchFilter::synchronize(const NonlinearFactorGraph& summarizedFa if(factors_.size() > 0) { // Perform an optional optimization on the to-be-sent-to-the-smoother factors - if(true) { + if(relin_) { // Create ordering and delta Ordering ordering = *graph.orderingCOLAMD(values); VectorValues delta = values.zeroVectors(ordering); diff --git a/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h b/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h index df05bdc51..9a7690786 100644 --- a/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h +++ b/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h @@ -54,7 +54,7 @@ public: }; /** Default constructor */ - ConcurrentBatchFilter(const LevenbergMarquardtParams& parameters = LevenbergMarquardtParams()) : parameters_(parameters) {}; + ConcurrentBatchFilter(const LevenbergMarquardtParams& parameters = LevenbergMarquardtParams(), bool relin = true) : parameters_(parameters), relin_(relin) {}; /** Default destructor */ virtual ~ConcurrentBatchFilter() {}; @@ -122,6 +122,7 @@ public: protected: LevenbergMarquardtParams parameters_; ///< LM parameters + bool relin_; NonlinearFactorGraph factors_; ///< The set of all factors currently in the filter Values theta_; ///< Current linearization point of all variables in the filter Ordering ordering_; ///< The current ordering used to calculate the linear deltas