[wpilib] Added docs clarification on units for drive class WheelSpeeds (NFC) (#3939)

This commit is contained in:
shueja-personal
2022-01-21 15:51:28 -08:00
committed by GitHub
parent 830c0c5c2f
commit 4ccfe1c9f2
6 changed files with 49 additions and 14 deletions

View File

@@ -94,6 +94,11 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
private boolean m_reported;
/**
* Wheel speeds for a differential drive.
*
* <p>Uses normalized voltage [-1.0..1.0].
*/
@SuppressWarnings("MemberName")
public static class WheelSpeeds {
public double left;
@@ -105,8 +110,8 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
/**
* Constructs a WheelSpeeds.
*
* @param left The left speed.
* @param right The right speed.
* @param left The left speed [-1.0..1.0].
* @param right The right speed [-1.0..1.0].
*/
public WheelSpeeds(double left, double right) {
this.left = left;
@@ -256,7 +261,7 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
* positive.
* @param squareInputs If set, decreases the input sensitivity at low speeds.
* @return Wheel speeds.
* @return Wheel speeds [-1.0..1.0].
*/
@SuppressWarnings("ParameterName")
public static WheelSpeeds arcadeDriveIK(double xSpeed, double zRotation, boolean squareInputs) {
@@ -315,7 +320,7 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
* @param zRotation The normalized curvature [-1.0..1.0]. Clockwise is positive.
* @param allowTurnInPlace If set, overrides constant-curvature turning for turn-in-place
* maneuvers. zRotation will control rotation rate around the Z axis instead of curvature.
* @return Wheel speeds.
* @return Wheel speeds [-1.0..1.0].
*/
@SuppressWarnings("ParameterName")
public static WheelSpeeds curvatureDriveIK(
@@ -351,7 +356,7 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
* @param rightSpeed The robot right side's speed along the X axis [-1.0..1.0]. Forward is
* positive.
* @param squareInputs If set, decreases the input sensitivity at low speeds.
* @return Wheel speeds.
* @return Wheel speeds [-1.0..1.0].
*/
public static WheelSpeeds tankDriveIK(double leftSpeed, double rightSpeed, boolean squareInputs) {
leftSpeed = MathUtil.clamp(leftSpeed, -1.0, 1.0);

View File

@@ -58,6 +58,11 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
private boolean m_reported;
/**
* Wheel speeds for a Killough drive.
*
* <p>Uses normalized voltage [-1.0..1.0].
*/
@SuppressWarnings("MemberName")
public static class WheelSpeeds {
public double left;
@@ -70,9 +75,9 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
/**
* Constructs a WheelSpeeds.
*
* @param left The left speed.
* @param right The right speed.
* @param back The back speed.
* @param left The left speed [-1.0..1.0].
* @param right The right speed [-1.0..1.0].
* @param back The back speed [-1.0..1.0].
*/
public WheelSpeeds(double left, double right, double back) {
this.left = left;
@@ -240,7 +245,7 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
* positive.
* @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use this
* to implement field-oriented controls.
* @return Wheel speeds.
* @return Wheel speeds [-1.0..1.0].
*/
@SuppressWarnings("ParameterName")
public WheelSpeeds driveCartesianIK(

View File

@@ -66,6 +66,11 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
private boolean m_reported;
/**
* Wheel speeds for a mecanum drive.
*
* <p>Uses normalized voltage [-1.0..1.0].
*/
@SuppressWarnings("MemberName")
public static class WheelSpeeds {
public double frontLeft;
@@ -79,10 +84,10 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
/**
* Constructs a WheelSpeeds.
*
* @param frontLeft The front left speed.
* @param frontRight The front right speed.
* @param rearLeft The rear left speed.
* @param rearRight The rear right speed.
* @param frontLeft The front left speed [-1.0..1.0].
* @param frontRight The front right speed [-1.0..1.0].
* @param rearLeft The rear left speed [-1.0..1.0].
* @param rearRight The rear right speed [-1.0..1.0].
*/
public WheelSpeeds(double frontLeft, double frontRight, double rearLeft, double rearRight) {
this.frontLeft = frontLeft;
@@ -216,7 +221,7 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
* positive.
* @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use this
* to implement field-oriented controls.
* @return Wheel speeds.
* @return Wheel speeds [-1.0..1.0].
*/
@SuppressWarnings("ParameterName")
public static WheelSpeeds driveCartesianIK(