26 #include <boost/concept_check.hpp> 27 #include <boost/concept/requires.hpp> 28 #include <boost/type_traits/is_base_of.hpp> 53 template <
typename T>
struct traits;
61 enum { dim = Class::dimension };
64 Eigen::Matrix<double, dim, 1> v;
68 v = p.localCoordinates(q);
74 template<
class Class,
int N>
77 static int GetDimension(
const Class&) {
86 static int GetDimension(
const Class& m) {
101 enum { dimension = Class::dimension };
104 typedef Class ManifoldType;
106 typedef Eigen::Matrix<double, dimension, 1> TangentVector;
109 static TangentVector Local(
const Class& origin,
const Class& other) {
110 return origin.localCoordinates(other);
114 static Class Retract(
const Class& origin,
const TangentVector& v) {
115 return origin.retract(v);
127 check_manifold_invariants(
const T& a,
const T& b,
double tol=1e-9) {
145 BOOST_CONCEPT_USAGE(IsManifold) {
146 BOOST_STATIC_ASSERT_MSG(
147 (boost::is_base_of<manifold_tag, structure_category_tag>::value),
148 "This type's structure_category trait does not assert it as a manifold (or derived)");
149 BOOST_STATIC_ASSERT(TangentVector::SizeAtCompileTime == dim);
165 typedef const int value_type;
167 BOOST_STATIC_ASSERT_MSG(value != Eigen::Dynamic,
168 "FixedDimension instantiated for dymanically-sized type.");
174 template<
typename M1,
typename M2>
176 BOOST_CONCEPT_ASSERT((IsManifold<M1>));
177 BOOST_CONCEPT_ASSERT((IsManifold<M2>));
184 enum { dimension = dimension1 + dimension2 };
185 inline static size_t Dim() {
return dimension;}
186 inline size_t dim()
const {
return dimension;}
188 typedef Eigen::Matrix<double, dimension, 1> TangentVector;
215 template<
typename M1,
typename M2>
229 #define GTSAM_CONCEPT_MANIFOLD_INST(T) template class gtsam::IsManifold<T>; 230 #define GTSAM_CONCEPT_MANIFOLD_TYPE(T) typedef gtsam::IsManifold<T> _gtsam_IsManifold_##T; ProductManifold retract(const TangentVector &xi) const
Retract delta to manifold.
Definition: Manifold.h:198
tag to assert a type is a manifold
Definition: Manifold.h:33
TangentVector localCoordinates(const ProductManifold &other) const
Compute the coordinates in the tangent space.
Definition: Manifold.h:205
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
BOOST_CONCEPT_REQUIRES(((IsGroup< G >)),(bool)) check_group_invariants(const G &a
Check invariants.
typedef and functions to augment Eigen's MatrixXd
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
ProductManifold()
Default constructor needs default constructors to be defined.
Definition: Manifold.h:192
A helper that implements the traits interface for GTSAM manifolds.
Definition: Manifold.h:95
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Give fixed size dimension of a type, fails at compile time if dynamic.
Definition: Manifold.h:164
Extra manifold traits for fixed-dimension types.
Definition: Manifold.h:75
Special class for optional Jacobian arguments.
Definition: Testable.h:57
Helper class to construct the product manifold of two other manifolds, M1 and M2 Assumes nothing exce...
Definition: Manifold.h:175
Requirements on type to pass it to Manifold template below.
Definition: Manifold.h:59
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Concept check for values that can be used in unit tests.