Package lib.custom.sensors
Interface CustomEncoder
- All Superinterfaces:
NativeDerivativeSensor
- All Known Implementing Classes:
CANEncoder,CustomDigitalEncoder,EncoderPair
This is an extremely minimal encoder that can be either a normal encoder or a
CAN encoder.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanGets direction of most recent movementbooleanGets direction of most recent movementdoubleGets current distancedoubleGets the distance per pulsedoubleGets current distancebooleanGets inversion statebooleanReturns true when stoppedbooleanReturns true when stoppedvoidreset()Resets the encodervoidsetDistancePerPulse(double distancePerPulse) Sets the distance per pulsevoidsetReverseDirection(boolean reverseDirection) To the surprise of everyone, enables and disables reverse directionMethods inherited from interface lib.custom.sensors.NativeDerivativeSensor
getRate, getRateSafely
-
Method Details
-
getDistance
double getDistance()Gets current distancedoes not indicate sensor errors
-
getDistanceSafely
Gets current distance- Throws:
InvalidSensorException
-
getDirection
boolean getDirection()Gets direction of most recent movementdoes not indicate sensor errors
-
getDirectionSafely
Gets direction of most recent movement- Throws:
InvalidSensorException
-
getStopped
boolean getStopped()Returns true when stoppeddoes not indicate sensor errors
-
getStoppedSafely
Returns true when stopped- Throws:
InvalidSensorException
-
getDistancePerPulse
double getDistancePerPulse()Gets the distance per pulse -
setDistancePerPulse
void setDistancePerPulse(double distancePerPulse) Sets the distance per pulse -
getReverseDirection
boolean getReverseDirection()Gets inversion state -
setReverseDirection
void setReverseDirection(boolean reverseDirection) To the surprise of everyone, enables and disables reverse direction -
reset
void reset()Resets the encoder
-