From 4e0d78535685a1f3fd34f55d64aa1c7554aba0b9 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:22:42 -0400 Subject: [PATCH] [wpimath] ChassisSpeeds: document that values aren't relative to the robot (NFC) (#5551) --- .../edu/wpi/first/math/kinematics/ChassisSpeeds.java | 11 +++++------ .../native/include/frc/kinematics/ChassisSpeeds.h | 7 +++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/wpimath/src/main/java/edu/wpi/first/math/kinematics/ChassisSpeeds.java b/wpimath/src/main/java/edu/wpi/first/math/kinematics/ChassisSpeeds.java index 5018d1d7d82..c0370cea0b5 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/kinematics/ChassisSpeeds.java +++ b/wpimath/src/main/java/edu/wpi/first/math/kinematics/ChassisSpeeds.java @@ -8,20 +8,19 @@ import edu.wpi.first.math.geometry.Rotation2d; /** - * Represents the speed of a robot chassis. Although this struct contains similar members compared - * to a Twist2d, they do NOT represent the same thing. Whereas a Twist2d represents a change in pose - * w.r.t to the robot frame of reference, this ChassisSpeeds struct represents a velocity w.r.t to - * the robot frame of reference. + * Represents the speed of a robot chassis. Although this class contains similar members compared to + * a Twist2d, they do NOT represent the same thing. Whereas a Twist2d represents a change in pose + * w.r.t to the robot frame of reference, a ChassisSpeeds object represents a robot's velocity. * *
A strictly non-holonomic drivetrain, such as a differential drive, should never have a dy * component because it can never move sideways. Holonomic drivetrains such as swerve and mecanum * will often have all three components. */ public class ChassisSpeeds { - /** Represents forward velocity w.r.t the robot frame of reference. (Fwd is +) */ + /** Velocity along the x-axis. (Fwd is +) */ public double vxMetersPerSecond; - /** Represents sideways velocity w.r.t the robot frame of reference. (Left is +) */ + /** Velocity along the y-axis. (Left is +) */ public double vyMetersPerSecond; /** Represents the angular velocity of the robot frame. (CCW is +) */ diff --git a/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h b/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h index ab6dd1d042b..b388d5cec85 100644 --- a/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h +++ b/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h @@ -16,8 +16,7 @@ namespace frc { * Represents the speed of a robot chassis. Although this struct contains * similar members compared to a Twist2d, they do NOT represent the same thing. * Whereas a Twist2d represents a change in pose w.r.t to the robot frame of - * reference, this ChassisSpeeds struct represents a velocity w.r.t to the robot - * frame of reference. + * reference, a ChassisSpeeds struct represents a robot's velocity. * * A strictly non-holonomic drivetrain, such as a differential drive, should * never have a dy component because it can never move sideways. Holonomic @@ -25,12 +24,12 @@ namespace frc { */ struct WPILIB_DLLEXPORT ChassisSpeeds { /** - * Represents forward velocity w.r.t the robot frame of reference. (Fwd is +) + * Velocity along the x-axis. (Fwd is +) */ units::meters_per_second_t vx = 0_mps; /** - * Represents strafe velocity w.r.t the robot frame of reference. (Left is +) + * Velocity along the y-axis. (Left is +) */ units::meters_per_second_t vy = 0_mps;