mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
55 lines
1.3 KiB
Java
55 lines
1.3 KiB
Java
package swervelib.encoders;
|
|
|
|
/**
|
|
* Swerve abstraction class to define a standard interface with absolute encoders for swerve modules..
|
|
*/
|
|
public abstract class SwerveAbsoluteEncoder
|
|
{
|
|
|
|
/**
|
|
* The maximum amount of times the swerve encoder will attempt to configure itself if failures occur.
|
|
*/
|
|
public final int maximumRetries = 5;
|
|
/**
|
|
* Last angle reading was faulty.
|
|
*/
|
|
public boolean readingError = false;
|
|
|
|
/**
|
|
* 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();
|
|
|
|
/**
|
|
* Get the velocity in degrees/sec.
|
|
* @return velocity in degrees/sec.
|
|
*/
|
|
public abstract double getVelocity();
|
|
}
|