36 template <
class Class,
int N>
45 return static_cast<const Class&
>(*this);
57 ChartJacobian H2 = {})
const {
58 if (H1) *H1 = g.inverse().AdjointMap();
64 ChartJacobian H2 = {})
const {
66 if (H1) *H1 = - result.inverse().AdjointMap();
72 if (H) *H = -
derived().AdjointMap();
85 return Class::Logmap(
between(g));
90 ChartJacobian H1, ChartJacobian H2 = {})
const {
94 if (H1) *H1 = g.inverse().AdjointMap();
101 ChartJacobian H1, ChartJacobian H2 = {})
const {
104 TangentVector v = Class::Logmap(h, (H1 || H2) ? &D_v_h : 0);
105 if (H1) *H1 = - D_v_h * h.inverse().AdjointMap();
112 return Class::ChartAtOrigin::Retract(v);
117 return Class::ChartAtOrigin::Local(g);
122 return Class::ChartAtOrigin::Retract(v,H);
127 return Class::ChartAtOrigin::Local(g,H);
132 return compose(Class::ChartAtOrigin::Retract(v));
137 return Class::ChartAtOrigin::Local(
between(g));
142 ChartJacobian H1, ChartJacobian H2 = {})
const {
144 Class g = Class::ChartAtOrigin::Retract(v, H2 ? &D_g_v : 0);
146 if (H1) *H1 = g.inverse().AdjointMap();
153 ChartJacobian H1, ChartJacobian H2 = {})
const {
156 TangentVector v = Class::ChartAtOrigin::Local(h, (H1 || H2) ? &D_v_h : 0);
157 if (H1) *H1 = - D_v_h * h.inverse().AdjointMap();
173 template<
class Class>
191 ChartJacobian Horigin = {}, ChartJacobian Hother = {}) {
192 return origin.localCoordinates(other, Horigin, Hother);
196 ChartJacobian Horigin = {}, ChartJacobian Hv = {}) {
197 return origin.retract(v, Horigin, Hv);
204 return Class::Logmap(m, Hm);
207 static Class Expmap(
const TangentVector& v, ChartJacobian Hv = {}) {
212 ChartJacobian H1 = {}, ChartJacobian H2 = {}) {
213 return m1.compose(m2, H1, H2);
217 ChartJacobian H1 = {}, ChartJacobian H2 = {}) {
218 return m1.between(m2, H1, H2);
222 ChartJacobian
H = {}) {
239 template<
class Class>
241 return l1.inverse().compose(l2);
245 template<
class Class>
247 return Class::Logmap(l0.between(lp));
251 template<
class Class>
270 "This type's trait does not assert it is a Lie group (or derived)");
286 ChartJacobian Hg,
Hh;
299 static const double _2 = 1. / 2., _12 = 1. / 12., _24 = 1. / 24.;
326 template <
typename T>
337 X, Delta, compose_H_x);
339 if (Hx) *Hx = compose_H_x + t * exp_H * log_H * between_H_x;
340 if (Hy) *Hy = t * exp_H * log_H;
358 typename T::Jacobian
operator()(
const typename T::Jacobian &covariance)
359 {
return adjointMap_ * covariance * adjointMap_.transpose(); }
372 #define GTSAM_CONCEPT_LIE_INST(T) template class gtsam::IsLieGroup<T>; 373 #define GTSAM_CONCEPT_LIE_TYPE(T) using _gtsam_IsLieGroup_##T = gtsam::IsLieGroup<T>;
tag to assert a type is a manifold
OptionalJacobian< dimension, dimension > ChartJacobian
AngularVelocity bracket(const AngularVelocity &X, const AngularVelocity &Y)
Class between_default(const Class &l1, const Class &l2)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set origin
Concept check class for variable types with Group properties.
Class expmap(const TangentVector &v, ChartJacobian H1, ChartJacobian H2={}) const
expmap with optional derivatives
tag to assert a type is a Lie group
static Class Between(const Class &m1, const Class &m2, ChartJacobian H1={}, ChartJacobian H2={})
TangentVector localCoordinates(const Class &g, ChartJacobian H1, ChartJacobian H2={}) const
localCoordinates with optional derivatives
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
Pose2_ Expmap(const Vector3_ &xi)
T BCH(const T &X, const T &Y)
AGC: bracket() only appears in Rot3 tests, should this be used elsewhere?
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
lie_group_tag structure_category
Class compose(const Class &g, ChartJacobian H1, ChartJacobian H2={}) const
T expm(const Vector &x, int K=7)
void g(const string &key, int i)
traits< T >::structure_category structure_category_tag
Class between(const Class &g, ChartJacobian H1, ChartJacobian H2={}) const
TangentVector localCoordinates(const Class &g) const
localCoordinates as required by manifold concept: finds tangent vector between *this and g ...
Extra manifold traits for fixed-dimension types.
static Class Expmap(const TangentVector &v, ChartJacobian Hv={})
static Class Inverse(const Class &m, ChartJacobian H={})
static Class Retract(const TangentVector &v, ChartJacobian H)
Retract at origin with optional derivative.
Matrix wedge(const Vector &x)
Eigen::Matrix< double, N, N > Jacobian
OptionalJacobian< N, N > ChartJacobian
static Class Retract(const Class &origin, const TangentVector &v, ChartJacobian Horigin={}, ChartJacobian Hv={})
Base class and basic functions for Manifold types.
Group operator syntax flavors.
Array< int, Dynamic, 1 > v
Eigen::Triplet< double > T
traits< T >::ManifoldType ManifoldType
BetweenFactor< Rot3 > Between
traits< T >::TangentVector TangentVector
Class expmap_default(const Class &t, const Vector &d)
Class compose(const Class &g) const
multiplicative_group_tag group_flavor
static TangentVector Logmap(const Class &m, ChartJacobian Hm={})
Class retract(const TangentVector &v, ChartJacobian H1, ChartJacobian H2={}) const
retract with optional derivatives
BOOST_CONCEPT_USAGE(IsLieGroup)
static Class Compose(const Class &m1, const Class &m2, ChartJacobian H1={}, ChartJacobian H2={})
Eigen::Matrix< double, N, 1 > TangentVector
Both LieGroupTraits and Testable.
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
static TangentVector LocalCoordinates(const Class &g)
LocalCoordinates at origin: possible in Lie group because it has an identity.
Class between(const Class &g) const
static Class Retract(const TangentVector &v)
Retract at origin: possible in Lie group because it has an identity.
Class expmap(const TangentVector &v) const
TangentVector logmap(const Class &g, ChartJacobian H1, ChartJacobian H2={}) const
logmap with optional derivatives
const Class & derived() const
traits< T >::ChartJacobian ChartJacobian
static TangentVector Local(const Class &origin, const Class &other, ChartJacobian Horigin={}, ChartJacobian Hother={})
TangentVector logmap(const Class &g) const
tag to assert a type is a group
static TangentVector LocalCoordinates(const Class &g, ChartJacobian H)
LocalCoordinates at origin with optional derivative.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
T interpolate(const T &X, const T &Y, double t, typename MakeOptionalJacobian< T, T >::type Hx={}, typename MakeOptionalJacobian< T, T >::type Hy={})
Eigen::Matrix< double, dimension, 1 > TangentVector
Vector logmap_default(const Class &l0, const Class &lp)
Class inverse(ChartJacobian H) const