Class CancoderWrapper
java.lang.Object
com.team2813.lib2813.vendor.ctre.encoder.CancoderWrapper
- All Implemented Interfaces:
com.team2813.lib2813.control.Encoder
A wrapper for
CANcoder that implements Encoder.
Represents a CAN-based magnetic encoder that provides absolute and relative position along with filtered velocity.
-
Constructor Summary
ConstructorsConstructorDescriptionCancoderWrapper(int deviceId) Creates an instance for a CANcoder on the default CAN bus.CancoderWrapper(int deviceId, CANBus canbus) Creates an instance for a CANcoder on the specified CAN bus.CancoderWrapper(int deviceId, String canbusName) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
-
Constructor Details
-
CancoderWrapper
Creates an instance for a CANcoder on the specified CAN bus.- Parameters:
deviceId- the configured ID of the CANcodercanbus- the CAN bus the device is on
-
CancoderWrapper
Deprecated, for removal: This API element is subject to removal in a future version.ConstructingCancoderWrapperwith a CAN bus string is deprecated for removal in the 2027 season. Construct instances using aCANBusinstance instead.Creates an instance for a CANcoder on the specified CAN bus name.- Parameters:
deviceId- the configured ID of the CANcodercanbusName- the name of the CAN bus the device is on
-
CancoderWrapper
public CancoderWrapper(int deviceId) Creates an instance for a CANcoder on the default CAN bus.- Parameters:
deviceId- the configured ID of the CANcoder
-
-
Method Details
-
getPositionMeasure
- Specified by:
getPositionMeasurein interfacecom.team2813.lib2813.control.Encoder
-
setPosition
- Specified by:
setPositionin interfacecom.team2813.lib2813.control.Encoder
-
encoder
-
getVelocityMeasure
- Specified by:
getVelocityMeasurein interfacecom.team2813.lib2813.control.Encoder
-
equals
-
CancoderWrapperwith a CAN bus string is deprecated for removal in the 2027 season.