Represents a transformation for a Pose2d in the pose's frame.
More...
#include <frc/geometry/Transform2d.h>
|
| constexpr | Transform2d (const Pose2d &initial, const Pose2d &final) |
| | Constructs the transform that maps the initial pose to the final pose.
|
| |
| constexpr | Transform2d (Translation2d translation, Rotation2d rotation) |
| | Constructs a transform with the given translation and rotation components.
|
| |
| constexpr | Transform2d (units::meter_t x, units::meter_t y, Rotation2d rotation) |
| | Constructs a transform with x and y translations instead of a separate Translation2d.
|
| |
| constexpr | Transform2d (const Eigen::Matrix3d &matrix) |
| | Constructs a pose with the specified affine transformation matrix.
|
| |
| constexpr | Transform2d ()=default |
| | Constructs the identity transform – maps an initial pose to itself.
|
| |
| constexpr const Translation2d & | Translation () const |
| | Returns the translation component of the transformation.
|
| |
| constexpr units::meter_t | X () const |
| | Returns the X component of the transformation's translation.
|
| |
| constexpr units::meter_t | Y () const |
| | Returns the Y component of the transformation's translation.
|
| |
| constexpr Eigen::Matrix3d | ToMatrix () const |
| | Returns an affine transformation matrix representation of this transformation.
|
| |
| constexpr const Rotation2d & | Rotation () const |
| | Returns the rotational component of the transformation.
|
| |
| constexpr Transform2d | Inverse () const |
| | Invert the transformation.
|
| |
| constexpr Transform2d | operator* (double scalar) const |
| | Multiplies the transform by the scalar.
|
| |
| constexpr Transform2d | operator/ (double scalar) const |
| | Divides the transform by the scalar.
|
| |
| constexpr Transform2d | operator+ (const Transform2d &other) const |
| | Composes two transformations.
|
| |
| constexpr bool | operator== (const Transform2d &) const =default |
| | Checks equality between this Transform2d and another object.
|
| |
Represents a transformation for a Pose2d in the pose's frame.
◆ Transform2d() [1/5]
| frc::Transform2d::Transform2d |
( |
const Pose2d & | initial, |
|
|
const Pose2d & | final ) |
|
constexpr |
Constructs the transform that maps the initial pose to the final pose.
- Parameters
-
| initial | The initial pose for the transformation. |
| final | The final pose for the transformation. |
◆ Transform2d() [2/5]
Constructs a transform with the given translation and rotation components.
- Parameters
-
| translation | Translational component of the transform. |
| rotation | Rotational component of the transform. |
◆ Transform2d() [3/5]
| frc::Transform2d::Transform2d |
( |
units::meter_t | x, |
|
|
units::meter_t | y, |
|
|
Rotation2d | rotation ) |
|
inlineconstexpr |
Constructs a transform with x and y translations instead of a separate Translation2d.
- Parameters
-
| x | The x component of the translational component of the transform. |
| y | The y component of the translational component of the transform. |
| rotation | The rotational component of the transform. |
◆ Transform2d() [4/5]
| frc::Transform2d::Transform2d |
( |
const Eigen::Matrix3d & | matrix | ) |
|
|
inlineexplicitconstexpr |
Constructs a pose with the specified affine transformation matrix.
- Parameters
-
| matrix | The affine transformation matrix. |
- Throws:
- std::domain_error if the affine transformation matrix is invalid.
◆ Transform2d() [5/5]
| frc::Transform2d::Transform2d |
( |
| ) |
|
|
constexprdefault |
Constructs the identity transform – maps an initial pose to itself.
◆ Inverse()
Invert the transformation.
This is useful for undoing a transformation.
- Returns
- The inverted transformation.
◆ operator*()
| Transform2d frc::Transform2d::operator* |
( |
double | scalar | ) |
const |
|
inlineconstexpr |
Multiplies the transform by the scalar.
- Parameters
-
- Returns
- The scaled Transform2d.
◆ operator+()
Composes two transformations.
The second transform is applied relative to the orientation of the first.
- Parameters
-
| other | The transform to compose with this one. |
- Returns
- The composition of the two transformations.
◆ operator/()
| Transform2d frc::Transform2d::operator/ |
( |
double | scalar | ) |
const |
|
inlineconstexpr |
Divides the transform by the scalar.
- Parameters
-
- Returns
- The scaled Transform2d.
◆ operator==()
| bool frc::Transform2d::operator== |
( |
const Transform2d & | | ) |
const |
|
constexprdefault |
Checks equality between this Transform2d and another object.
◆ Rotation()
| const Rotation2d & frc::Transform2d::Rotation |
( |
| ) |
const |
|
inlineconstexpr |
Returns the rotational component of the transformation.
- Returns
- Reference to the rotational component of the transform.
◆ ToMatrix()
| Eigen::Matrix3d frc::Transform2d::ToMatrix |
( |
| ) |
const |
|
inlineconstexpr |
Returns an affine transformation matrix representation of this transformation.
◆ Translation()
Returns the translation component of the transformation.
- Returns
- Reference to the translational component of the transform.
◆ X()
| units::meter_t frc::Transform2d::X |
( |
| ) |
const |
|
inlineconstexpr |
Returns the X component of the transformation's translation.
- Returns
- The x component of the transformation's translation.
◆ Y()
| units::meter_t frc::Transform2d::Y |
( |
| ) |
const |
|
inlineconstexpr |
Returns the Y component of the transformation's translation.
- Returns
- The y component of the transformation's translation.
The documentation for this class was generated from the following file: