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

Detailed Description

A 2D pose (Point2,Rot2).

Inheritance diagram for gtsam::Pose2:

Standard Constructors

 Pose2 ()
 default constructor = origin
 Pose2 (const Pose2 &pose)=default
 copy constructor
Pose2 & operator= (const Pose2 &other)=default
 Pose2 (double x, double y, double theta)
 construct from (x,y,theta)
 Pose2 (double theta, const Point2 &t)
 construct from rotation and translation
 Pose2 (const Rot2 &r, const Point2 &t)
 construct from r,t
 Pose2 (const Matrix &T)
 Constructor from 3*3 matrix.

Testable

void print (const std::string &s="") const
 print with optional string
bool equals (const Pose2 &pose, double tol=1e-9) const
 assert equality up to a tolerance

Group

Pose2 inverse () const
 inverse
Pose2 operator* (const Pose2 &p2) const
 compose syntactic sugar
static Pose2 Identity ()
 identity for group operation

Lie Group

Matrix3 AdjointMap () const
 Calculate Adjoint map Ad_pose is 3*3 matrix that when applied to twist xi \( [T_x,T_y,\theta] \), returns Ad_pose(xi).
static Pose2 Expmap (const Vector3 &xi, ChartJacobian H={})
 Exponential map at identity - create a rotation from canonical coordinates \( [T_x,T_y,\theta] \).
static Vector3 Logmap (const Pose2 &p, ChartJacobian H={})
 Log map at identity - return the canonical coordinates \( [T_x,T_y,\theta] \) of this rotation.
static Matrix3 adjointMap (const Vector3 &v)
 Compute the [ad(w,v)] operator for SE2 as in [Kobilarov09siggraph], pg 19.
static Matrix3 adjointMap_ (const Vector3 &xi)
static Vector3 adjoint_ (const Vector3 &xi, const Vector3 &y)
static Matrix3 ExpmapDerivative (const Vector3 &v)
 Derivative of Expmap.
static Matrix3 LogmapDerivative (const Pose2 &pose)
 Inverse right Jacobian of the exponential map evaluated at a pose.
static Matrix3 LogmapDerivative (const Vector3 &xi)
 Inverse right Jacobian of the exponential map evaluated at tangent coordinates xi = (dx, dy, dtheta).
static Matrix3 Hat (const Vector3 &xi)
 Hat maps from tangent vector to Lie algebra.
static Vector3 Vee (const Matrix3 &X)
 Vee maps from Lie algebra to tangent vector.

Group Action on Point2

Point2 transformTo (const Point2 &point, OptionalJacobian< 2, 3 > Dpose={}, OptionalJacobian< 2, 2 > Dpoint={}) const
 Return point coordinates in pose coordinate frame.
Matrix transformTo (ConstMatrixView points) const
 transform many points in world coordinates and transform to Pose.
Point2 transformFrom (const Point2 &point, OptionalJacobian< 2, 3 > Dpose={}, OptionalJacobian< 2, 2 > Dpoint={}) const
 Return point coordinates in global frame.
Matrix transformFrom (ConstMatrixView points) const
 transform many points in Pose coordinates and transform to world.
Point2 operator* (const Point2 &point) const
 syntactic sugar for transformFrom

Standard Interface

double x () const
 get x
double y () const
 get y
double theta () const
 get theta
const Point2 & t () const
 translation
const Rot2 & r () const
 rotation
const Point2 & translation (OptionalJacobian< 2, 3 > Hself={}) const
 translation
const Rot2 & rotation (OptionalJacobian< 1, 3 > Hself={}) const
 rotation
Matrix3 matrix () const
 return transformation matrix
Vector9 vec (OptionalJacobian< 9, 3 > H={}) const
 Vectorize the rotation matrix into a 9D vector.
Rot2 bearing (const Point2 &point, OptionalJacobian< 1, 3 > H1={}, OptionalJacobian< 1, 2 > H2={}) const
 Calculate bearing to a landmark.
Rot2 bearing (const Pose2 &pose, OptionalJacobian< 1, 3 > H1={}, OptionalJacobian< 1, 3 > H2={}) const
 Calculate bearing to another pose.
double range (const Point2 &point, OptionalJacobian< 1, 3 > H1={}, OptionalJacobian< 1, 2 > H2={}) const
 Calculate range to a landmark.
double range (const Pose2 &point, OptionalJacobian< 1, 3 > H1={}, OptionalJacobian< 1, 3 > H2={}) const
 Calculate range to another pose.

Advanced Constructors

static std::optional< Pose2 > Align (const Point2Pairs &abPointPairs)
 Create Pose2 by aligning two point pairs A pose aTb is estimated between pairs (a_point, b_point) such that a_point = aTb * b_point Note this allows for noise on the points but in that case the mapping will not be exact.
