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

@@ -1,6 +1,7 @@
package swervelib.encoders;
import com.reduxrobotics.sensors.canandcoder.CANandcoder;
import edu.wpi.first.wpilibj.DriverStation;
/**
* HELIUM {@link CANandcoder} from ReduxRobotics absolute encoder, attached through the CAN bus.
@@ -78,6 +79,21 @@ public class CanAndCoderSwerve extends SwerveAbsoluteEncoder
return encoder;
}
/**
* Cannot set the offset of the CanAndCoder.
*
* @param offset the offset the Absolute Encoder uses as the zero point.
* @return always false due to CanAndCoder not supporting offset changing.
*/
@Override
public boolean setAbsoluteEncoderOffset(double offset)
{
//CanAndCoder does not support Absolute Offset Changing
DriverStation.reportWarning("Cannot Set Absolute Encoder Offset of CanAndCoders ID: " + encoder.getAddress(),
false);
return false;
}
/**
* Get the velocity in degrees/sec.
*