gtsam
Loading...
Searching...
No Matches
gtsam::SO< N > Class Template Reference

Detailed Description

template<int N>
class gtsam::SO< N >

Manifold of special orthogonal rotation matrices SO<N>.

Template paramater N can be a fixed integer or can be Eigen::Dynamic

Inheritance diagram for gtsam::SO< N >:

Manifold

using TangentVector = Eigen::Matrix<double, dimension, 1>
using ChartJacobian = OptionalJacobian<dimension, dimension>
size_t dim () const
static size_t Dimension (size_t n)
static size_t AmbientDim (size_t d)
static MatrixNN Hat (const TangentVector &xi)
 Hat operator creates Lie algebra element corresponding to d-vector, where d is the dimensionality of the manifold.
static void Hat (const Vector &xi, Eigen::Ref< MatrixNN > X)
 In-place version of Hat (see details there), implements recursion.
static TangentVector Vee (const MatrixNN &X)
 Inverse of Hat. See note about xi element order in Hat.
template<int N_ = N, typename = IsDynamic<N_>>
static MatrixDD IdentityJacobian (size_t n)

Constructors

template<int N_ = N, typename = IsFixed<N_>>
 SO ()
 Construct SO<N> identity for N >= 2.
template<int N_ = N, typename = IsDynamic<N_>>
 SO (size_t n=0)
 Construct SO<N> identity for N == Eigen::Dynamic.
template<typename Derived>
 SO (const Eigen::MatrixBase< Derived > &R)
 Constructor from Eigen Matrix, dynamic version.
template<int M, int N_ = N, typename = IsDynamic<N_>>
 SO (const SO< M > &R)
 Construct dynamic SO(n) from Fixed SO<M>.
template<int N_ = N, typename = IsSO3<N_>>
 SO (const Eigen::AngleAxisd &angleAxis)
 Constructor from AngleAxisd.
template<typename Derived>
static SO FromMatrix (const Eigen::MatrixBase< Derived > &R)
 Named constructor from Eigen Matrix.
template<typename Derived, int N_ = N, typename = IsDynamic<N_>>
static SO Lift (size_t n, const Eigen::MatrixBase< Derived > &R)
 Named constructor from lower dimensional matrix.
static SO AxisAngle (const Vector3 &axis, double theta)
 Constructor from axis and angle. Only defined for SO3.
static SO ClosestTo (const MatrixNN &M)
 Named constructor that finds SO(n) matrix closest to M in Frobenius norm, currently only defined for SO3.
static SO ChordalMean (const std::vector< SO > &rotations)
 Named constructor that finds chordal mean \( mu = argmin_R \sum sqr(|R-R_i|_F) \), currently only defined for SO3.
template<int N_ = N, typename = IsDynamic<N_>>
static SO Random (std::mt19937 &rng, size_t n=0)
 Random SO(n) element (no big claims about uniformity). SO(3) is specialized in SO3.cpp.
template<int N_ = N, typename = IsFixed<N_>>
static SO Random (std::mt19937 &rng)
 Random SO(N) element (no big claims about uniformity).

Group

SO operator* (const SO &other) const
 Multiplication.
SO inverse () const
 inverse of a rotation = transpose
template<int N_ = N, typename = IsFixed<N_>>
static SO Identity ()
 SO<N> identity for N >= 2.
template<int N_ = N, typename = IsDynamic<N_>>
static SO Identity (size_t n=0)
 SO<N> identity for N == Eigen::Dynamic.

Lie Group

MatrixDD AdjointMap () const
 Adjoint map.
static SO Expmap (const TangentVector &omega)
 Exponential map at identity - create a rotation from canonical coordinates.
static SO Expmap (const TangentVector &omega, ChartJacobian H)=delete
 Exponential map with a Jacobian, specialized when supported.
static MatrixDD ExpmapDerivative (const TangentVector &omega)=delete
 Derivative of Expmap, specialized when supported.
static TangentVector Logmap (const SO &R)
 Log map at identity - returns the canonical coordinates of this rotation.
static TangentVector Logmap (const SO &R, ChartJacobian H)=delete
 Logarithm map with a Jacobian, specialized when supported.
static MatrixDD LogmapDerivative (const TangentVector &omega)=delete
 Derivative of Logmap, specialized when supported.

Other methods

VectorN2 vec (OptionalJacobian< internal::NSquaredSO(N), dimension > H={}) const
 Return vectorized rotation matrix in column order.
template<int N_ = N, typename = IsFixed<N_>>
static Matrix VectorizedGenerators ()
 Calculate N^2 x dim matrix of vectorized Lie algebra generators for SO(N).
template<int N_ = N, typename = IsDynamic<N_>>
static Matrix VectorizedGenerators (size_t n=0)
 Calculate n^2 x dim matrix of vectorized Lie algebra generators for SO(n).

Public Member Functions

Standard methods
const MatrixNN & matrix () const
 Return matrix.
size_t rows () const
size_t cols () const
Testable
void print (const std::string &s=std::string()) const
bool equals (const SO &other, double tol) const
Public Member Functions inherited from gtsam::MatrixLieGroup< SO< N >, internal::DimensionSO(N), N >
std::enable_if_t< M !=Eigen::Dynamic, int > dim () const
 Provided fixed dimension in dim() if needed.
