From 6a52d93e960bf71c8e3d48a5a7761f49bf32972a Mon Sep 17 00:00:00 2001 From: dellaert Date: Wed, 24 Dec 2014 01:29:08 +0100 Subject: [PATCH] Using FixedDimension --- gtsam/geometry/PinholeCamera.h | 2 +- gtsam/slam/PoseRotationPrior.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gtsam/geometry/PinholeCamera.h b/gtsam/geometry/PinholeCamera.h index a0395bb6e..33bf9dec3 100644 --- a/gtsam/geometry/PinholeCamera.h +++ b/gtsam/geometry/PinholeCamera.h @@ -38,7 +38,7 @@ private: GTSAM_CONCEPT_MANIFOLD_TYPE(Calibration) - // Get dimensions of calibration type and This at compile time + // Get dimensions of calibration type at compile time static const int DimK = FixedDimension::value; public: diff --git a/gtsam/slam/PoseRotationPrior.h b/gtsam/slam/PoseRotationPrior.h index 7d31e2e2c..018d573cb 100644 --- a/gtsam/slam/PoseRotationPrior.h +++ b/gtsam/slam/PoseRotationPrior.h @@ -29,6 +29,10 @@ public: GTSAM_CONCEPT_GROUP_TYPE(Pose) GTSAM_CONCEPT_LIE_TYPE(Rotation) + // Get dimensions of pose and rotation type at compile time + static const int xDim = FixedDimension::value; + static const int rDim = FixedDimension::value; + protected: Rotation measured_; @@ -70,7 +74,6 @@ public: /** h(x)-z */ Vector evaluateError(const Pose& pose, boost::optional H = boost::none) const { const Rotation& newR = pose.rotation(); - const size_t rDim = newR.dim(), xDim = pose.dim(); if (H) { *H = gtsam::zeros(rDim, xDim); std::pair rotInterval = POSE::rotationInterval();