Class representing a pose in 2d space with x, y, and rotational components
Assumes conventional cartesian coordinate system: Looking down at the coordinate plane, +X is right +Y is up +Theta is counterclockwise
|
|
constexpr | Pose2d () |
| | Default Constructor for Pose2d.
|
| constexpr | Pose2d (Translation2d translation, Rotation2d rotation) |
| constexpr | Pose2d (units::Length x, units::Length y, Rotation2d rotation) |
| constexpr | Pose2d (units::Length x, units::Length y, double radians) |
| constexpr | Pose2d (const Eigen::Vector3d &pose_vector, units::Length length_unit, units::Angle angle_unit=units::radians) |
|
constexpr units::Length | x () const |
| | Gets the x value of the translation.
|
|
constexpr double | x (units::Length unit) const |
| | Gets x in the supplied length unit.
|
|
constexpr void | set_x (units::Length val) |
| | Sets the x value of the translation.
|
|
constexpr units::Length | y () const |
| | Gets the y value of the translation.
|
|
constexpr double | y (units::Length unit) const |
| | Gets y in the supplied length unit.
|
|
constexpr void | set_y (units::Length val) |
| | Sets the y value of the translation.
|
|
constexpr Translation2d | translation () const |
| | Gets the translation.
|
|
constexpr void | set_translation (Translation2d val) |
| | Sets the translation.
|
|
constexpr Rotation2d | rotation () const |
| | Gets the rotation.
|
|
constexpr void | set_rotation (Rotation2d val) |
| | Sets the rotation.
|
|
constexpr units::Angle | angle () const |
| | Gets the heading as an angle.
|
|
constexpr double | angle (units::Angle unit) const |
| | Gets the angle in the supplied unit.
|
|
constexpr void | set_angle (units::Angle val) |
| | Sets the rotation as an angle.
|
|
EVec< 3 > | as_vector (units::Length length_unit, units::Angle angle_unit=units::radians) const |
| | Gets [x, y, theta] in the supplied units. Angles default to radians.
|
|
constexpr units::Length | distance (Translation2d point) const |
| | Calculates the distance from the pose to another point.
|
|
constexpr units::Length | distance (const Pose2d &other) const |
| | Calculates the distance from this to another pose, ignoring rotation.
|
|
constexpr Rotation2d | bearing_to (Translation2d point) const |
| | Calculates the bearing from this to another point in the world frame.
|
|
constexpr units::Angle | angle_to (Translation2d point) const |
| | Calculates the smallest angle to another point in the local frame.
|
|
constexpr Translation2d | local_to_world (Translation2d point) const |
| | Converts a point from this pose's local frame to the world frame.
|
|
constexpr Translation2d | world_to_local (Translation2d point) const |
| | Converts a point from the world frame to this pose's local frame.
|
| constexpr Pose2d | relative_to (const Pose2d &other) const |
| constexpr Pose2d | transform_by (const Transform2d &transform) const |
| constexpr Pose2d | interpolate (const Pose2d &end, double fraction) const |
| constexpr Pose2d | exp (const Twist2d &twist) const |
| constexpr Twist2d | log (const Transform2d &transform) const |
|
constexpr Pose2d | operator+ (const Transform2d &transform) const |
| | Adds a transform to this pose by rotating it into the pose frame then adding.
|
|
constexpr Pose2d & | operator+= (const Transform2d &transform) |
| | Adds a transform to this pose by rotating it into the pose frame then adding.
|
|
constexpr Transform2d | operator- (const Pose2d &other) const |
| | Subtracts another pose from this to find the transform between them.
|
|
constexpr bool | operator== (const Pose2d &other) const |
| | Checks exact equality between this and another pose.
|
| constexpr bool | is_near (const Pose2d &other, units::Length distance_tolerance=units::Length(1e-6), units::Angle angle_tolerance=units::Angle(1e-6)) const |
Applies a twist (pose delta) to a pose by integrating constant velocity and angular velocity in the robot's frame of motion.
When applying a twist, imagine a constant angular velocity, the translational components must be rotated into the global frame at every point along the twist, simply adding the deltas does not do this, and using euler integration results in some error. This is the analytic solution for integrating along an arc.
Can also be thought of more simply as following an arc rather than a straight line.
See this document for more information on the pose exponential and its derivation. https://file.tavsys.net/control/controls-engineering-in-frc.pdf#section.10.2
- Parameters
-
| twist | The twist, represents a pose delta. |
- Returns
- new pose that has been moved forward according to the twist.