Package com.ctre.phoenixpro.hardware
Class TalonFX
java.lang.Object
com.ctre.phoenix6.jni.CtreJniWrapper
com.ctre.phoenixpro.hardware.ParentDevice
com.ctre.phoenixpro.hardware.core.CoreTalonFX
com.ctre.phoenixpro.hardware.TalonFX
- All Implemented Interfaces:
Sendable,MotorController,AutoCloseable
@Deprecated(forRemoval=true) public class TalonFX extends CoreTalonFX implements MotorController, Sendable, AutoCloseable
Deprecated, for removal: This API element is subject to removal in a future version.
Classes in the phoenixpro package will be removed in 2024.
Users should instead use classes from the phoenix6 package.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ctre.phoenixpro.hardware.ParentDevice
ParentDevice.MapGenerator<T> -
Field Summary
Fields Modifier and Type Field Description static doublekDefaultSafetyExpirationDeprecated, for removal: This API element is subject to removal in a future version.The default motor safety timeout IF calling application enables the feature.Fields inherited from class com.ctre.phoenixpro.hardware.ParentDevice
deviceIdentifier, kDefaultControlRatePeriodsSec -
Constructor Summary
Constructors Constructor Description TalonFX(int deviceId)Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024.TalonFX(int deviceId, String canbus)Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024. -
Method Summary
Modifier and Type Method Description voidclose()Deprecated, for removal: This API element is subject to removal in a future version.voiddisable()Deprecated, for removal: This API element is subject to removal in a future version.Common interface for disabling a motor controller.voidfeed()Deprecated, for removal: This API element is subject to removal in a future version.Feed the motor safety object.doubleget()Deprecated, for removal: This API element is subject to removal in a future version.Common interface for getting the current set speed of a motor controller.StringgetDescription()Deprecated, for removal: This API element is subject to removal in a future version.doublegetExpiration()Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the timeout value for the corresponding motor safety object.booleangetInverted()Deprecated, for removal: This API element is subject to removal in a future version.Common interface for returning the inversion state of a motor controller.voidinitSendable(SendableBuilder builder)Deprecated, for removal: This API element is subject to removal in a future version.booleanisAlive()Deprecated, for removal: This API element is subject to removal in a future version.Determine of the motor is still operating or has timed out.booleanisSafetyEnabled()Deprecated, for removal: This API element is subject to removal in a future version.Return the state of the motor safety enabled flag.voidset(double speed)Deprecated, for removal: This API element is subject to removal in a future version.Common interface for setting the speed of a motor controller.protected StatusCodesetControlPrivate(ControlRequest request)Deprecated, for removal: This API element is subject to removal in a future version.voidsetExpiration(double expirationTime)Deprecated, for removal: This API element is subject to removal in a future version.Set the expiration time for the corresponding motor safety object.voidsetInverted(boolean isInverted)Deprecated, for removal: This API element is subject to removal in a future version.Common interface for inverting direction of a motor controller.voidsetSafetyEnabled(boolean enabled)Deprecated, for removal: This API element is subject to removal in a future version.Enable/disable motor safety for this device.voidsetVoltage(double volts)Deprecated, for removal: This API element is subject to removal in a future version.Common interface for seting the direct voltage output of a motor controller.voidstopMotor()Deprecated, for removal: This API element is subject to removal in a future version.Common interface to stop motor movement until set is called again.Methods inherited from class com.ctre.phoenixpro.hardware.core.CoreTalonFX
clearStickyFaults, clearStickyFaults, getAppliedRotorPolarity, getBridgeOuput, getClosedLoopDerivativeOutput, getClosedLoopError, getClosedLoopFeedForward, getClosedLoopIntegratedOutput, getClosedLoopOutput, getClosedLoopProportionalOutput, getClosedLoopReference, getClosedLoopReferenceSlope, getClosedLoopSlot, getConfigurator, getControlMode, getDeviceEnable, getDeviceTemp, getDutyCycle, getFault_BootDuringEnable, getFault_DeviceTemp, getFault_ForwardHardLimit, getFault_ForwardSoftLimit, getFault_FusedSensorOutOfSync, getFault_Hardware, getFault_MissingRemoteSensor, getFault_OverSupplyV, getFault_ProcTemp, getFault_ReverseHardLimit, getFault_ReverseSoftLimit, getFault_StatorCurrLimit, getFault_SupplyCurrLimit, getFault_Undervoltage, getFault_UnlicensedFeatureInUse, getFault_UnstableSupplyV, getFault_UsingFusedCANcoderWhileUnlicensed, getFaultField, getForwardLimit, getMotionMagicIsRunning, getPosition, getProcessorTemp, getReverseLimit, getRotorPosition, getRotorVelocity, getSimState, getStatorCurrent, getStickyFault_BootDuringEnable, getStickyFault_DeviceTemp, getStickyFault_ForwardHardLimit, getStickyFault_ForwardSoftLimit, getStickyFault_FusedSensorOutOfSync, getStickyFault_Hardware, getStickyFault_MissingRemoteSensor, getStickyFault_OverSupplyV, getStickyFault_ProcTemp, getStickyFault_ReverseHardLimit, getStickyFault_ReverseSoftLimit, getStickyFault_StatorCurrLimit, getStickyFault_SupplyCurrLimit, getStickyFault_Undervoltage, getStickyFault_UnlicensedFeatureInUse, getStickyFault_UnstableSupplyV, getStickyFault_UsingFusedCANcoderWhileUnlicensed, getStickyFaultField, getSupplyCurrent, getSupplyVoltage, getTorqueCurrent, getVelocity, getVersion, getVersionBugfix, getVersionBuild, getVersionMajor, getVersionMinor, hasResetOccurred, reportIfTooOld, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setRotorPosition, setRotorPositionMethods inherited from class com.ctre.phoenixpro.hardware.ParentDevice
getAppliedControl, getCANBus, getDeviceID, lookupStatusSignalValue, lookupStatusSignalValue
-
Field Details
-
kDefaultSafetyExpiration
Deprecated, for removal: This API element is subject to removal in a future version.The default motor safety timeout IF calling application enables the feature.- See Also:
- Constant Field Values
-
-
Constructor Details
-
TalonFX
Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.Constructs a new Talon FX motor controller 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.
-
TalonFX
Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.Constructs a new Talon FX motor controller 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
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
closein interfaceAutoCloseable
-
set
Deprecated, for removal: This API element is subject to removal in a future version.Common interface for setting the speed of a motor controller.- Specified by:
setin interfaceMotorController- Parameters:
speed- The speed to set. Value should be between -1.0 and 1.0.
-
setVoltage
Deprecated, for removal: This API element is subject to removal in a future version.Common interface for seting the direct voltage output of a motor controller.- Specified by:
setVoltagein interfaceMotorController- Parameters:
volts- The voltage to output.
-
get
Deprecated, for removal: This API element is subject to removal in a future version.Common interface for getting the current set speed of a motor controller.- Specified by:
getin interfaceMotorController- Returns:
- The current set speed. Value is between -1.0 and 1.0.
-
setControlPrivate
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setControlPrivatein classParentDevice
-
disable
Deprecated, for removal: This API element is subject to removal in a future version.Common interface for disabling a motor controller.- Specified by:
disablein interfaceMotorController
-
stopMotor
Deprecated, for removal: This API element is subject to removal in a future version.Common interface to stop motor movement until set is called again.- Specified by:
stopMotorin interfaceMotorController
-
setInverted
Deprecated, for removal: This API element is subject to removal in a future version.Common interface for inverting direction of a motor controller.- Specified by:
setInvertedin interfaceMotorController- Parameters:
isInverted- The state of inversion, true is inverted.
-
getInverted
Deprecated, for removal: This API element is subject to removal in a future version.Common interface for returning the inversion state of a motor controller.- Specified by:
getInvertedin interfaceMotorController- Returns:
- The state of the inversion, true is inverted.
-
initSendable
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
initSendablein interfaceSendable
-
getDescription
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- Description of motor controller
-
feed
Deprecated, for removal: This API element is subject to removal in a future version.Feed the motor safety object.Resets the timer on this object that is used to do the timeouts.
-
setExpiration
Deprecated, for removal: This API element is subject to removal in a future version.Set the expiration time for the corresponding motor safety object.- Parameters:
expirationTime- The timeout value in seconds.
-
getExpiration
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the timeout value for the corresponding motor safety object.- Returns:
- the timeout value in seconds.
-
isAlive
Deprecated, for removal: This API element is subject to removal in a future version.Determine of the motor is still operating or has timed out.- Returns:
- a true value if the motor is still operating normally and hasn't timed out.
-
setSafetyEnabled
Deprecated, for removal: This API element is subject to removal in a future version.Enable/disable motor safety for this device.Turn on and off the motor safety option for this PWM object.
- Parameters:
enabled- True if motor safety is enforced for this object
-
isSafetyEnabled
Deprecated, for removal: This API element is subject to removal in a future version.Return the state of the motor safety enabled flag.Return if the motor safety is currently enabled for this device.
- Returns:
- True if motor safety is enforced for this device
-