Classes | Private Member Functions | Private Attributes | List of all members
gtsam::Rot2 Class Reference

#include <Rot2.h>

Inheritance diagram for gtsam::Rot2:
Inheritance graph
[legend]

Classes

struct  ChartAtOrigin
 

Private Member Functions

Rot2normalize ()
 
 Rot2 (double c, double s)
 

Private Attributes

double c_
 
double s_
 

Constructors and named constructors

 Rot2 ()
 
 Rot2 (const Rot2 &r)
 
 Rot2 (double theta)
 Constructor from angle in radians == exponential map at identity. More...
 
static Rot2 fromAngle (double theta)
 Named constructor from angle in radians. More...
 
static Rot2 fromDegrees (double theta)
 Named constructor from angle in degrees. More...
 
static Rot2 fromCosSin (double c, double s)
 Named constructor from cos(theta),sin(theta) pair. More...
 
static Rot2 relativeBearing (const Point2 &d, OptionalJacobian< 1, 2 > H={})
 
static Rot2 atan2 (double y, double x)
 
static Rot2 Random (std::mt19937 &rng)
 

Testable

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

Group

Rot2 inverse () const
 
Rot2 operator* (const Rot2 &R) const
 
static Rot2 Identity ()
 

Lie Group

Matrix1 AdjointMap () const
 
static Rot2 Expmap (const Vector1 &v, ChartJacobian H={})
 Exponential map at identity - create a rotation from canonical coordinates. More...
 
static Vector1 Logmap (const Rot2 &r, ChartJacobian H={})
 Log map at identity - return the canonical coordinates of this rotation. More...
 
static Matrix ExpmapDerivative (const Vector &)
 Left-trivialized derivative of the exponential map. More...
 
static Matrix LogmapDerivative (const Vector &)
 Left-trivialized derivative inverse of the exponential map. More...
 

Group Action on Point2

Point2 rotate (const Point2 &p, OptionalJacobian< 2, 1 > H1={}, OptionalJacobian< 2, 2 > H2={}) const
 
Point2 operator* (const Point2 &p) const
 
Point2 unrotate (const Point2 &p, OptionalJacobian< 2, 1 > H1={}, OptionalJacobian< 2, 2 > H2={}) const
 

Standard Interface

Point2 unit () const
 Creates a unit vector as a Point2. More...
 
double theta () const
 
double degrees () const
 
double c () const
 
double s () const
 
Matrix2 matrix () const
 
Matrix2 transpose () const
 
static Rot2 ClosestTo (const Matrix2 &M)
 

Additional Inherited Members

- Public Types inherited from gtsam::LieGroup< Rot2, 1 >
enum  
 
typedef OptionalJacobian< N, NChartJacobian
 
typedef Eigen::Matrix< double, N, NJacobian
 
typedef Eigen::Matrix< double, N, 1 > TangentVector
 
- Public Member Functions inherited from gtsam::LieGroup< Rot2, 1 >
Rot2 between (const Rot2 &g) const
 
Rot2 between (const Rot2 &g, ChartJacobian H1, ChartJacobian H2={}) const
 
