![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
Rigid-body pose in SE(2) with unit-safe position and rotation. More...
#include <Pose.hpp>
Public Member Functions | |
| constexpr | Pose () noexcept=default |
| Constructs the identity pose at the origin with zero heading. | |
| Pose (const Point &point, const Rotation &rotation) noexcept | |
| Constructs from a point and rotation. | |
| Pose (Length x, Length y, const Rotation &rotation) noexcept | |
| Constructs from Cartesian components and a rotation. | |
| Pose (Length x, Length y, Angle angle) noexcept | |
| Constructs from Cartesian components and an angle. | |
| const Point & | getPoint () const noexcept |
| Access the position. | |
| const Rotation & | getRotation () const noexcept |
| Access the heading. | |
| Length | X () const noexcept |
| X position (meters). | |
| Length | Y () const noexcept |
| Y position (meters). | |
| Angle | Theta () const noexcept |
| Heading angle (radians, in (-π, π]). | |
| Pose | transformBy (const Transform &rhs) const noexcept |
| Applies a rigid transform to this pose (pose ⊕ transform). | |
| Transform | relativeTo (const Pose &rhs) const noexcept |
| Computes the transform that takes rhs into *this (rhs ⊖ this). | |
| Pose | exp (const Twist &rhs) const noexcept |
| SE(2) exponential map: integrates a body-frame twist. | |
| Twist | log (const Pose &rhs) const noexcept |
| SE(2) logarithmic map: body-frame twist from this pose to rhs. | |
| bool | isApprox (const Pose &rhs) const noexcept |
| Approximate equality of both position and heading. | |
Rigid-body pose in SE(2) with unit-safe position and rotation.
Pose stores a 2D position (Point, meters) and a heading (Rotation, radians). It provides composition relative to a Transform, relative transforms between poses, and SE(2) exponential / logarithmic maps for integrating small twists or extracting differential motion.
Headings are right-handed, counter-clockwise about +Z, normalized to (-180, 180] degrees.
|
constexprdefaultnoexcept |
Constructs the identity pose at the origin with zero heading.
Constructs from a point and rotation.
| point | Position in meters. |
| rotation | Heading (normalized to (-π, π]). |
Constructs from Cartesian components and a rotation.
| x | X coordinate (meters). |
| y | Y coordinate (meters). |
| rotation | Heading (normalized to (-π, π]). |
Constructs from Cartesian components and an angle.
| x | X coordinate (meters). |
| y | Y coordinate (meters). |
| angle | Heading angle (radians), normalized to (-π, π]. |
SE(2) exponential map: integrates a body-frame twist.
For a small body-frame twist (dX, dY, dTheta), returns this ⊕ Exp(dX, dY, dTheta). Uses a small-angle approximation for |dTheta| < 1e-9 to maintain numerical stability.
| rhs | Body-frame twist. |
|
noexcept |
Access the position.
|
noexcept |
Access the heading.
|
noexcept |
Approximate equality of both position and heading.
| rhs | Other pose. |
SE(2) logarithmic map: body-frame twist from this pose to rhs.
Computes Log(transform), where transform = rhs.relativeTo(*this). Uses a stable formula with a small-angle branch for |dTheta| < 1e-9.
| rhs | Target pose. |
Computes the transform that takes rhs into *this (rhs ⊖ this).
| rhs | Reference pose to measure from. |
|
noexcept |
Heading angle (radians, in (-π, π]).
Applies a rigid transform to this pose (pose ⊕ transform).
Equivalent to: rotate the transform’s translation by this pose’s heading, then translate, and add the headings.
| rhs | Transform to apply in this pose’s local frame. |
|
noexcept |
X position (meters).
|
noexcept |
Y position (meters).