Skip to content

Commit 4e0d785

Browse files
authored
[wpimath] ChassisSpeeds: document that values aren't relative to the robot (NFC) (wpilibsuite#5551)
1 parent 3c04580 commit 4e0d785

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

wpimath/src/main/java/edu/wpi/first/math/kinematics/ChassisSpeeds.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@
88
import edu.wpi.first.math.geometry.Rotation2d;
99

1010
/**
11-
* Represents the speed of a robot chassis. Although this struct contains similar members compared
12-
* to a Twist2d, they do NOT represent the same thing. Whereas a Twist2d represents a change in pose
13-
* w.r.t to the robot frame of reference, this ChassisSpeeds struct represents a velocity w.r.t to
14-
* the robot frame of reference.
11+
* Represents the speed of a robot chassis. Although this class contains similar members compared to
12+
* a Twist2d, they do NOT represent the same thing. Whereas a Twist2d represents a change in pose
13+
* w.r.t to the robot frame of reference, a ChassisSpeeds object represents a robot's velocity.
1514
*
1615
* <p>A strictly non-holonomic drivetrain, such as a differential drive, should never have a dy
1716
* component because it can never move sideways. Holonomic drivetrains such as swerve and mecanum
1817
* will often have all three components.
1918
*/
2019
public class ChassisSpeeds {
21-
/** Represents forward velocity w.r.t the robot frame of reference. (Fwd is +) */
20+
/** Velocity along the x-axis. (Fwd is +) */
2221
public double vxMetersPerSecond;
2322

24-
/** Represents sideways velocity w.r.t the robot frame of reference. (Left is +) */
23+
/** Velocity along the y-axis. (Left is +) */
2524
public double vyMetersPerSecond;
2625

2726
/** Represents the angular velocity of the robot frame. (CCW is +) */

wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,20 @@ namespace frc {
1616
* Represents the speed of a robot chassis. Although this struct contains
1717
* similar members compared to a Twist2d, they do NOT represent the same thing.
1818
* Whereas a Twist2d represents a change in pose w.r.t to the robot frame of
19-
* reference, this ChassisSpeeds struct represents a velocity w.r.t to the robot
20-
* frame of reference.
19+
* reference, a ChassisSpeeds struct represents a robot's velocity.
2120
*
2221
* A strictly non-holonomic drivetrain, such as a differential drive, should
2322
* never have a dy component because it can never move sideways. Holonomic
2423
* drivetrains such as swerve and mecanum will often have all three components.
2524
*/
2625
struct WPILIB_DLLEXPORT ChassisSpeeds {
2726
/**
28-
* Represents forward velocity w.r.t the robot frame of reference. (Fwd is +)
27+
* Velocity along the x-axis. (Fwd is +)
2928
*/
3029
units::meters_per_second_t vx = 0_mps;
3130

3231
/**
33-
* Represents strafe velocity w.r.t the robot frame of reference. (Left is +)
32+
* Velocity along the y-axis. (Left is +)
3433
*/
3534
units::meters_per_second_t vy = 0_mps;
3635

0 commit comments

Comments
 (0)