Package edu.wpi.first.wpilibj.drive
Class RobotDriveBase
java.lang.Object
edu.wpi.first.wpilibj.MotorSafety
edu.wpi.first.wpilibj.drive.RobotDriveBase
- Direct Known Subclasses:
DifferentialDrive,MecanumDrive
Common base class for drive platforms.
MotorSafety is enabled by default.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe location of a motor on the robot for the purpose of driving. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault input deadband.static final doubleDefault maximum output.protected doubleInput deadband.protected doubleMaximum output. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidFeed the motor safety object.abstract StringReturns a description to print when an error occurs.protected static voidnormalize(double[] wheelSpeeds) Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.voidsetDeadband(double deadband) Sets the deadband applied to the drive inputs (e.g., joystick values).voidsetMaxOutput(double maxOutput) Configure the scaling factor for using drive methods with motor controllers in a mode other than PercentVbus or to limit the maximum output.abstract voidCalled to stop the motor when the timeout expires.Methods inherited from class edu.wpi.first.wpilibj.MotorSafety
check, checkMotors, feed, getExpiration, isAlive, isSafetyEnabled, setExpiration, setSafetyEnabled
-
Field Details
-
kDefaultDeadband
Default input deadband.- See Also:
-
kDefaultMaxOutput
Default maximum output.- See Also:
-
m_deadband
Input deadband. -
m_maxOutput
Maximum output.
-
-
Constructor Details
-
RobotDriveBase
public RobotDriveBase()RobotDriveBase constructor.
-
-
Method Details
-
setDeadband
Sets the deadband applied to the drive inputs (e.g., joystick values).The default value is 0.02. Inputs smaller than the deadband are set to 0.0 while inputs larger than the deadband are scaled from 0.0 to 1.0. See
MathUtil.applyDeadband(double, double, double).- Parameters:
deadband- The deadband to set.
-
setMaxOutput
Configure the scaling factor for using drive methods with motor controllers in a mode other than PercentVbus or to limit the maximum output.The default value is 1.0.
- Parameters:
maxOutput- Multiplied with the output percentage computed by the drive functions.
-
feedWatchdog
Feed the motor safety object. Resets the timer that will stop the motors if it completes.- See Also:
-
stopMotor
Description copied from class:MotorSafetyCalled to stop the motor when the timeout expires.- Specified by:
stopMotorin classMotorSafety
-
getDescription
Description copied from class:MotorSafetyReturns a description to print when an error occurs.- Specified by:
getDescriptionin classMotorSafety- Returns:
- Description to print when an error occurs.
-
normalize
Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.- Parameters:
wheelSpeeds- List of wheel speeds to normalize.
-