Updated Javadocs, added ability to push offset to absolute encoders.

This commit is contained in:
thenetworkgrinch
2023-12-12 10:48:54 -06:00
parent aef91407ea
commit f03926627d
123 changed files with 685 additions and 283 deletions

View File

@@ -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.
*