mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-26 07:01:39 +00:00
Updated Javadocs, added ability to push offset to absolute encoders.
This commit is contained in:
@@ -138,6 +138,25 @@ public class CANCoderSwerve extends SwerveAbsoluteEncoder
|
||||
return encoder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Absolute Encoder Offset inside of the CANcoder's Memory.
|
||||
*
|
||||
* @param offset the offset the Absolute Encoder uses as the zero point.
|
||||
* @return if setting Absolute Encoder Offset was successful or not.
|
||||
*/
|
||||
@Override
|
||||
public boolean setAbsoluteEncoderOffset(double offset)
|
||||
{
|
||||
ErrorCode error = encoder.configMagnetOffset(offset);
|
||||
if (error == ErrorCode.OK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
DriverStation.reportWarning(
|
||||
"Failure to set CANCoder " + encoder.getDeviceID() + " Absolute Encoder Offset Error: " + error, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the velocity in degrees/sec.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user