diff --git a/cpp/Pose3.h b/cpp/Pose3.h index 106e882c5..4db5ff3ee 100644 --- a/cpp/Pose3.h +++ b/cpp/Pose3.h @@ -61,6 +61,9 @@ namespace gtsam { Pose3 transform_to(const Pose3& pose) const; + /** get the dimension by the type */ + static inline size_t dim() { return 6; }; + private: /** Serialization function */ friend class boost::serialization::access; diff --git a/cpp/Rot2.h b/cpp/Rot2.h index 40e3858a3..12de03caa 100644 --- a/cpp/Rot2.h +++ b/cpp/Rot2.h @@ -75,6 +75,9 @@ namespace gtsam { /** rotate from world to rotated = R'*p */ Point2 unrotate(const Point2& p) const; + /** get the dimension by the type */ + static inline size_t dim() { return 1; }; + private: /** Serialization function */ friend class boost::serialization::access; diff --git a/cpp/Rot3.h b/cpp/Rot3.h index f41bc7816..0c42dd09d 100644 --- a/cpp/Rot3.h +++ b/cpp/Rot3.h @@ -106,6 +106,9 @@ namespace gtsam { */ Vector ypr() const; + /** get the dimension by the type */ + static inline size_t dim() { return 3; }; + private: /** Serialization function */ friend class boost::serialization::access;