public final class LimitedController extends java.lang.Object implements SpeedController, MotorSafety
| Modifier and Type | Field and Description |
|---|---|
private SpeedController |
m_motor
The m_motor.
|
private MotorSafetyHelper |
m_safetyHelper |
private LimitSystem |
m_system
The m_switch system.
|
SAFETY_TIMEOUT_DEFAULT, SAFETY_TIMEOUT_LOOSE, SAFETY_TIMEOUT_STRICT| Constructor and Description |
|---|
LimitedController(SpeedController motor,
LimitSystem system)
Instantiates a new limit switch controller.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
atBackLimit()
At near limit
|
boolean |
atFrontLimit()
At far limit.
|
boolean |
atLimit()
At a limit.
|
java.lang.String |
getDescription()
Gets the description.
|
MotorSafetyHelper |
getSafetyHelper()
Return the MotorSafetyHelper object for this MotorSafety Object
|
double |
getSpeed()
Common interface for getting the current set speed of a speed
controller.
|
void |
setInverted(boolean inverted)
Set the inverted state of the speed controller.
|
void |
setSpeed(double speed)
Set the speed of the SpeedController
|
void |
stopMotor()
Stop/Disable the motor.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpidWrite, setfeed, getSafetyExpiration, isAlive, isSafetyEnabled, setSafetyEnabled, setSafetyExpirationprivate final SpeedController m_motor
private final LimitSystem m_system
private final MotorSafetyHelper m_safetyHelper
public LimitedController(SpeedController motor, LimitSystem system)
motor - the motorsystem - the switch systempublic double getSpeed()
getSpeed in interface SpeedSourcegetSpeed in interface SpeedControllerpublic void setSpeed(double speed)
setSpeed in interface SpeedSinksetSpeed in interface SpeedControllerspeed - the speed to setpublic void setInverted(boolean inverted)
setInverted in interface SpeedControllerinverted - true to invert the values sent to the motor.public boolean atLimit()
public boolean atFrontLimit()
public boolean atBackLimit()
public MotorSafetyHelper getSafetyHelper()
getSafetyHelper in interface MotorSafetypublic void stopMotor()
stopMotor in interface SpeedControllerstopMotor in interface MotorSafetypublic java.lang.String getDescription()
getDescription in interface MotorSafety