2023-02-13 17:21:24 -06:00
|
|
|
package swervelib.encoders;
|
2023-02-13 14:37:05 -06:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Swerve abstraction class to define a standard interface with absolute encoders for swerve modules..
|
|
|
|
|
*/
|
|
|
|
|
public abstract class SwerveAbsoluteEncoder
|
|
|
|
|
{
|
|
|
|
|
|
2023-02-20 20:59:31 -06:00
|
|
|
/**
|
|
|
|
|
* Last angle reading was faulty.
|
|
|
|
|
*/
|
|
|
|
|
public boolean readingError = false;
|
|
|
|
|
|
2023-02-13 14:37:05 -06:00
|
|
|
/**
|
|
|
|
|
* Reset the encoder to factory defaults.
|
|
|
|
|
*/
|
|
|
|
|
public abstract void factoryDefault();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Clear sticky faults on the encoder.
|
|
|
|
|
*/
|
|
|
|
|
public abstract void clearStickyFaults();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Configure the absolute encoder to read from [0, 360) per second.
|
|
|
|
|
*
|
|
|
|
|
* @param inverted Whether the encoder is inverted.
|
|
|
|
|
*/
|
|
|
|
|
public abstract void configure(boolean inverted);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the absolute position of the encoder.
|
|
|
|
|
*
|
|
|
|
|
* @return Absolute position in degrees from [0, 360).
|
|
|
|
|
*/
|
|
|
|
|
public abstract double getAbsolutePosition();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the instantiated absolute encoder Object.
|
|
|
|
|
*
|
|
|
|
|
* @return Absolute encoder object.
|
|
|
|
|
*/
|
|
|
|
|
public abstract Object getAbsoluteEncoder();
|
|
|
|
|
}
|