static std::optional< Pose2 > Align (ConstMatrixView a, ConstMatrixView b)

Advanced Interface

static std::pair< size_t, size_t > translationInterval ()
 Return the start and end indices (inclusive) of the translation component of the exponential map parameterization.
static std::pair< size_t, size_t > rotationInterval ()
 Return the start and end indices (inclusive) of the rotation component of the exponential map parameterization.
GTSAM_EXPORT friend std::ostream & operator<< (std::ostream &os, const Pose2 &p)
 Output stream operator.

Public Types

using Rotation = Rot2
 Pose Concept requirements.
using Translation = Point2
using LieAlgebra = Matrix3
 LieGroup Concept requirements.
Public Types inherited from gtsam::MatrixLieGroup< Pose2, 3, 3 >
using Base
using ChartJacobian
using Jacobian
using TangentVector
using Vectorized
using VectorizedJacobian
Public Types inherited from gtsam::LieGroup< Pose2, D >
typedef OptionalJacobian< N, N > ChartJacobian
typedef Eigen::Matrix< double, N, N > Jacobian
typedef Eigen::Matrix< double, N, 1 > TangentVector

Classes

struct  ChartAtOrigin

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ Pose2()

gtsam::Pose2::Pose2 ( double x,
double y,
double theta )
inline

construct from (x,y,theta)

Parameters
xx coordinate
yy coordinate
thetaangle with positive X-axis

Member Function Documentation

◆ bearing() [1/2]

Rot2 gtsam::Pose2::bearing ( const Point2 & point,
OptionalJacobian< 1, 3 > H1 = {},
OptionalJacobian< 1, 2 > H2 = {} ) const

Calculate bearing to a landmark.

Parameters
point2D location of landmark
Returns
2D rotation \( \in SO(2) \)

◆ bearing() [2/2]

Rot2 gtsam::Pose2::bearing ( const Pose2 & pose,
OptionalJacobian< 1, 3 > H1 = {},
OptionalJacobian< 1, 3 > H2 = {} ) const

Calculate bearing to another pose.

Parameters
pointSO(2) location of other pose
Returns
2D rotation \( \in SO(2) \)

◆ LogmapDerivative() [1/2]

Matrix3 gtsam::Pose2::LogmapDerivative ( const Pose2 & pose)
static

Inverse right Jacobian of the exponential map evaluated at a pose.

Parameters
posePose whose tangent coordinates determine the evaluation point.
Returns
The 3-by-3 inverse right Jacobian at Logmap(pose).

◆ LogmapDerivative() [2/2]

Matrix3 gtsam::Pose2::LogmapDerivative ( const Vector3 & xi)
static

Inverse right Jacobian of the exponential map evaluated at tangent coordinates xi = (dx, dy, dtheta).

Parameters
xiTangent coordinates at which to evaluate the Jacobian.
Returns
The 3-by-3 inverse right Jacobian at xi.

◆ range() [1/2]

double gtsam::Pose2::range ( const Point2 & point,
OptionalJacobian< 1, 3 > H1 = {},
OptionalJacobian< 1, 2 > H2 = {} ) const

Calculate range to a landmark.

Parameters
point2D location of landmark
Returns
range (double)

◆ range() [2/2]

double gtsam::Pose2::range ( const Pose2 & point,
OptionalJacobian< 1, 3 > H1 = {},
OptionalJacobian< 1, 3 > H2 = {} ) const

Calculate range to another pose.

Parameters
point2D location of other pose
Returns
range (double)

◆ rotationInterval()

std::pair< size_t, size_t > gtsam::Pose2::rotationInterval ( )
inlinestatic

Return the start and end indices (inclusive) of the rotation component of the exponential map parameterization.

Returns
a pair of [start, end] indices into the tangent space vector

◆ transformFrom()

Matrix gtsam::Pose2::transformFrom ( ConstMatrixView points) const

transform many points in Pose coordinates and transform to world.

Parameters
points2*N matrix in Pose coordinates
Returns
points in world coordinates, as 2*N Matrix

◆ transformTo()

Matrix gtsam::Pose2::transformTo ( ConstMatrixView points) const

transform many points in world coordinates and transform to Pose.

Parameters
points2*N matrix in world coordinates
Returns
points in Pose coordinates, as 2*N Matrix

◆ translationInterval()

std::pair< size_t, size_t > gtsam::Pose2::translationInterval ( )
inlinestatic

Return the start and end indices (inclusive) of the translation component of the exponential map parameterization.

Returns
a pair of [start, end] indices into the tangent space vector

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