From d0e1c1a770f35c8c858aadb5784f95d7c50ac0c4 Mon Sep 17 00:00:00 2001 From: Mike Bosse Date: Sat, 20 Dec 2014 20:36:54 +0100 Subject: [PATCH] test compiling!! but 34 tests failed out of 198 --- gtsam_unstable/nonlinear/ExpressionFactor.h | 12 +++++------- gtsam_unstable/nonlinear/expressionTesting.h | 2 +- gtsam_unstable/slam/SmartStereoProjectionFactor.h | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gtsam_unstable/nonlinear/ExpressionFactor.h b/gtsam_unstable/nonlinear/ExpressionFactor.h index de6e4983a..f1e94dcb4 100644 --- a/gtsam_unstable/nonlinear/ExpressionFactor.h +++ b/gtsam_unstable/nonlinear/ExpressionFactor.h @@ -36,7 +36,7 @@ class ExpressionFactor: public NoiseModelFactor { Expression expression_; ///< the expression that is AD enabled FastVector dims_; ///< dimensions of the Jacobian matrices - static const int Dim = traits::dimension::value; + static const int Dim = traits_x::dimension; public: @@ -63,13 +63,12 @@ public: */ virtual Vector unwhitenedError(const Values& x, boost::optional&> H = boost::none) const { - DefaultChart chart; - if (H) { + if (H) { const T value = expression_.value(x, keys_, dims_, *H); - return chart.local(measurement_, value); + return traits_x::Local(measurement_, value); } else { const T value = expression_.value(x); - return chart.local(measurement_, value); + return traits_x::Local(measurement_, value); } } @@ -97,8 +96,7 @@ public: T value = expression_.value(x, jacobianMap); // <<< Reverse AD happens here ! // Evaluate error and set RHS vector b - DefaultChart chart; - Ab(size()).col(0) = -chart.local(measurement_, value); + Ab(size()).col(0) = -traits_x::Local(measurement_, value); // Whiten the corresponding system, Ab already contains RHS Vector dummy(Dim); diff --git a/gtsam_unstable/nonlinear/expressionTesting.h b/gtsam_unstable/nonlinear/expressionTesting.h index 4fd47eb76..125ebc5d7 100644 --- a/gtsam_unstable/nonlinear/expressionTesting.h +++ b/gtsam_unstable/nonlinear/expressionTesting.h @@ -107,7 +107,7 @@ void testExpressionJacobians(TestResult& result_, const std::string& name_, const gtsam::Expression& expression, const gtsam::Values& values, double nd_step, double tolerance) { // Create factor - size_t size = traits::dimension::value; + size_t size = traits_x::dimension; ExpressionFactor f(noiseModel::Unit::Create(size), expression.value(values), expression); testFactorJacobians(result_, name_, f, values, nd_step, tolerance); diff --git a/gtsam_unstable/slam/SmartStereoProjectionFactor.h b/gtsam_unstable/slam/SmartStereoProjectionFactor.h index 1c0d1bc37..710d7b101 100644 --- a/gtsam_unstable/slam/SmartStereoProjectionFactor.h +++ b/gtsam_unstable/slam/SmartStereoProjectionFactor.h @@ -107,7 +107,7 @@ protected: /// shorthand for this class typedef SmartStereoProjectionFactor This; - typedef traits::dimension ZDim_t; ///< Dimension trait of measurement type + enum {ZDim = traits_x::dimension}; ///< Dimension trait of measurement type public: @@ -482,7 +482,7 @@ public: if (triangulateForLinearize(cameras)) return Base::createJacobianSVDFactor(cameras, point_, lambda); else - return boost::make_shared< JacobianFactorSVD >(this->keys_); + return boost::make_shared< JacobianFactorSVD >(this->keys_); } /// Returns true if nonDegenerate