RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
Pose.hpp
1#pragma once
2#include "RaidZeroLib/api/Geometry/Point.hpp"
3#include "RaidZeroLib/api/Geometry/Rotation.hpp"
4
5namespace rz {
6
7class Transform;
8class Twist;
9
20class Pose {
21 public:
23 constexpr Pose() noexcept = default;
24
31 Pose(const Point& point, const Rotation& rotation) noexcept;
32
40 Pose(Length x, Length y, const Rotation& rotation) noexcept;
41
49 Pose(Length x, Length y, Angle angle) noexcept;
50
52 const Point& getPoint() const noexcept;
53
55 const Rotation& getRotation() const noexcept;
56
58 Length X() const noexcept;
59
61 Length Y() const noexcept;
62
64 Angle Theta() const noexcept;
65
75 Pose transformBy(const Transform& rhs) const noexcept;
76
83 Transform relativeTo(const Pose& rhs) const noexcept;
84
95 Pose exp(const Twist& rhs) const noexcept;
96
106 Twist log(const Pose& rhs) const noexcept;
107
114 bool isApprox(const Pose& rhs) const noexcept;
115
116 private:
117 Point point;
118 Rotation rotation;
119};
120
133Curvature curvatureToPoint(const Pose& pose, const Point& point) noexcept;
134
135} // namespace rz
Immutable 2D point / vector with unit-safe Cartesian coordinates.
Definition Point.hpp:21
Rigid-body pose in SE(2) with unit-safe position and rotation.
Definition Pose.hpp:20
constexpr Pose() noexcept=default
Constructs the identity pose at the origin with zero heading.
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).
Length Y() const noexcept
Y position (meters).
Pose exp(const Twist &rhs) const noexcept
SE(2) exponential map: integrates a body-frame twist.
bool isApprox(const Pose &rhs) const noexcept
Approximate equality of both position and heading.
const Point & getPoint() const noexcept
Access the position.
Angle Theta() const noexcept
Heading angle (radians, in (-π, π]).
Length X() const noexcept
X position (meters).
const Rotation & getRotation() const noexcept
Access the heading.
Twist log(const Pose &rhs) const noexcept
SE(2) logarithmic map: body-frame twist from this pose to rhs.
Immutable planar rotation about the Z axis.
Definition Rotation.hpp:16
Rigid-body transform in SE(2): translation (meters) + rotation (radians).
Definition Transform.hpp:23
Differential motion (twist) in SE(2) space.
Definition Twist.hpp:16
Curvature curvatureToPoint(const Pose &pose, const Point &point) noexcept
Signed curvature needed to reach a point from a pose assuming an instantaneous circular arc.
au::QuantityD< au::Inverse< au::Meters > > Curvature
Definition Units.hpp:11
au::QuantityD< au::Radians > Angle
Definition Units.hpp:13
au::QuantityD< au::Meters > Length
Definition Units.hpp:9
Definition DriverControl.hpp:11