Valkyrie 2026
Loading...
Searching...
No Matches
valor::geometry::Pose2d Class Reference

Represents a 2D pose as a 3x3 homogeneous transformation matrix. More...

#include <valkyrie/util/geometry/Pose.h>

Inheritance diagram for valor::geometry::Pose2d:
valor::EigenUnit::NamedPhysicalMatrix< Pose2d, EigenUnit::PhysicalMatrix< HomogeneousVector2d, HomogeneousVector2d > > valor::EigenUnit::UnitMatrix< typename VecOut::UnitTuple, typename VecIn::UnitTuple >

Public Types

using Twist2d = EigenUnit::UnitVector<units::meter, units::meter, units::radian>

Public Member Functions

 Pose2d (const BaseMatrix &b)
 Pose2d (Translation2d trans, Rotation2d rot)
 Construct a Pose2d from a translation and rotation.
 Pose2d (frc::Translation2d frcTrans, frc::Rotation2d frcRot)
 Construct a Pose2d from an frc::Translation2d and frc::Rotation2d.
 Pose2d (frc::Pose2d frcPose)
 Construct a Pose2d from an frc::Pose2d.
 Pose2d (frc::Pose3d frcPose)
 Construct a Pose2d from an frc::Pose3d by projecting onto the X-Y plane. Z, pitch, and roll are discarded; only X, Y, and yaw are preserved.
 Pose2d (const Pose3d &pose)
 Construct a Pose2d from a Pose3d projected onto the X-Y plane.
Translation2d Translation () const
Rotation2d Rotation () const
units::meter_t X () const
units::meter_t Y () const
Pose2d TransformBy (const Transform2d &transform) const
 Apply a Transform2d in this pose's frame.
Pose2d RelativeTo (const Pose2d &other) const
 Express this pose relative to another pose.
Pose2d RotateBy (const Rotation2d &rot) const
 Rotate this pose around the global origin.
Pose2d RotateAround (const Translation2d &point, const Rotation2d &rot) const
 Rotate this pose around an arbitrary point.
Pose2d Nearest (std::initializer_list< Pose2d > poses) const
 Find the nearest pose from a collection.
Pose2d operator+ (const Transform2d &transform) const
 operator+ applies a Transform2d.
Transform2d operator- (const Pose2d &other) const
 operator- returns the Transform2d mapping other -> this.
Pose2d operator* (double scalar) const
 Scalar multiplication of both translation and rotation.
Pose2d operator/ (double scalar) const
 Scalar division.
Twist2d Log () const
 Logarithm map: SE(2) -> se(2).
Public Member Functions inherited from valor::EigenUnit::NamedPhysicalMatrix< Pose2d, EigenUnit::PhysicalMatrix< HomogeneousVector2d, HomogeneousVector2d > >
 NamedPhysicalMatrix (const EigenUnit::PhysicalMatrix< HomogeneousVector2d, HomogeneousVector2d > &base)
Pose2d Inverse () const
auto Block () const

Static Public Member Functions

static Pose2d Exp (Twist2d twist)
 Exponential map: se(2) -> SE(2).

Detailed Description

Represents a 2D pose as a 3x3 homogeneous transformation matrix.

Constructor & Destructor Documentation

◆ Pose2d() [1/5]

valor::geometry::Pose2d::Pose2d ( Translation2d trans,
Rotation2d rot )
inline

Construct a Pose2d from a translation and rotation.

Creates a matrix of the form: [ R R T ] [ R R T ] [ 0 0 1 ]

◆ Pose2d() [2/5]

valor::geometry::Pose2d::Pose2d ( frc::Translation2d frcTrans,
frc::Rotation2d frcRot )
inlineexplicit

Construct a Pose2d from an frc::Translation2d and frc::Rotation2d.

Parameters
frcTransThe frc translation component.
frcRotThe frc rotation component.

◆ Pose2d() [3/5]

valor::geometry::Pose2d::Pose2d ( frc::Pose2d frcPose)
inlineexplicit

Construct a Pose2d from an frc::Pose2d.

Parameters
frcPoseThe frc pose to convert.

◆ Pose2d() [4/5]

valor::geometry::Pose2d::Pose2d ( frc::Pose3d frcPose)
inlineexplicit

Construct a Pose2d from an frc::Pose3d by projecting onto the X-Y plane. Z, pitch, and roll are discarded; only X, Y, and yaw are preserved.

Parameters
frcPoseThe frc 3D pose to project.

◆ Pose2d() [5/5]

valor::geometry::Pose2d::Pose2d ( const Pose3d & pose)
inlineexplicit

Construct a Pose2d from a Pose3d projected onto the X-Y plane.

Parameters
poseThe 3D pose.

Member Function Documentation

◆ Nearest()

Pose2d valor::geometry::Pose2d::Nearest ( std::initializer_list< Pose2d > poses) const
inline

Find the nearest pose from a collection.

Parameters
posesCollection of candidate poses.
Returns
The nearest pose by translation distance.

◆ RelativeTo()

Pose2d valor::geometry::Pose2d::RelativeTo ( const Pose2d & other) const
inline

Express this pose relative to another pose.

Parameters
otherThe reference pose.
Returns
This pose in the other's frame.

◆ RotateAround()

Pose2d valor::geometry::Pose2d::RotateAround ( const Translation2d & point,
const Rotation2d & rot ) const
inline

Rotate this pose around an arbitrary point.

Parameters
pointThe pivot point.
rotThe rotation to apply.
Returns
The rotated pose.

◆ RotateBy()

Pose2d valor::geometry::Pose2d::RotateBy ( const Rotation2d & rot) const
inline

Rotate this pose around the global origin.

Parameters
rotThe rotation to apply globally.
Returns
The rotated pose.

◆ TransformBy()

Pose2d valor::geometry::Pose2d::TransformBy ( const Transform2d & transform) const
inline

Apply a Transform2d in this pose's frame.

Parameters
transformThe transform to apply.
Returns
The new pose.

The documentation for this class was generated from the following file:
  • src/main/include/valkyrie/util/geometry/Pose.h