diff --git a/gtsam_unstable/nonlinear/IncrementalFixedLagSmoother.h b/gtsam_unstable/nonlinear/IncrementalFixedLagSmoother.h index fe89c5b26..4a1a9cb4a 100644 --- a/gtsam_unstable/nonlinear/IncrementalFixedLagSmoother.h +++ b/gtsam_unstable/nonlinear/IncrementalFixedLagSmoother.h @@ -39,8 +39,8 @@ public: /** default constructor */ IncrementalFixedLagSmoother(double smootherLag = 0.0, - const ISAM2Params& parameters = ISAM2Params()) : - FixedLagSmoother(smootherLag), isam_(parameters) { + const boost::optional& parameters = boost::none) : + FixedLagSmoother(smootherLag), isam_(parameters ? (*parameters) : getDefaultParams()) { } /** destructor */ @@ -114,6 +114,14 @@ public: const ISAM2Result& getISAM2Result() const{ return isamResult_; } protected: + + /* Create default parameters */ + ISAM2Params getDefaultParams() const { + ISAM2Params params; + params.findUnusedFactorSlots = true; + return params; + } + /** An iSAM2 object used to perform inference. The smoother lag is controlled * by what factors are removed each iteration */ ISAM2 isam_;