Package org.team1126.lib.swerve.hardware
Class SwerveEncoders
java.lang.Object
org.team1126.lib.swerve.hardware.SwerveEncoders
Contains implementations for absolute encoders to be used with the
SwerveAPI.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA swerve module's absolute encoder. -
Method Summary
Modifier and TypeMethodDescriptioncanandmag(int id, double offset, boolean inverted) Configures aCanandmag.cancoder(int id, double offset, boolean inverted) Configures aCANcoder.sparkFlexEncoder(double offset, boolean inverted) Configures a Spark Flex attached duty cycle absolute encoder.sparkMaxEncoder(double offset, boolean inverted) Configures a Spark Max attached duty cycle absolute encoder.
-
Method Details
-
sparkMaxEncoder
Configures a Spark Max attached duty cycle absolute encoder.- Parameters:
offset- Offset of the magnet in rotations.inverted- If the encoder is inverted.
-
sparkFlexEncoder
Configures a Spark Flex attached duty cycle absolute encoder.- Parameters:
offset- Offset of the magnet in rotations.inverted- If the encoder is inverted.
-
canandmag
Configures aCanandmag.- Parameters:
id- CAN ID of the device, as configured in Alchemist.offset- Offset of the magnet in rotations.inverted- If the encoder is inverted.
-
cancoder
Configures aCANcoder.- Parameters:
id- CAN ID of the device, as configured in Phoenix Tuner.offset- Offset of the magnet in rotations.inverted- If the encoder is inverted.
-