Class TalonFXS
- All Implemented Interfaces:
PhoenixAlertable, CommonDevice, CommonTalon, CommonTalonWithExternalMotor, HasExternalMotor, HasTalonControls, HasTalonSignals, AutoCloseable, TelemetryLoggable
CoreTalonFXS.-
Nested Class Summary
Nested classes/interfaces inherited from class ParentDevice
ParentDevice.MapGenerator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe default motor safety timeout IF calling application enables the feature.Fields inherited from class ParentDevice
_emptyControl, deviceIdentifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final StatusCodeconfigNeutralMode(NeutralModeValue neutralMode) Sets the mode of operation when output is neutral or disabled.final StatusCodeconfigNeutralMode(NeutralModeValue neutralMode, double timeoutSeconds) Sets the mode of operation when output is neutral or disabled.final voiddisable()Disables the motor controller.final voidfeed()Feed the motor safety object.final doubleRetrieve the timeout value for the corresponding motor safety object.Gets the telemetry table type.final doubleGets the throttle of the motor controller.final booleanisAlive()Determine of the motor is still operating or has timed out.final booleanReturn the state of the motor safety enabled flag.voidlogTo(TelemetryTable table) Logs the object to aTelemetryTable.static TalonFXSnone()Constructs a stubbed-out TalonFXS, where all status signals, controls, configs, etc.protected StatusCodesetControlPrivate(ControlRequest request) final voidsetExpiration(double expirationTime) Set the expiration time for the corresponding motor safety object.final voidsetSafetyEnabled(boolean enabled) Enable/disable motor safety for this device.final voidsetThrottle(double throttle) Sets the throttle of the motor controller.final voidsetVoltage(double voltage) Sets the direct voltage output of the motor controller.final voidsetVoltage(Voltage voltage) Sets the direct voltage output of the motor controller.final voidCalled to stop the motor when the timeout expires.Methods inherited from class CoreTalonFXS
clearStickyFault_BootDuringEnable, clearStickyFault_BootDuringEnable, clearStickyFault_BridgeBrownout, clearStickyFault_BridgeBrownout, clearStickyFault_BridgeShort, clearStickyFault_BridgeShort, clearStickyFault_DeviceTemp, clearStickyFault_DeviceTemp, clearStickyFault_DriveDisabledHallSensor, clearStickyFault_DriveDisabledHallSensor, clearStickyFault_ForwardHardLimit, clearStickyFault_ForwardHardLimit, clearStickyFault_ForwardSoftLimit, clearStickyFault_ForwardSoftLimit, clearStickyFault_FusedSensorOutOfSync, clearStickyFault_FusedSensorOutOfSync, clearStickyFault_HallSensorMissing, clearStickyFault_HallSensorMissing, clearStickyFault_Hardware, clearStickyFault_Hardware, clearStickyFault_MissingDifferentialFX, clearStickyFault_MissingDifferentialFX, clearStickyFault_MissingHardLimitRemote, clearStickyFault_MissingHardLimitRemote, clearStickyFault_MissingSoftLimitRemote, clearStickyFault_MissingSoftLimitRemote, clearStickyFault_MotorArrangementNotSelected, clearStickyFault_MotorArrangementNotSelected, clearStickyFault_MotorTempSensorMissing, clearStickyFault_MotorTempSensorMissing, clearStickyFault_MotorTempSensorTooHot, clearStickyFault_MotorTempSensorTooHot, clearStickyFault_OverSupplyV, clearStickyFault_OverSupplyV, clearStickyFault_ProcTemp, clearStickyFault_ProcTemp, clearStickyFault_RemoteSensorDataInvalid, clearStickyFault_RemoteSensorDataInvalid, clearStickyFault_RemoteSensorPosOverflow, clearStickyFault_RemoteSensorPosOverflow, clearStickyFault_RemoteSensorReset, clearStickyFault_RemoteSensorReset, clearStickyFault_ReverseHardLimit, clearStickyFault_ReverseHardLimit, clearStickyFault_ReverseSoftLimit, clearStickyFault_ReverseSoftLimit, clearStickyFault_StaticBrakeDisabled, clearStickyFault_StaticBrakeDisabled, clearStickyFault_StatorCurrLimit, clearStickyFault_StatorCurrLimit, clearStickyFault_SupplyCurrLimit, clearStickyFault_SupplyCurrLimit, clearStickyFault_Undervoltage, clearStickyFault_Undervoltage, clearStickyFault_UnlicensedFeatureInUse, clearStickyFault_UnlicensedFeatureInUse, clearStickyFault_UnstableSupplyV, clearStickyFault_UnstableSupplyV, clearStickyFault_UsingFusedCANcoderWhileUnlicensed, clearStickyFault_UsingFusedCANcoderWhileUnlicensed, clearStickyFaults, clearStickyFaults, getAcceleration, getAcceleration, getAnalogVoltage, getAnalogVoltage, getAncillaryDeviceTemp, getAncillaryDeviceTemp, getAppliedRotorPolarity, getAppliedRotorPolarity, getBridgeOutput, getBridgeOutput, getClosedLoopDerivativeOutput, getClosedLoopDerivativeOutput, getClosedLoopError, getClosedLoopError, getClosedLoopFeedForward, getClosedLoopFeedForward, getClosedLoopIntegratedOutput, getClosedLoopIntegratedOutput, getClosedLoopOutput, getClosedLoopOutput, getClosedLoopProportionalOutput, getClosedLoopProportionalOutput, getClosedLoopReference, getClosedLoopReference, getClosedLoopReferenceSlope, getClosedLoopReferenceSlope, getClosedLoopSlot, getClosedLoopSlot, getConfigurator, getConnectedMotor, getConnectedMotor, getControlMode, getControlMode, getDeviceEnable, getDeviceEnable, getDeviceTemp, getDeviceTemp, getDifferentialAveragePosition, getDifferentialAveragePosition, getDifferentialAverageVelocity, getDifferentialAverageVelocity, getDifferentialClosedLoopDerivativeOutput, getDifferentialClosedLoopDerivativeOutput, getDifferentialClosedLoopError, getDifferentialClosedLoopError, getDifferentialClosedLoopFeedForward, getDifferentialClosedLoopFeedForward, getDifferentialClosedLoopIntegratedOutput, getDifferentialClosedLoopIntegratedOutput, getDifferentialClosedLoopOutput, getDifferentialClosedLoopOutput, getDifferentialClosedLoopProportionalOutput, getDifferentialClosedLoopProportionalOutput, getDifferentialClosedLoopReference, getDifferentialClosedLoopReference, getDifferentialClosedLoopReferenceSlope, getDifferentialClosedLoopReferenceSlope, getDifferentialClosedLoopSlot, getDifferentialClosedLoopSlot, getDifferentialControlMode, getDifferentialControlMode, getDifferentialDifferencePosition, getDifferentialDifferencePosition, getDifferentialDifferenceVelocity, getDifferentialDifferenceVelocity, getDifferentialOutput, getDifferentialOutput, getDutyCycle, getDutyCycle, getExternalMotorTemp, getExternalMotorTemp, getExternalMotorTempStatus, getExternalMotorTempStatus, getFault_5V, getFault_5V, getFault_BootDuringEnable, getFault_BootDuringEnable, getFault_BridgeBrownout, getFault_BridgeBrownout, getFault_BridgeShort, getFault_BridgeShort, getFault_DeviceTemp, getFault_DeviceTemp, getFault_DriveDisabledHallSensor, getFault_DriveDisabledHallSensor, getFault_ForwardHardLimit, getFault_ForwardHardLimit, getFault_ForwardSoftLimit, getFault_ForwardSoftLimit, getFault_FusedSensorOutOfSync, getFault_FusedSensorOutOfSync, getFault_HallSensorMissing, getFault_HallSensorMissing, getFault_Hardware, getFault_Hardware, getFault_MissingDifferentialFX, getFault_MissingDifferentialFX, getFault_MissingHardLimitRemote, getFault_MissingHardLimitRemote, getFault_MissingSoftLimitRemote, getFault_MissingSoftLimitRemote, getFault_MotorArrangementNotSelected, getFault_MotorArrangementNotSelected, getFault_MotorTempSensorMissing, getFault_MotorTempSensorMissing, getFault_MotorTempSensorTooHot, getFault_MotorTempSensorTooHot, getFault_OverSupplyV, getFault_OverSupplyV, getFault_ProcTemp, getFault_ProcTemp, getFault_RemoteSensorDataInvalid, getFault_RemoteSensorDataInvalid, getFault_RemoteSensorPosOverflow, getFault_RemoteSensorPosOverflow, getFault_RemoteSensorReset, getFault_RemoteSensorReset, getFault_ReverseHardLimit, getFault_ReverseHardLimit, getFault_ReverseSoftLimit, getFault_ReverseSoftLimit, getFault_StaticBrakeDisabled, getFault_StaticBrakeDisabled, getFault_StatorCurrLimit, getFault_StatorCurrLimit, getFault_SupplyCurrLimit, getFault_SupplyCurrLimit, getFault_Undervoltage, getFault_Undervoltage, getFault_UnlicensedFeatureInUse, getFault_UnlicensedFeatureInUse, getFault_UnstableSupplyV, getFault_UnstableSupplyV, getFault_UsingFusedCANcoderWhileUnlicensed, getFault_UsingFusedCANcoderWhileUnlicensed, getFaultField, getFaultField, getFiveVRailVoltage, getFiveVRailVoltage, getForwardLimit, getForwardLimit, getIsProLicensed, getIsProLicensed, getMotionMagicAtTarget, getMotionMagicAtTarget, getMotionMagicIsRunning, getMotionMagicIsRunning, getMotorKT, getMotorKT, getMotorKV, getMotorKV, getMotorOutputStatus, getMotorOutputStatus, getMotorStallCurrent, getMotorStallCurrent, getMotorVoltage, getMotorVoltage, getPosition, getPosition, getProcessorTemp, getProcessorTemp, getRawPulseWidthPosition, getRawPulseWidthPosition, getRawPulseWidthVelocity, getRawPulseWidthVelocity, getRawQuadraturePosition, getRawQuadraturePosition, getRawQuadratureVelocity, getRawQuadratureVelocity, getReverseLimit, getReverseLimit, getRobotEnable, getRobotEnable, getRotorPosition, getRotorPosition, getRotorVelocity, getRotorVelocity, getSimState, getStatorCurrent, getStatorCurrent, getStickyFault_5V, getStickyFault_5V, getStickyFault_BootDuringEnable, getStickyFault_BootDuringEnable, getStickyFault_BridgeBrownout, getStickyFault_BridgeBrownout, getStickyFault_BridgeShort, getStickyFault_BridgeShort, getStickyFault_DeviceTemp, getStickyFault_DeviceTemp, getStickyFault_DriveDisabledHallSensor, getStickyFault_DriveDisabledHallSensor, getStickyFault_ForwardHardLimit, getStickyFault_ForwardHardLimit, getStickyFault_ForwardSoftLimit, getStickyFault_ForwardSoftLimit, getStickyFault_FusedSensorOutOfSync, getStickyFault_FusedSensorOutOfSync, getStickyFault_HallSensorMissing, getStickyFault_HallSensorMissing, getStickyFault_Hardware, getStickyFault_Hardware, getStickyFault_MissingDifferentialFX, getStickyFault_MissingDifferentialFX, getStickyFault_MissingHardLimitRemote, getStickyFault_MissingHardLimitRemote, getStickyFault_MissingSoftLimitRemote, getStickyFault_MissingSoftLimitRemote, getStickyFault_MotorArrangementNotSelected, getStickyFault_MotorArrangementNotSelected, getStickyFault_MotorTempSensorMissing, getStickyFault_MotorTempSensorMissing, getStickyFault_MotorTempSensorTooHot, getStickyFault_MotorTempSensorTooHot, getStickyFault_OverSupplyV, getStickyFault_OverSupplyV, getStickyFault_ProcTemp, getStickyFault_ProcTemp, getStickyFault_RemoteSensorDataInvalid, getStickyFault_RemoteSensorDataInvalid, getStickyFault_RemoteSensorPosOverflow, getStickyFault_RemoteSensorPosOverflow, getStickyFault_RemoteSensorReset, getStickyFault_RemoteSensorReset, getStickyFault_ReverseHardLimit, getStickyFault_ReverseHardLimit, getStickyFault_ReverseSoftLimit, getStickyFault_ReverseSoftLimit, getStickyFault_StaticBrakeDisabled, getStickyFault_StaticBrakeDisabled, getStickyFault_StatorCurrLimit, getStickyFault_StatorCurrLimit, getStickyFault_SupplyCurrLimit, getStickyFault_SupplyCurrLimit, getStickyFault_Undervoltage, getStickyFault_Undervoltage, getStickyFault_UnlicensedFeatureInUse, getStickyFault_UnlicensedFeatureInUse, getStickyFault_UnstableSupplyV, getStickyFault_UnstableSupplyV, getStickyFault_UsingFusedCANcoderWhileUnlicensed, getStickyFault_UsingFusedCANcoderWhileUnlicensed, getStickyFaultField, getStickyFaultField, getSupplyCurrent, getSupplyCurrent, getSupplyVoltage, getSupplyVoltage, getTorqueCurrent, getTorqueCurrent, getVelocity, getVelocity, getVersion, getVersion, getVersionBugfix, getVersionBugfix, getVersionBuild, getVersionBuild, getVersionMajor, getVersionMajor, getVersionMinor, getVersionMinor, registerAlerts, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setPosition, setPosition, setPosition, setPositionMethods inherited from class ParentDevice
getAppliedControl, getDeviceHash, getDeviceID, getIsConnectedChecker, getIsConnectedChecker, getNetwork, getResetOccurredChecker, hasResetOccurred, isConnected, isConnected, lookupStatusSignal, lookupStatusSignal, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilizationForAll, optimizeBusUtilizationForAll, optimizeBusUtilizationForAll, resetSignalFrequencies, resetSignalFrequencies, resetSignalFrequenciesForAll, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CommonDevice
getAppliedControl, getDeviceHash, getDeviceID, getIsConnectedChecker, getIsConnectedChecker, getNetwork, getResetOccurredChecker, hasResetOccurred, isConnected, isConnected, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, resetSignalFrequencies, resetSignalFrequencies
-
Field Details
-
kDefaultSafetyExpiration
public static final double kDefaultSafetyExpirationThe default motor safety timeout IF calling application enables the feature.- See Also:
-
-
Constructor Details
-
TalonFXS
Constructs a new Talon FXS motor controller object.- Parameters:
deviceId- ID of the device, as configured in Phoenix Tunercanbus- The CAN bus this device is on
-
-
Method Details
-
none
Constructs a stubbed-out TalonFXS, where all status signals, controls, configs, etc. perform no action and immediately return OK. This can be used to silence error messages for devices that have been completely removed from the robot.- Returns:
- Stubbed-out TalonFXS
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
setControlPrivate
- Overrides:
setControlPrivatein classParentDevice
-
setThrottle
public final void setThrottle(double throttle) Sets the throttle of the motor controller.- Parameters:
throttle- The throttle where -1 indicates full reverse and 1 indicates full forward.
-
setVoltage
public final void setVoltage(double voltage) Sets the direct voltage output of the motor controller.Compensates for the current bus voltage to ensure that the desired voltage is output even if the battery voltage is below 12V - highly useful when the voltage outputs are "meaningful" (e.g. they come from a feedforward calculation).
- Parameters:
voltage- The voltage.
-
setVoltage
Sets the direct voltage output of the motor controller.Compensates for the current bus voltage to ensure that the desired voltage is output even if the battery voltage is below 12V - highly useful when the voltage outputs are "meaningful" (e.g. they come from a feedforward calculation).
- Parameters:
voltage- The voltage.
-
getThrottle
public final double getThrottle()Gets the throttle of the motor controller.- Returns:
- The throttle where -1 represents full reverse and 1 represents full forward.
-
disable
public final void disable()Disables the motor controller. -
configNeutralMode
Sets the mode of operation when output is neutral or disabled. This is equivalent to setting theMotorOutputConfigs.NeutralModewhen applying aTalonFXSConfigurationto the motor.Since neutral mode is a config, this API is blocking. We recommend that users avoid calling this API periodically.
This will wait up to 0.100 seconds (100ms) by default.
- Parameters:
neutralMode- The state of the motor controller bridge when output is neutral or disabled- Returns:
- Status of refreshing and applying the neutral mode config
-
configNeutralMode
Sets the mode of operation when output is neutral or disabled.Since neutral mode is a config, this API is blocking. We recommend that users avoid calling this API periodically.
- Parameters:
neutralMode- The state of the motor controller bridge when output is neutral or disabledtimeoutSeconds- Maximum amount of time to wait when performing configuration- Returns:
- Status of refreshing and applying the neutral mode config
-
feed
public final void feed()Feed the motor safety object.Resets the timer on this object that is used to do the timeouts.
-
setExpiration
public final void setExpiration(double expirationTime) Set the expiration time for the corresponding motor safety object.- Parameters:
expirationTime- The timeout value in seconds.
-
getExpiration
public final double getExpiration()Retrieve the timeout value for the corresponding motor safety object.- Returns:
- the timeout value in seconds.
-
isAlive
public final boolean isAlive()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
public final void setSafetyEnabled(boolean enabled) Enable/disable motor safety for this device.Turn on and off the motor safety option for this object.
- Parameters:
enabled- True if motor safety is enforced for this object.
-
isSafetyEnabled
public final boolean isSafetyEnabled()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
-
stopMotor
public final void stopMotor()Called to stop the motor when the timeout expires. -
getDescription
- Returns:
- Description of the motor controller
-
logTo
Logs the object to aTelemetryTable.- Specified by:
logToin interfaceTelemetryLoggable- Parameters:
table- telemetry table
-
getTelemetryType
Gets the telemetry table type.- Specified by:
getTelemetryTypein interfaceTelemetryLoggable- Returns:
- Table type
-