Class sym::Pose2

template<typename ScalarType>
class Pose2

Autogenerated C++ implementation of symforce.geo.pose2.Pose2.

Group of two-dimensional rigid body transformations - R2 x SO(2).

The storage space is a complex (real, imag) for rotation followed by a position (x, y).

The tangent space is one angle for rotation followed by two elements for translation in the non-rotated frame.

For Lie group enthusiasts: This class is on the PRODUCT manifold. On this class, the group operations (e.g. compose and between) operate as you’d expect for a Pose or SE(2), but the manifold operations (e.g. retract and local_coordinates) operate on the product manifold SO(2) x R2. This means that:

  • retract(a, vec) != compose(a, from_tangent(vec))

  • local_coordinates(a, b) != to_tangent(between(a, b))

  • There is no hat operator, because from_tangent/to_tangent is not the matrix exp/log

If you need a type that has these properties in symbolic expressions, you should use :class:symforce.geo.unsupported.pose2_se2.Pose2_SE2. There is no runtime equivalent of :class:Pose2_SE2 <symforce.geo.unsupported.pose2_se2.Pose2_SE2>, see the docstring on that class for more information.

Public Types

using Scalar = ScalarType
using Self = Pose2<Scalar>
using DataVec = Eigen::Matrix<Scalar, 4, 1>
using TangentVec = Eigen::Matrix<Scalar, 3, 1>
using SelfJacobian = Eigen::Matrix<Scalar, 3, 3>
using Vector2 = Eigen::Matrix<Scalar, 2, 1>

Public Functions

inline explicit Pose2(const DataVec &data, const bool normalize = true)

Construct from data vec

Parameters:

normalize – Project to the manifold on construction. This ensures numerical stability as this constructor is called after each codegen operation. Constructing from a normalized vector may be faster, e.g. with FromStorage.

inline Pose2()
inline const DataVec &Data() const
template<typename Derived>
inline Pose2(const Rot2<Scalar> &rotation, const Eigen::MatrixBase<Derived> &position)
inline Eigen::Transform<Scalar, 2, Eigen::TransformTraits::Isometry> ToTransform() const
inline sym::Rot2<Scalar> Rotation() const
const Vector2 RotationStorage() const

Returns the rotational component of this pose.

const Vector2 Position() const

Returns the positional component of this pose.

const Vector2 ComposeWithPoint(const Vector2 &right) const

Left-multiply with a compatible quantity.

const Vector2 InverseCompose(const Vector2 &point) const

Returns self.inverse() * point

This is more efficient than calling the generated inverse and compose methods separately, if doing this for one point.

const Eigen::Matrix<Scalar, 3, 3> ToHomogenousMatrix() const

A matrix representation of this element in the Euclidean space that contains it.

Returns: 3x3 Matrix

inline void ToStorage(Scalar *const vec) const
inline Self Inverse() const
inline Self Compose(const Self &b) const
inline Vector2 Compose(const Vector2 &point) const
inline Self Between(const Self &b) const
inline Self InverseWithJacobian(SelfJacobian *const res_D_a = nullptr) const
inline Self ComposeWithJacobians(const Self &b, SelfJacobian *const res_D_a = nullptr, SelfJacobian *const res_D_b = nullptr) const
inline Self BetweenWithJacobians(const Self &b, SelfJacobian *const res_D_a = nullptr, SelfJacobian *const res_D_b = nullptr) const
template<typename Other>
inline auto operator*(const Other &b) const -> decltype(Compose(b))
inline TangentVec ToTangent(const Scalar epsilon = kDefaultEpsilon<Scalar>) const
inline Self Retract(const TangentVec &vec, const Scalar epsilon = kDefaultEpsilon<Scalar>) const
inline TangentVec LocalCoordinates(const Self &b, const Scalar epsilon = kDefaultEpsilon<Scalar>) const
inline Self Interpolate(const Self b, const Scalar alpha, const Scalar epsilon = kDefaultEpsilon<Scalar>) const
inline bool IsApprox(const Self &b, const Scalar tol) const
template<typename ToScalar>
inline Pose2<ToScalar> Cast() const
inline bool operator==(const Pose2 &rhs) const
inline bool operator!=(const Pose2 &rhs) const

Public Static Functions

template<typename Generator>
static inline Pose2 Random(Generator &gen)
static inline constexpr int32_t StorageDim()
static inline Pose2 FromStorage(const Scalar *const vec)
static inline Self Identity()
static inline constexpr int32_t TangentDim()
static inline Self FromTangent(const TangentVec &vec, const Scalar epsilon = kDefaultEpsilon<Scalar>)