Eigen::Matrix< double, internal::product(N, N), 1 > vec (OptionalJacobian< internal::product(N, N), D > H={}) const
 Vectorize the matrix representation of a Lie group element.
Jacobian AdjointMap () const
 A generic implementation of AdjointMap for matrix Lie groups.
TangentVector Adjoint (const TangentVector &xi, ChartJacobian H_this={}, ChartJacobian H_xi={}) const
 Adjoint action on a tangent vector.
TangentVector AdjointTranspose (const TangentVector &x, ChartJacobian H_this={}, ChartJacobian H_x={}) const
 Dual Adjoint action on a tangent covector.
Public Member Functions inherited from gtsam::LieGroup< SO< N >, D >
SOn compose (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
SOn between (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
GTSAM_EXPORT SOn compose (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
GTSAM_EXPORT SOn between (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
std::enable_if_t< M !=Eigen::Dynamic, int > dim () const
 Provided fixed dimension in dim() if needed.
const SO< N > & derived () const
SO< N > inverse (ChartJacobian H) const
SO< N > expmap (const TangentVector &v) const
 expmap as required by manifold concept Applies exponential map to v and composes with *this
TangentVector logmap (const SO< N > &g) const
 logmap as required by manifold concept Applies logarithmic map to group element that takes *this to g
SO< N > retract (const TangentVector &v) const
 retract as required by manifold concept: applies v at *this
TangentVector localCoordinates (const SO< N > &g) const
 localCoordinates as required by manifold concept: finds tangent vector between *this and g

Static Public Attributes

static constexpr auto dimension = internal::DimensionSO(N)
Static Public Attributes inherited from gtsam::MatrixLieGroup< SO< N >, internal::DimensionSO(N), N >
static constexpr auto dimension
Static Public Attributes inherited from gtsam::LieGroup< SO< N >, D >
static constexpr auto dimension

Public Types

using MatrixNN = Eigen::Matrix<double, N, N>
using VectorN2 = Eigen::Matrix<double, internal::NSquaredSO(N), 1>
using MatrixDD = Eigen::Matrix<double, dimension, dimension>
using LieAlgebra = MatrixNN
 LieGroup Concept requirements.
Public Types inherited from gtsam::MatrixLieGroup< SO< N >, internal::DimensionSO(N), N >
using Base
using ChartJacobian
using Jacobian
using TangentVector
using Vectorized
using VectorizedJacobian
Public Types inherited from gtsam::LieGroup< SO< N >, D >
typedef OptionalJacobian< N, N > ChartJacobian
typedef Eigen::Matrix< double, N, N > Jacobian
typedef Eigen::Matrix< double, N, 1 > TangentVector

Classes

struct  ChartAtOrigin

Protected Types

template<int N_>
using IsDynamic = typename std::enable_if<N_ == Eigen::Dynamic, void>::type
template<int N_>
using IsFixed = typename std::enable_if<N_ >= 2, void>::type
template<int N_>
using IsSO3 = typename std::enable_if<N_ == 3, void>::type

Protected Attributes

MatrixNN matrix_
 Rotation matrix.

Additional Inherited Members

Static Public Member Functions inherited from gtsam::MatrixLieGroup< SO< N >, internal::DimensionSO(N), N >
static constexpr int Dim ()
 Static method to get the dimension (compile-time or dynamic).
static Jacobian adjointMap (const TangentVector &xi)
 Lie algebra adjoint map ad_xi, with optional specialization in derived classes.
static TangentVector adjoint (const TangentVector &xi, const TangentVector &y, ChartJacobian Hxi={}, ChartJacobian H_y={})
 Lie algebra action ad_xi(y), with optional Jacobians.
static TangentVector adjointTranspose (const TangentVector &xi, const TangentVector &y, ChartJacobian Hxi={}, ChartJacobian H_y={})
 Dual Lie algebra action ad_xi^T(y), with optional Jacobians.
Static Public Member Functions inherited from gtsam::LieGroup< SO< N >, D >
static constexpr int Dim ()
 Static method to get the dimension (compile-time or dynamic).
static SO< N > Retract (const TangentVector &v)
 Retract at origin: possible in Lie group because it has an identity.
static TangentVector LocalCoordinates (const SO< N > &g)
 LocalCoordinates at origin: possible in Lie group because it has an identity.

Member Function Documentation

◆ Hat()

template<int N>
SO< N >::MatrixNN gtsam::SO< N >::Hat ( const TangentVector & xi)
static

Hat operator creates Lie algebra element corresponding to d-vector, where d is the dimensionality of the manifold.

This function is implemented recursively, and the d-vector is assumed to laid out such that the last element corresponds to so(2), the last 3 to so(3), the last 6 to so(4) etc... For example, the vector-space isomorphic to so(5) is laid out as: a b c d | u v w | x y | z where the latter elements correspond to "telescoping" sub-algebras: 0 -z y w -d z 0 -x -v c -y x 0 u -b -w v -u 0 a d -c b -a 0 This scheme behaves exactly as expected for SO(2) and SO(3).


The documentation for this class was generated from the following files:
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/geometry/SOn.h
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/geometry/SOn-inl.h