Using FixedDimension

release/4.3a0
dellaert 2014-12-24 01:29:08 +01:00
parent 4078f02c1f
commit 6a52d93e96
2 changed files with 5 additions and 2 deletions

View File

@ -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<Calibration>::value;
public:

View File

@ -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<POSE>::value;
static const int rDim = FixedDimension<POSE::Rotation>::value;
protected:
Rotation measured_;
@ -70,7 +74,6 @@ public:
/** h(x)-z */
Vector evaluateError(const Pose& pose, boost::optional<Matrix&> 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<size_t, size_t> rotInterval = POSE::rotationInterval();