gtsam
Loading...
Searching...
No Matches
gtsam::Rot2 Class Reference

Detailed Description

Rotation matrix NOTE: the angle theta is in radians unless explicitly stated.

Inheritance diagram for gtsam::Rot2:

Lie Group

using LieAlgebra = Matrix2
Matrix1 AdjointMap () const
 Calculate Adjoint map.
static Rot2 Expmap (const Vector1 &v, ChartJacobian H={})
 Exponential map at identity - create a rotation from canonical coordinates.
static Vector1 Logmap (const Rot2 &r, ChartJacobian H={})
 Log map at identity - return the canonical coordinates of this rotation.
static Matrix1 adjointMap (const Vector1 &)
 Lie-algebra adjoint (zero for abelian SO(2)).
static Vector1 adjoint (const Vector1 &, const Vector1 &, OptionalJacobian< 1, 1 > Hxi={}, OptionalJacobian< 1, 1 > Hy={})
 Apply Lie-algebra adjoint (always zero).
static Matrix ExpmapDerivative (const Vector &)
 Left-trivialized derivative of the exponential map.
static Matrix LogmapDerivative (const Vector &)
 Left-trivialized derivative inverse of the exponential map.
static Matrix2 Hat (const Vector1 &xi)
 Hat maps from tangent vector to Lie algebra.
static Vector1 Vee (const Matrix2 &X)
 Vee maps from Lie algebra to tangent vector.

Constructors and named constructors

 Rot2 ()
 default constructor, zero rotation
 Rot2 (const Rot2 &r)=default
 copy constructor
Rot2 & operator= (const Rot2 &other)=default
 Rot2 (double theta)
 Constructor from angle in radians == exponential map at identity.
static Rot2 fromAngle (double theta)
 Named constructor from angle in radians.
static Rot2 fromDegrees (double theta)
 Named constructor from angle in degrees.
static Rot2 fromCosSin (double c, double s)
 Named constructor from cos(theta),sin(theta) pair.
static Rot2 relativeBearing (const Point2 &d, OptionalJacobian< 1, 2 > H={})
 Named constructor with derivative Calculate relative bearing to a landmark in local coordinate frame.
static Rot2 atan2 (double y, double x)
 Named constructor that behaves as atan2, i.e., y,x order (!) and normalizes.
static Rot2 Random (std::mt19937 &rng)
 Random, generates random angle \(\in\) [-pi,pi] Example: std::mt19937 engine(42); Unit3 unit = Unit3::Random(engine);.

Testable

void print (const std::string &s="theta") const
 print
bool equals (const Rot2 &R, double tol=1e-9) const
 equals with an tolerance

Group

Rot2 inverse () const
 The inverse rotation - negative angle.
Rot2 operator* (const Rot2 &R) const
 Compose - make a new rotation by adding angles.
static Rot2 Identity ()
 Identity.

Group Action on Point2

Point2 rotate (const Point2 &p, OptionalJacobian< 2, 1 > H1={}, OptionalJacobian< 2, 2 > H2={}) const
 rotate point from rotated coordinate frame to world \( p^w = R_c^w p^c \)
Point2 operator* (const Point2 &p) const
 syntactic sugar for rotate
Point2 unrotate (const Point2 &p, OptionalJacobian< 2, 1 > H1={}, OptionalJacobian< 2, 2 > H2={}) const
 rotate point from world to rotated frame \( p^c = (R_c^w)^T p^w \)

Standard Interface

Point2 unit () const
 Creates a unit vector as a Point2.
double theta () const
 return angle (RADIANS)
double degrees () const
 return angle (DEGREES)
double c () const
 return cos
double s () const
 return sin
Matrix2 matrix () const
 return 2*2 rotation matrix
Matrix2 transpose () const
 return 2*2 transpose (inverse) rotation matrix
Vector4 vec (OptionalJacobian< 4, 1 > H={}) const
 Vectorize the rotation matrix into a 4D vector.
static Rot2 ClosestTo (const Matrix2 &M)
 Find closest valid rotation matrix, given a 2x2 matrix.

Classes

struct  ChartAtOrigin

Additional Inherited Members

Public Member Functions inherited from gtsam::MatrixLieGroup< Rot2, 1, 2 >
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< Rot2, 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 Rot2 & derived () const
Rot2 inverse (ChartJacobian H) const
Rot2 expmap (const TangentVector &v) const
 expmap as required by manifold concept Applies exponential map to v and composes with *this
TangentVector logmap (const Rot2 &g) const
 logmap as required by manifold concept Applies logarithmic map to group element that takes *this to g
Rot2 retract (const TangentVector &v) const
 retract as required by manifold concept: applies v at *this
TangentVector localCoordinates (const Rot2 &g) const
 localCoordinates as required by manifold concept: finds tangent vector between *this and g
Static Public Member Functions inherited from gtsam::MatrixLieGroup< Rot2, 1, 2 >
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< Rot2, D >
static constexpr int Dim ()
 Static method to get the dimension (compile-time or dynamic).
static Rot2 Retract (const TangentVector &v)
 Retract at origin: possible in Lie group because it has an identity.
static TangentVector LocalCoordinates (const Rot2 &g)
 LocalCoordinates at origin: possible in Lie group because it has an identity.
Static Public Attributes inherited from gtsam::MatrixLieGroup< Rot2, 1, 2 >
static constexpr auto dimension
Static Public Attributes inherited from gtsam::LieGroup< Rot2, D >
static constexpr auto dimension
Public Types inherited from gtsam::MatrixLieGroup< Rot2, 1, 2 >
using Base
using ChartJacobian
using Jacobian
using TangentVector
using Vectorized
using VectorizedJacobian
Public Types inherited from gtsam::LieGroup< Rot2, D >
typedef OptionalJacobian< N, N > ChartJacobian
typedef Eigen::Matrix< double, N, N > Jacobian
typedef Eigen::Matrix< double, N, 1 > TangentVector

Member Function Documentation

◆ relativeBearing()

Rot2 gtsam::Rot2::relativeBearing ( const Point2 & d,
OptionalJacobian< 1, 2 > H = {} )
static

Named constructor with derivative Calculate relative bearing to a landmark in local coordinate frame.

Parameters
d2D location of landmark
Hoptional reference for Jacobian
Returns
2D rotation \( \in SO(2) \)

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