public abstract class RobotDriveBase extends java.lang.Object implements MotorSafety
| Modifier and Type | Class and Description |
|---|---|
static class |
RobotDriveBase.MotorType
The location of a motor on the robot for the purpose of driving.
|
| Modifier and Type | Field and Description |
|---|---|
protected double |
m_deadband |
protected double |
m_maxOutput |
protected MotorSafetyHelper |
m_safetyHelper |
DEFAULT_SAFETY_EXPIRATION| Constructor and Description |
|---|
RobotDriveBase() |
| Modifier and Type | Method and Description |
|---|---|
protected double |
applyDeadband(double value,
double deadband)
Returns 0.0 if the given value is within the specified range around zero.
|
abstract java.lang.String |
getDescription() |
double |
getExpiration() |
boolean |
isAlive() |
boolean |
isSafetyEnabled() |
protected double |
limit(double value)
Limit motor values to the -1.0 to +1.0 range.
|
protected void |
normalize(double[] wheelSpeeds)
Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.
|
void |
setDeadband(double deadband) |
void |
setExpiration(double timeout) |
void |
setMaxOutput(double maxOutput)
Configure the scaling factor for using RobotDrive with motor controllers in a mode other than
PercentVbus.
|
void |
setSafetyEnabled(boolean enabled) |
abstract void |
stopMotor() |
protected double m_deadband
protected double m_maxOutput
protected MotorSafetyHelper m_safetyHelper
public void setDeadband(double deadband)
public void setMaxOutput(double maxOutput)
maxOutput - Multiplied with the output percentage computed by the drive functions.public void setExpiration(double timeout)
setExpiration in interface MotorSafetypublic double getExpiration()
getExpiration in interface MotorSafetypublic boolean isAlive()
isAlive in interface MotorSafetypublic abstract void stopMotor()
stopMotor in interface MotorSafetypublic boolean isSafetyEnabled()
isSafetyEnabled in interface MotorSafetypublic void setSafetyEnabled(boolean enabled)
setSafetyEnabled in interface MotorSafetypublic abstract java.lang.String getDescription()
getDescription in interface MotorSafetyprotected double limit(double value)
protected double applyDeadband(double value,
double deadband)
value - value to clipdeadband - range around zeroprotected void normalize(double[] wheelSpeeds)