mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilib] Improve MotorSafety documentation (NFC) (#4120)
Remove OBE RobotDrive porting guide from MecanumDrive
This commit is contained in:
@@ -8,8 +8,10 @@ import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* This base class runs a watchdog timer and calls the subclass's StopMotor() function if the
|
||||
* timeout expires.
|
||||
* The Motor Safety feature acts as a watchdog timer for an individual motor. It operates by
|
||||
* maintaining a timer that tracks how long it has been since the feed() method has been called for
|
||||
* that actuator. Code in the Driver Station class initiates a comparison of these timers to the
|
||||
* timeout values for any actuator with safety enabled every 5 received packets (100ms nominal).
|
||||
*
|
||||
* <p>The subclass should call feed() whenever the motor value is updated.
|
||||
*/
|
||||
|
||||
@@ -83,6 +83,9 @@ import edu.wpi.first.wpilibj.SpeedController;
|
||||
* <p>Inputs smaller then {@value edu.wpi.first.wpilibj.drive.RobotDriveBase#kDefaultDeadband} will
|
||||
* be set to 0, and larger values will be scaled so that the full range is still used. This deadband
|
||||
* value can be changed with {@link #setDeadband}.
|
||||
*
|
||||
* <p>{@link edu.wpi.first.wpilibj.MotorSafety} is enabled by default. The tankDrive, arcadeDrive,
|
||||
* or curvatureDrive methods should be called periodically to avoid Motor Safety timeouts.
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoCloseable {
|
||||
|
||||
@@ -39,6 +39,9 @@ import edu.wpi.first.wpilibj.SpeedController;
|
||||
* <p>The positive X axis points ahead, the positive Y axis points right, and the positive Z axis
|
||||
* points down. Rotations follow the right-hand rule, so clockwise rotation around the Z axis is
|
||||
* positive.
|
||||
*
|
||||
* <p>{@link edu.wpi.first.wpilibj.MotorSafety} is enabled by default. The driveCartesian or
|
||||
* drivePolar methods should be called periodically to avoid Motor Safety timeouts.
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
public class KilloughDrive extends RobotDriveBase implements Sendable, AutoCloseable {
|
||||
|
||||
@@ -47,13 +47,8 @@ import edu.wpi.first.wpilibj.SpeedController;
|
||||
* be set to 0, and larger values will be scaled so that the full range is still used. This deadband
|
||||
* value can be changed with {@link #setDeadband}.
|
||||
*
|
||||
* <p>RobotDrive porting guide: <br>
|
||||
* {@link #driveCartesian(double, double, double, double)} is equivalent to RobotDrive's
|
||||
* mecanumDrive_Cartesian(double, double, double, double) if a deadband of 0 is used, and the ySpeed
|
||||
* and gyroAngle values are inverted compared to RobotDrive (eg driveCartesian(xSpeed, -ySpeed,
|
||||
* zRotation, -gyroAngle). <br>
|
||||
* {@link #drivePolar(double, double, double)} is equivalent to RobotDrive's
|
||||
* mecanumDrive_Polar(double, double, double)} if a deadband of 0 is used.
|
||||
* <p>{@link edu.wpi.first.wpilibj.MotorSafety} is enabled by default. The driveCartesian or
|
||||
* drivePolar methods should be called periodically to avoid Motor Safety timeouts.
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
public class MecanumDrive extends RobotDriveBase implements Sendable, AutoCloseable {
|
||||
|
||||
@@ -7,7 +7,11 @@ package edu.wpi.first.wpilibj.drive;
|
||||
import edu.wpi.first.math.MathUtil;
|
||||
import edu.wpi.first.wpilibj.MotorSafety;
|
||||
|
||||
/** Common base class for drive platforms. */
|
||||
/**
|
||||
* Common base class for drive platforms.
|
||||
*
|
||||
* <p>{@link edu.wpi.first.wpilibj.MotorSafety} is enabled by default.
|
||||
*/
|
||||
public abstract class RobotDriveBase extends MotorSafety {
|
||||
public static final double kDefaultDeadband = 0.02;
|
||||
public static final double kDefaultMaxOutput = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user