SOn between (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
 
GTSAM_EXPORT SOn between (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
 
Rot2 compose (const Rot2 &g) const
 
Rot2 compose (const Rot2 &g, ChartJacobian H1, ChartJacobian H2={}) const
 
SOn compose (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
 
GTSAM_EXPORT SOn compose (const SOn &g, DynamicJacobian H1, DynamicJacobian H2) const
 
const Rot2derived () const
 
Rot2 expmap (const TangentVector &v) const
 
Rot2 expmap (const TangentVector &v, ChartJacobian H1, ChartJacobian H2={}) const
 expmap with optional derivatives More...
 
Rot2 inverse (ChartJacobian H) const
 
TangentVector localCoordinates (const Rot2 &g) const
 localCoordinates as required by manifold concept: finds tangent vector between *this and g More...
 
TangentVector localCoordinates (const Rot2 &g, ChartJacobian H1, ChartJacobian H2={}) const
 localCoordinates with optional derivatives More...
 
TangentVector logmap (const Rot2 &g) const
 
TangentVector logmap (const Rot2 &g, ChartJacobian H1, ChartJacobian H2={}) const
 logmap with optional derivatives More...
 
Rot2 retract (const TangentVector &v) const
 retract as required by manifold concept: applies v at *this More...
 
Rot2 retract (const TangentVector &v, ChartJacobian H1, ChartJacobian H2={}) const
 retract with optional derivatives More...
 
- Static Public Member Functions inherited from gtsam::LieGroup< Rot2, 1 >
static TangentVector LocalCoordinates (const Rot2 &g)
 LocalCoordinates at origin: possible in Lie group because it has an identity. More...
 
static TangentVector LocalCoordinates (const Rot2 &g, ChartJacobian H)
 LocalCoordinates at origin with optional derivative. More...
 
static Rot2 Retract (const TangentVector &v)
 Retract at origin: possible in Lie group because it has an identity. More...
 
static Rot2 Retract (const TangentVector &v, ChartJacobian H)
 Retract at origin with optional derivative. More...
 

Detailed Description

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

Definition at line 35 of file Rot2.h.

Constructor & Destructor Documentation

◆ Rot2() [1/4]

gtsam::Rot2::Rot2 ( double  c,
double  s 
)
inlineprivate

private constructor from cos/sin

Definition at line 44 of file Rot2.h.

◆ Rot2() [2/4]

gtsam::Rot2::Rot2 ( )
inline

default constructor, zero rotation

Definition at line 52 of file Rot2.h.

◆ Rot2() [3/4]

gtsam::Rot2::Rot2 ( const Rot2 r)
inline

copy constructor

Definition at line 55 of file Rot2.h.

◆ Rot2() [4/4]

gtsam::Rot2::Rot2 ( double  theta)
inline

Constructor from angle in radians == exponential map at identity.

Definition at line 58 of file Rot2.h.

Member Function Documentation

◆ AdjointMap()

Matrix1 gtsam::Rot2::AdjointMap ( ) const
inline

Calculate Adjoint map

Definition at line 131 of file Rot2.h.

◆ atan2()

Rot2 gtsam::Rot2::atan2 ( double  y,
double  x 
)
static

Named constructor that behaves as atan2, i.e., y,x order (!) and normalizes

Definition at line 33 of file Rot2.cpp.

◆ c()

double gtsam::Rot2::c ( ) const
inline

return cos

Definition at line 197 of file Rot2.h.

◆ ClosestTo()

Rot2 gtsam::Rot2::ClosestTo ( const Matrix2 &  M)
static

Find closest valid rotation matrix, given a 2x2 matrix

Definition at line 133 of file Rot2.cpp.

◆ degrees()

double gtsam::Rot2::degrees ( ) const
inline

return angle (DEGREES)

Definition at line 191 of file Rot2.h.

◆ equals()

bool gtsam::Rot2::equals ( const Rot2 R,
double  tol = 1e-9 
) const

equals with an tolerance

Definition at line 51 of file Rot2.cpp.

◆ Expmap()

Rot2 gtsam::Rot2::Expmap ( const Vector1 v,
ChartJacobian  H = {} 
)
static

Exponential map at identity - create a rotation from canonical coordinates.

Definition at line 67 of file Rot2.cpp.

◆ ExpmapDerivative()

static Matrix gtsam::Rot2::ExpmapDerivative ( const Vector )
inlinestatic

Left-trivialized derivative of the exponential map.

Definition at line 134 of file Rot2.h.

◆ fromAngle()

static Rot2 gtsam::Rot2::fromAngle ( double  theta)
inlinestatic

Named constructor from angle in radians.

Definition at line 61 of file Rot2.h.

◆ fromCosSin()

Rot2 gtsam::Rot2::fromCosSin ( double  c,
double  s 
)
static

Named constructor from cos(theta),sin(theta) pair.

Definition at line 27 of file Rot2.cpp.

◆ fromDegrees()

static Rot2 gtsam::Rot2::fromDegrees ( double  theta)
inlinestatic

Named constructor from angle in degrees.

Definition at line 66 of file Rot2.h.

◆ Identity()

static Rot2 gtsam::Rot2::Identity ( )
inlinestatic

Identity

Definition at line 110 of file Rot2.h.

◆ inverse()

Rot2 gtsam::Rot2::inverse ( ) const
inline

The inverse rotation - negative angle

Definition at line 113 of file Rot2.h.

◆ Logmap()

Vector1 gtsam::Rot2::Logmap ( const Rot2 r,
ChartJacobian  H = {} 
)
static

Log map at identity - return the canonical coordinates of this rotation.

Definition at line 77 of file Rot2.cpp.

◆ LogmapDerivative()

static Matrix gtsam::Rot2::LogmapDerivative ( const Vector )
inlinestatic

Left-trivialized derivative inverse of the exponential map.

Definition at line 139 of file Rot2.h.

◆ matrix()

Matrix2 gtsam::Rot2::matrix ( ) const

return 2*2 rotation matrix

Definition at line 85 of file Rot2.cpp.

◆ normalize()

Rot2 & gtsam::Rot2::normalize ( )
private

normalize to make sure cos and sin form unit vector

Definition at line 56 of file Rot2.cpp.

◆ operator*() [1/2]

Point2 gtsam::Rot2::operator* ( const Point2 p) const
inline

syntactic sugar for rotate

Definition at line 166 of file Rot2.h.

◆ operator*() [2/2]

Rot2 gtsam::Rot2::operator* ( const Rot2 R) const
inline

Compose - make a new rotation by adding angles

Definition at line 116 of file Rot2.h.

◆ print()

void gtsam::Rot2::print ( const std::string &  s = "theta") const

print

Definition at line 46 of file Rot2.cpp.

◆ Random()

Rot2 gtsam::Rot2::Random ( std::mt19937 &  rng)
static

Random, generates random angle $\in$ [-pi,pi] Example: std::mt19937 engine(42); Unit3 unit = Unit3::Random(engine);

Definition at line 39 of file Rot2.cpp.

◆ 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) $

Definition at line 119 of file Rot2.cpp.

◆ rotate()

Point2 gtsam::Rot2::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 $

Definition at line 100 of file Rot2.cpp.

◆ s()

double gtsam::Rot2::s ( ) const
inline

return sin

Definition at line 202 of file Rot2.h.

◆ theta()

double gtsam::Rot2::theta ( ) const
inline

return angle (RADIANS)

Definition at line 186 of file Rot2.h.

◆ transpose()

Matrix2 gtsam::Rot2::transpose ( ) const

return 2*2 transpose (inverse) rotation matrix

Definition at line 92 of file Rot2.cpp.

◆ unit()

Point2 gtsam::Rot2::unit ( ) const
inline

Creates a unit vector as a Point2.

Definition at line 181 of file Rot2.h.

◆ unrotate()

Point2 gtsam::Rot2::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 $

Definition at line 110 of file Rot2.cpp.

Member Data Documentation

◆ c_

double gtsam::Rot2::c_
private

we store cos(theta) and sin(theta)

Definition at line 38 of file Rot2.h.

◆ s_

double gtsam::Rot2::s_
private

Definition at line 38 of file Rot2.h.


The documentation for this class was generated from the following files:


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:52:43