Package com.ctre.phoenix6.hardware
Class CANcoder
java.lang.Object
com.ctre.phoenix6.jni.CtreJniWrapper
com.ctre.phoenix6.hardware.ParentDevice
com.ctre.phoenix6.hardware.core.CoreCANcoder
com.ctre.phoenix6.hardware.CANcoder
- All Implemented Interfaces:
Sendable
,AutoCloseable
public class CANcoder extends CoreCANcoder implements Sendable, AutoCloseable
WPILib-integrated version of
CoreCANcoder
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ctre.phoenix6.hardware.ParentDevice
ParentDevice.MapGenerator<T>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
close()
void
initSendable(SendableBuilder builder)
Methods inherited from class com.ctre.phoenix6.hardware.core.CoreCANcoder
clearStickyFault_BadMagnet, clearStickyFault_BadMagnet, clearStickyFault_BootDuringEnable, clearStickyFault_BootDuringEnable, clearStickyFault_Hardware, clearStickyFault_Hardware, clearStickyFault_Undervoltage, clearStickyFault_Undervoltage, clearStickyFaults, clearStickyFaults, getAbsolutePosition, getConfigurator, getFault_BadMagnet, getFault_BootDuringEnable, getFault_Hardware, getFault_Undervoltage, getFault_UnlicensedFeatureInUse, getFaultField, getIsProLicensed, getMagnetHealth, getPosition, getPositionSinceBoot, getSimState, getStickyFault_BadMagnet, getStickyFault_BootDuringEnable, getStickyFault_Hardware, getStickyFault_Undervoltage, getStickyFault_UnlicensedFeatureInUse, getStickyFaultField, getSupplyVoltage, getUnfilteredVelocity, getVelocity, getVersion, getVersionBugfix, getVersionBuild, getVersionMajor, getVersionMinor, setControl, setPosition, setPosition
Methods inherited from class com.ctre.phoenix6.hardware.ParentDevice
getAppliedControl, getDeviceHash, getDeviceID, getNetwork, getResetOccurredChecker, hasResetOccurred, lookupStatusSignal, lookupStatusSignal, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilizationForAll, optimizeBusUtilizationForAll, setControlPrivate
-
Constructor Details
-
CANcoder
Constructs a new CANcoder object.Constructs the device using the default CAN bus for the system:
- "rio" on roboRIO
- "can0" on Linux
- "*" on Windows
- Parameters:
deviceId
- ID of the device, as configured in Phoenix Tuner.
-
CANcoder
Constructs a new CANcoder object.- Parameters:
deviceId
- ID of the device, as configured in Phoenix Tuner.canbus
- Name of the CAN bus this device is on. Possible CAN bus strings are:- "rio" for the native roboRIO CAN bus
- CANivore name or serial number
- SocketCAN interface (non-FRC Linux only)
- "*" for any CANivore seen by the program
- empty string (default) to select the default for the
system:
- "rio" on roboRIO
- "can0" on Linux
- "*" on Windows
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
initSendable
- Specified by:
initSendable
in interfaceSendable
-