mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpimath] Document extrinsic vs intrinsic rotations (NFC) (#5508)
This commit is contained in:
@@ -56,7 +56,9 @@ class WPILIB_DLLEXPORT Pose3d {
|
||||
|
||||
/**
|
||||
* Transforms the pose by the given transformation and returns the new
|
||||
* transformed pose.
|
||||
* transformed pose. The transform is applied relative to the pose's frame.
|
||||
* Note that this differs from Pose3d::RotateBy(const Rotation3d&), which is
|
||||
* applied relative to the global frame and around the origin.
|
||||
*
|
||||
* @param other The transform to transform the pose by.
|
||||
*
|
||||
@@ -133,14 +135,18 @@ class WPILIB_DLLEXPORT Pose3d {
|
||||
/**
|
||||
* Rotates the pose around the origin and returns the new pose.
|
||||
*
|
||||
* @param other The rotation to transform the pose by.
|
||||
* @param other The rotation to transform the pose by, which is applied
|
||||
* extrinsically (from the global frame).
|
||||
*
|
||||
* @return The rotated pose.
|
||||
*/
|
||||
Pose3d RotateBy(const Rotation3d& other) const;
|
||||
|
||||
/**
|
||||
* Transforms the pose by the given transformation and returns the new pose.
|
||||
* Transforms the pose by the given transformation and returns the new
|
||||
* transformed pose. The transform is applied relative to the pose's frame.
|
||||
* Note that this differs from Pose3d::RotateBy(const Rotation3d&), which is
|
||||
* applied relative to the global frame and around the origin.
|
||||
*
|
||||
* @param other The transform to transform the pose by.
|
||||
*
|
||||
|
||||
@@ -138,7 +138,11 @@ class WPILIB_DLLEXPORT Rotation3d {
|
||||
bool operator==(const Rotation3d&) const = default;
|
||||
|
||||
/**
|
||||
* Adds the new rotation to the current rotation.
|
||||
* Adds the new rotation to the current rotation. The other rotation is
|
||||
* applied intrinsically, which means that it rotates around the axes after
|
||||
* applying this rotation. For example, Rotation3d{90_deg, 0, 0}.RotateBy(
|
||||
* Rotation3d{0, 90_deg, 0}) rotates by 90 degrees around the +X axis and then
|
||||
* by 90 degrees around the new +Y axis (which has been moved to the +Z axis).
|
||||
*
|
||||
* @param other The rotation to rotate by.
|
||||
*
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace frc {
|
||||
class WPILIB_DLLEXPORT Pose2d;
|
||||
|
||||
/**
|
||||
* Represents a transformation for a Pose2d.
|
||||
* Represents a transformation for a Pose2d in the pose's frame.
|
||||
*/
|
||||
class WPILIB_DLLEXPORT Transform2d {
|
||||
public:
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace frc {
|
||||
class WPILIB_DLLEXPORT Pose3d;
|
||||
|
||||
/**
|
||||
* Represents a transformation for a Pose3d.
|
||||
* Represents a transformation for a Pose3d in the pose's frame.
|
||||
*/
|
||||
class WPILIB_DLLEXPORT Transform3d {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user