CTRE_Phoenix  5.19.4
com.ctre.phoenix.motorcontrol.can.TalonFX Class Reference

Inherits com.ctre.phoenix.motorcontrol.can.BaseTalon.

Inherited by com.ctre.phoenix.motorcontrol.can.WPI_TalonFX.

Public Member Functions

 TalonFX (int deviceNumber)
 
void set (TalonFXControlMode mode, double value)
 
void set (TalonFXControlMode mode, double demand0, DemandType demand1Type, double demand1)
 
void setInverted (TalonFXInvertType invertType)
 
ErrorCode configSelectedFeedbackSensor (TalonFXFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitCfg, int timeoutMs)
 
ErrorCode configSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitCfg)
 
ErrorCode configStatorCurrentLimit (StatorCurrentLimitConfiguration currLimitCfg, int timeoutMs)
 
ErrorCode configStatorCurrentLimit (StatorCurrentLimitConfiguration currLimitCfg)
 
ErrorCode configGetSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitConfigsToFill, int timeoutMs)
 
ErrorCode configGetSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitConfigsToFill)
 
ErrorCode configGetStatorCurrentLimit (StatorCurrentLimitConfiguration currLimitConfigsToFill, int timeoutMs)
 
ErrorCode configGetStatorCurrentLimit (StatorCurrentLimitConfiguration currLimitConfigsToFill)
 
ErrorCode configMotorCommutation (MotorCommutation motorCommutation, int timeoutMs)
 
ErrorCode configMotorCommutation (MotorCommutation motorCommutation)
 
MotorCommutation configGetMotorCommutation (int timeoutMs)
 
MotorCommutation configGetMotorCommutation ()
 
ErrorCode configIntegratedSensorAbsoluteRange (AbsoluteSensorRange absoluteSensorRange, int timeoutMs)
 
ErrorCode configIntegratedSensorAbsoluteRange (AbsoluteSensorRange absoluteSensorRange)
 
ErrorCode configIntegratedSensorOffset (double offsetDegrees, int timeoutMs)
 
ErrorCode configIntegratedSensorOffset (double offsetDegrees)
 
ErrorCode configIntegratedSensorInitializationStrategy (SensorInitializationStrategy initializationStrategy, int timeoutMs)
 
ErrorCode configIntegratedSensorInitializationStrategy (SensorInitializationStrategy initializationStrategy)
 
TalonFXSensorCollection getSensorCollection ()
 
void getPIDConfigs (TalonFXPIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
void getPIDConfigs (TalonFXPIDSetConfiguration pid)
 
ErrorCode configAllSettings (TalonFXConfiguration allConfigs, int timeoutMs)
 
ErrorCode configAllSettings (TalonFXConfiguration allConfigs)
 
ErrorCode getAllConfigs (TalonFXConfiguration allConfigs, int timeoutMs)
 
ErrorCode getAllConfigs (TalonFXConfiguration allConfigs)
 
- Public Member Functions inherited from com.ctre.phoenix.motorcontrol.can.BaseTalon
 BaseTalon (int deviceNumber, String model)
 
ErrorCode setStatusFramePeriod (StatusFrameEnhanced frame, int periodMs, int timeoutMs)
 
ErrorCode setStatusFramePeriod (StatusFrameEnhanced frame, int periodMs)
 
int getStatusFramePeriod (StatusFrameEnhanced frame, int timeoutMs)
 
int getStatusFramePeriod (StatusFrameEnhanced frame)
 
double getOutputCurrent ()
 
double getStatorCurrent ()
 
double getSupplyCurrent ()
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period)
 
ErrorCode configVelocityMeasurementWindow (int windowSize, int timeoutMs)
 
ErrorCode configVelocityMeasurementWindow (int windowSize)
 
ErrorCode configForwardLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
 
ErrorCode configForwardLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose)
 
ErrorCode configReverseLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose)
 
ErrorCode configSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitCfg, int timeoutMs)
 
int isFwdLimitSwitchClosed ()
 
int isRevLimitSwitchClosed ()
 
- Public Member Functions inherited from com.ctre.phoenix.motorcontrol.can.BaseMotorController
 BaseMotorController (int arbId, String model)
 
ErrorCode DestroyObject ()
 
long getHandle ()
 
int getDeviceID ()
 
void set (ControlMode mode, double outputValue)
 
void set (ControlMode mode, double demand0, DemandType demand1Type, double demand1)
 
void neutralOutput ()
 
void setNeutralMode (NeutralMode neutralMode)
 
void setSensorPhase (boolean PhaseSensor)
 
void setInverted (boolean invert)
 
void setInverted (InvertType invertType)
 
boolean getInverted ()
 
ErrorCode configFactoryDefault (int timeoutMs)
 
ErrorCode configFactoryDefault ()
 
ErrorCode configOpenloopRamp (double secondsFromNeutralToFull, int timeoutMs)
 
ErrorCode configOpenloopRamp (double secondsFromNeutralToFull)
 
ErrorCode configClosedloopRamp (double secondsFromNeutralToFull, int timeoutMs)
 
ErrorCode configClosedloopRamp (double secondsFromNeutralToFull)
 
ErrorCode configPeakOutputForward (double percentOut, int timeoutMs)
 
ErrorCode configPeakOutputForward (double percentOut)
 
ErrorCode configPeakOutputReverse (double percentOut, int timeoutMs)
 
ErrorCode configPeakOutputReverse (double percentOut)
 
ErrorCode configNominalOutputForward (double percentOut, int timeoutMs)
 
ErrorCode configNominalOutputForward (double percentOut)
 
ErrorCode configNominalOutputReverse (double percentOut, int timeoutMs)
 
ErrorCode configNominalOutputReverse (double percentOut)
 
ErrorCode configNeutralDeadband (double percentDeadband, int timeoutMs)
 
ErrorCode configNeutralDeadband (double percentDeadband)
 
ErrorCode configVoltageCompSaturation (double voltage, int timeoutMs)
 
ErrorCode configVoltageCompSaturation (double voltage)
 
ErrorCode configVoltageMeasurementFilter (int filterWindowSamples, int timeoutMs)
 
ErrorCode configVoltageMeasurementFilter (int filterWindowSamples)
 
void enableVoltageCompensation (boolean enable)
 
boolean isVoltageCompensationEnabled ()
 
double getBusVoltage ()
 
double getMotorOutputPercent ()
 
double getMotorOutputVoltage ()
 
double getTemperature ()
 
ErrorCode configSelectedFeedbackSensor (RemoteFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSelectedFeedbackSensor (RemoteFeedbackDevice feedbackDevice)
 
ErrorCode configSelectedFeedbackSensor (FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSelectedFeedbackSensor (FeedbackDevice feedbackDevice)
 
ErrorCode configSelectedFeedbackCoefficient (double coefficient, int pidIdx, int timeoutMs)
 
ErrorCode configSelectedFeedbackCoefficient (double coefficient)
 
ErrorCode configRemoteFeedbackFilter (int deviceID, RemoteSensorSource remoteSensorSource, int remoteOrdinal, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (int deviceID, RemoteSensorSource remoteSensorSource, int remoteOrdinal)
 
ErrorCode configRemoteFeedbackFilter (CANCoder canCoderRef, int remoteOrdinal, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (CANCoder canCoderRef, int remoteOrdinal)
 
ErrorCode configSensorTerm (SensorTerm sensorTerm, FeedbackDevice feedbackDevice, int timeoutMs)
 
ErrorCode configSensorTerm (SensorTerm sensorTerm, FeedbackDevice feedbackDevice)
 
ErrorCode configSensorTerm (SensorTerm sensorTerm, RemoteFeedbackDevice feedbackDevice, int timeoutMs)
 
ErrorCode configSensorTerm (SensorTerm sensorTerm, RemoteFeedbackDevice feedbackDevice)
 
double getSelectedSensorPosition (int pidIdx)
 
double getSelectedSensorPosition ()
 
double getSelectedSensorVelocity (int pidIdx)
 
double getSelectedSensorVelocity ()
 
ErrorCode setSelectedSensorPosition (double sensorPos, int pidIdx, int timeoutMs)
 
ErrorCode setSelectedSensorPosition (double sensorPos)
 
ErrorCode setControlFramePeriod (ControlFrame frame, int periodMs)
 
ErrorCode setControlFramePeriod (int frame, int periodMs)
 
ErrorCode setStatusFramePeriod (int frameValue, int periodMs, int timeoutMs)
 
ErrorCode setStatusFramePeriod (int frameValue, int periodMs)
 
ErrorCode setStatusFramePeriod (StatusFrame frame, int periodMs, int timeoutMs)
 
ErrorCode setStatusFramePeriod (StatusFrame frame, int periodMs)
 
int getStatusFramePeriod (int frame, int timeoutMs)
 
int getStatusFramePeriod (int frame)
 
int getStatusFramePeriod (StatusFrame frame, int timeoutMs)
 
int getStatusFramePeriod (StatusFrame frame)
 
int getStatusFramePeriod (StatusFrameEnhanced frame, int timeoutMs)
 
int getStatusFramePeriod (StatusFrameEnhanced frame)
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period)
 
ErrorCode configVelocityMeasurementWindow (int windowSize, int timeoutMs)
 
ErrorCode configVelocityMeasurementWindow (int windowSize)
 
ErrorCode configForwardLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs)
 
ErrorCode configForwardLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID)
 
ErrorCode configReverseLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID)
 
ErrorCode configForwardLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
 
ErrorCode configForwardLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose)
 
void overrideLimitSwitchesEnable (boolean enable)
 
ErrorCode configForwardSoftLimitThreshold (double forwardSensorLimit, int timeoutMs)
 
ErrorCode configForwardSoftLimitThreshold (double forwardSensorLimit)
 
ErrorCode configReverseSoftLimitThreshold (double reverseSensorLimit, int timeoutMs)
 
ErrorCode configReverseSoftLimitThreshold (double reverseSensorLimit)
 
ErrorCode configForwardSoftLimitEnable (boolean enable, int timeoutMs)
 
ErrorCode configForwardSoftLimitEnable (boolean enable)
 
ErrorCode configReverseSoftLimitEnable (boolean enable, int timeoutMs)
 
ErrorCode configReverseSoftLimitEnable (boolean enable)
 
void overrideSoftLimitsEnable (boolean enable)
 
ErrorCode config_kP (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kP (int slotIdx, double value)
 
ErrorCode config_kI (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kI (int slotIdx, double value)
 
ErrorCode config_kD (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kD (int slotIdx, double value)
 
ErrorCode config_kF (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kF (int slotIdx, double value)
 
ErrorCode config_IntegralZone (int slotIdx, double izone, int timeoutMs)
 
ErrorCode config_IntegralZone (int slotIdx, double izone)
 
ErrorCode configAllowableClosedloopError (int slotIdx, double allowableClosedLoopError, int timeoutMs)
 
ErrorCode configAllowableClosedloopError (int slotIdx, double allowableClosedLoopError)
 
ErrorCode configMaxIntegralAccumulator (int slotIdx, double iaccum, int timeoutMs)
 
ErrorCode configMaxIntegralAccumulator (int slotIdx, double iaccum)
 
ErrorCode configClosedLoopPeakOutput (int slotIdx, double percentOut, int timeoutMs)
 
ErrorCode configClosedLoopPeakOutput (int slotIdx, double percentOut)
 
ErrorCode configClosedLoopPeriod (int slotIdx, int loopTimeMs, int timeoutMs)
 
ErrorCode configClosedLoopPeriod (int slotIdx, int loopTimeMs)
 
ErrorCode configAuxPIDPolarity (boolean invert, int timeoutMs)
 
ErrorCode configAuxPIDPolarity (boolean invert)
 
ErrorCode setIntegralAccumulator (double iaccum, int pidIdx, int timeoutMs)
 
ErrorCode setIntegralAccumulator (double iaccum)
 
double getClosedLoopError (int pidIdx)
 
double getClosedLoopError ()
 
double getIntegralAccumulator (int pidIdx)
 
double getIntegralAccumulator ()
 
double getErrorDerivative (int pidIdx)
 
double getErrorDerivative ()
 
void selectProfileSlot (int slotIdx, int pidIdx)
 
double getClosedLoopTarget (int pidIdx)
 
double getClosedLoopTarget ()
 
double getActiveTrajectoryPosition ()
 
double getActiveTrajectoryPosition (int pidIdx)
 
double getActiveTrajectoryVelocity ()
 
double getActiveTrajectoryVelocity (int pidIdx)
 
double getActiveTrajectoryArbFeedFwd ()
 
double getActiveTrajectoryArbFeedFwd (int pidIdx)
 
ErrorCode configMotionCruiseVelocity (double sensorUnitsPer100ms, int timeoutMs)
 
ErrorCode configMotionCruiseVelocity (double sensorUnitsPer100ms)
 
ErrorCode configMotionAcceleration (double sensorUnitsPer100msPerSec, int timeoutMs)
 
ErrorCode configMotionAcceleration (double sensorUnitsPer100msPerSec)
 
ErrorCode configMotionSCurveStrength (int curveStrength, int timeoutMs)
 
ErrorCode configMotionSCurveStrength (int curveStrength)
 
ErrorCode clearMotionProfileTrajectories ()
 
int getMotionProfileTopLevelBufferCount ()
 
ErrorCode pushMotionProfileTrajectory (TrajectoryPoint trajPt)
 
ErrorCode startMotionProfile (BufferedTrajectoryPointStream stream, int minBufferedPts, ControlMode motionProfControlMode)
 
boolean isMotionProfileFinished ()
 
boolean isMotionProfileTopLevelBufferFull ()
 
void processMotionProfileBuffer ()
 
ErrorCode getMotionProfileStatus (MotionProfileStatus statusToFill)
 
ErrorCode clearMotionProfileHasUnderrun (int timeoutMs)
 
ErrorCode clearMotionProfileHasUnderrun ()
 
ErrorCode changeMotionControlFramePeriod (int periodMs)
 
ErrorCode configMotionProfileTrajectoryPeriod (int baseTrajDurationMs, int timeoutMs)
 
ErrorCode configMotionProfileTrajectoryPeriod (int baseTrajDurationMs)
 
ErrorCode configMotionProfileTrajectoryInterpolationEnable (boolean enable, int timeoutMs)
 
ErrorCode configMotionProfileTrajectoryInterpolationEnable (boolean enable)
 
ErrorCode configFeedbackNotContinuous (boolean feedbackNotContinuous, int timeoutMs)
 
ErrorCode configRemoteSensorClosedLoopDisableNeutralOnLOS (boolean remoteSensorClosedLoopDisableNeutralOnLOS, int timeoutMs)
 
ErrorCode configClearPositionOnLimitF (boolean clearPositionOnLimitF, int timeoutMs)
 
ErrorCode configClearPositionOnLimitR (boolean clearPositionOnLimitR, int timeoutMs)
 
ErrorCode configClearPositionOnQuadIdx (boolean clearPositionOnQuadIdx, int timeoutMs)
 
ErrorCode configLimitSwitchDisableNeutralOnLOS (boolean limitSwitchDisableNeutralOnLOS, int timeoutMs)
 
ErrorCode configSoftLimitDisableNeutralOnLOS (boolean softLimitDisableNeutralOnLOS, int timeoutMs)
 
ErrorCode configPulseWidthPeriod_EdgesPerRot (int pulseWidthPeriod_EdgesPerRot, int timeoutMs)
 
ErrorCode configPulseWidthPeriod_FilterWindowSz (int pulseWidthPeriod_FilterWindowSz, int timeoutMs)
 
ErrorCode getLastError ()
 
ErrorCode getFaults (Faults toFill)
 
ErrorCode getStickyFaults (StickyFaults toFill)
 
ErrorCode clearStickyFaults (int timeoutMs)
 
ErrorCode clearStickyFaults ()
 
int getFirmwareVersion ()
 
boolean hasResetOccurred ()
 
ErrorCode configSetCustomParam (int newValue, int paramIndex, int timeoutMs)
 
ErrorCode configSetCustomParam (int newValue, int paramIndex)
 
int configGetCustomParam (int paramIndex, int timeoutMs)
 
int configGetCustomParam (int paramIndex)
 
ErrorCode configSetParameter (ParamEnum param, double value, int subValue, int ordinal, int timeoutMs)
 
ErrorCode configSetParameter (ParamEnum param, double value, int subValue, int ordinal)
 
ErrorCode configSetParameter (int param, double value, int subValue, int ordinal, int timeoutMs)
 
ErrorCode configSetParameter (int param, double value, int subValue, int ordinal)
 
double configGetParameter (ParamEnum param, int ordinal, int timeoutMs)
 
double configGetParameter (ParamEnum param, int ordinal)
 
double configGetParameter (int param, int ordinal, int timeoutMs)
 
double configGetParameter (int param, int ordinal)
 
int getBaseID ()
 
ControlMode getControlMode ()
 
void follow (IMotorController masterToFollow, FollowerType followerType)
 
void follow (IMotorController masterToFollow)
 
void valueUpdated ()
 
ErrorCode configureSlot (SlotConfiguration slot)
 
ErrorCode configureSlot (SlotConfiguration slot, int slotIdx, int timeoutMs)
 
void getSlotConfigs (SlotConfiguration slot, int slotIdx, int timeoutMs)
 
void getSlotConfigs (SlotConfiguration slot)
 
ErrorCode configureFilter (FilterConfiguration filter, int ordinal, int timeoutMs, boolean enableOptimizations)
 
ErrorCode configureFilter (FilterConfiguration filter, int ordinal, int timeoutMs)
 
ErrorCode configureFilter (FilterConfiguration filter)
 
void getFilterConfigs (FilterConfiguration filter, int ordinal, int timeoutMs)
 
void getFilterConfigs (FilterConfiguration filter)
 
- Public Member Functions inherited from com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced
ErrorCode configSelectedFeedbackSensor (FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 

Protected Member Functions

ErrorCode configurePID (TalonFXPIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
ErrorCode configurePID (TalonFXPIDSetConfiguration pid)
 
- Protected Member Functions inherited from com.ctre.phoenix.motorcontrol.can.BaseTalon
SensorCollection getTalonSRXSensorCollection ()
 
TalonFXSensorCollection getTalonFXSensorCollection ()
 
TalonSRXSimCollection getTalonSRXSimCollection ()
 
ErrorCode configurePID (BaseTalonPIDSetConfiguration pid, int pidIdx, int timeoutMs, boolean enableOptimizations)
 
ErrorCode configurePID (BaseTalonPIDSetConfiguration pid)
 
void getPIDConfigs (BaseTalonPIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
void getPIDConfigs (BaseTalonPIDSetConfiguration pid)
 
ErrorCode configAllSettings (BaseTalonConfiguration allConfigs, int timeoutMs)
 
ErrorCode configAllSettings (BaseTalonConfiguration allConfigs)
 
void getAllConfigs (BaseTalonConfiguration allConfigs, int timeoutMs)
 
void getAllConfigs (BaseTalonConfiguration allConfigs)
 
- Protected Member Functions inherited from com.ctre.phoenix.motorcontrol.can.BaseMotorController
VictorSPXSimCollection getVictorSPXSimCollection ()
 
double getOutputCurrent ()
 
ErrorCode configForwardLimitSwitchSource (int typeValue, int normalOpenOrCloseValue, int deviceID, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (int typeValue, int normalOpenOrCloseValue, int deviceID, int timeoutMs)
 
ErrorCode baseConfigAllSettings (BaseMotorControllerConfiguration allConfigs, int timeoutMs)
 
ErrorCode baseConfigurePID (BasePIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
void baseGetPIDConfigs (BasePIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
void baseGetAllConfigs (BaseMotorControllerConfiguration allConfigs, int timeoutMs)
 

Additional Inherited Members

- Protected Attributes inherited from com.ctre.phoenix.motorcontrol.can.BaseMotorController
long m_handle
 

Constructor & Destructor Documentation

◆ TalonFX()

com.ctre.phoenix.motorcontrol.can.TalonFX.TalonFX ( int  deviceNumber)
inline

Constructor

Parameters
deviceNumber[0,62]

Member Function Documentation

◆ configAllSettings() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configAllSettings ( TalonFXConfiguration  allConfigs,
int  timeoutMs 
)
inline

Configures all persistent settings.

Parameters
allConfigsObject with all of the persistant settings
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configAllSettings() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configAllSettings ( TalonFXConfiguration  allConfigs)
inline

Configures all persistent settings.

Parameters
allConfigsObject with all of the persistant settings
Returns
Error Code generated by function. 0 indicates no error.

◆ configGetMotorCommutation() [1/2]

MotorCommutation com.ctre.phoenix.motorcontrol.can.TalonFX.configGetMotorCommutation ( int  timeoutMs)
inline
Parameters
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out.
Returns
The motor commutation type.

◆ configGetMotorCommutation() [2/2]

MotorCommutation com.ctre.phoenix.motorcontrol.can.TalonFX.configGetMotorCommutation ( )
inline
Returns
The motor commutation type.

◆ configGetStatorCurrentLimit() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configGetStatorCurrentLimit ( StatorCurrentLimitConfiguration  currLimitConfigsToFill,
int  timeoutMs 
)
inline

Gets the stator (output) current limit configuration.

Parameters
currLimitConfigsToFillConfiguration object to fill with read values.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out.
Returns
Error Code generated by function. 0 indicates no error.

◆ configGetStatorCurrentLimit() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configGetStatorCurrentLimit ( StatorCurrentLimitConfiguration  currLimitConfigsToFill)
inline

Gets the stator (output) current limit configuration.

Parameters
currLimitConfigsToFillConfiguration object to fill with read values.
Returns
Error Code generated by function. 0 indicates no error.

◆ configGetSupplyCurrentLimit() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configGetSupplyCurrentLimit ( SupplyCurrentLimitConfiguration  currLimitConfigsToFill,
int  timeoutMs 
)
inline

Gets the supply (input) current limit configuration.

Parameters
currLimitConfigsToFillConfiguration object to fill with read values.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out.
Returns
Error Code generated by function. 0 indicates no error.

◆ configGetSupplyCurrentLimit() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configGetSupplyCurrentLimit ( SupplyCurrentLimitConfiguration  currLimitConfigsToFill)
inline

Gets the supply (input) current limit configuration.

Parameters
currLimitConfigsToFillConfiguration object to fill with read values..
Returns
Error Code generated by function. 0 indicates no error.

◆ configIntegratedSensorAbsoluteRange() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configIntegratedSensorAbsoluteRange ( AbsoluteSensorRange  absoluteSensorRange,
int  timeoutMs 
)
inline

Sets the signage and range of the "Absolute Position" signal. Choose unsigned for an absolute range of [0,+1) rotations, [0,360) deg, etc... Choose signed for an absolute range of [-0.5,+0.5) rotations, [-180,+180) deg, etc...

Parameters
absoluteSensorRangeDesired Sign/Range for the absolute position register.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configIntegratedSensorAbsoluteRange() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configIntegratedSensorAbsoluteRange ( AbsoluteSensorRange  absoluteSensorRange)
inline

Sets the signage and range of the "Absolute Position" signal. Choose unsigned for an absolute range of [0,+1) rotations, [0,360) deg, etc... Choose signed for an absolute range of [-0.5,+0.5) rotations, [-180,+180) deg, etc...

Parameters
absoluteSensorRangeDesired Sign/Range for the absolute position register.
Returns
Error Code generated by function. 0 indicates no error.

◆ configIntegratedSensorInitializationStrategy() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configIntegratedSensorInitializationStrategy ( SensorInitializationStrategy  initializationStrategy,
int  timeoutMs 
)
inline

Pick the strategy on how to initialize the integrated sensor register. Depending on the mechanism, it may be desirable to auto set the Position register to match the Absolute Position (swerve for example). Or it may be desired to zero the sensor on boot (drivetrain translation sensor or a relative servo).

TIP: Tuner's self-test feature will report what the boot sensor value will be in the event the product is reset.

Parameters
initializationStrategyThe sensor initialization strategy to use. This will impact the behavior the next time product boots up.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configIntegratedSensorInitializationStrategy() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configIntegratedSensorInitializationStrategy ( SensorInitializationStrategy  initializationStrategy)
inline

Pick the strategy on how to initialize the integrated sensor register. Depending on the mechanism, it may be desirable to auto set the Position register to match the Absolute Position (swerve for example). Or it may be desired to zero the sensor on boot (drivetrain translation sensor or a relative servo).

TIP: Tuner's self-test feature will report what the boot sensor value will be in the event the product is reset.

Parameters
initializationStrategyThe sensor initialization strategy to use. This will impact the behavior the next time product boots up.
Returns
Error Code generated by function. 0 indicates no error.

◆ configIntegratedSensorOffset() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configIntegratedSensorOffset ( double  offsetDegrees,
int  timeoutMs 
)
inline

Adjusts the zero point for the integrated sensor absolute position register. The absolute position of the sensor will always have a discontinuity (360 -> 0 deg) or (+180 -> -180) and a hard-limited mechanism may have such a discontinuity in its functional range. In which case use this config to move the discontinuity outside of the function range.

Parameters
offsetDegreesOffset in degrees
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configIntegratedSensorOffset() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configIntegratedSensorOffset ( double  offsetDegrees)
inline

Adjusts the zero point for the integrated sensor absolute position register. The absolute position of the sensor will always have a discontinuity (360 -> 0 deg) or (+180 -> -180) and a hard-limited mechanism may have such a discontinuity in its functional range. In which case use this config to move the discontinuity outside of the function range.

Parameters
offsetDegreesOffset in degrees
Returns
Error Code generated by function. 0 indicates no error.

◆ configMotorCommutation() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configMotorCommutation ( MotorCommutation  motorCommutation,
int  timeoutMs 
)
inline

Configure the motor commutation type.

Parameters
motorCommutationMotor Commutation Type.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.

◆ configMotorCommutation() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configMotorCommutation ( MotorCommutation  motorCommutation)
inline

Configure the motor commutation type.

Parameters
motorCommutationMotor Commutation Type.

◆ configSelectedFeedbackSensor()

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configSelectedFeedbackSensor ( TalonFXFeedbackDevice  feedbackDevice,
int  pidIdx,
int  timeoutMs 
)
inline

Select the feedback device for the motor controller.

Parameters
feedbackDeviceTalon FX feedback Device to select.
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configStatorCurrentLimit() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configStatorCurrentLimit ( StatorCurrentLimitConfiguration  currLimitCfg,
int  timeoutMs 
)
inline

Configures the stator (output) current limit.

Parameters
currLimitCfgCurrent limit configuration
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configStatorCurrentLimit() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configStatorCurrentLimit ( StatorCurrentLimitConfiguration  currLimitCfg)
inline

Configures the stator (output) current limit.

Parameters
currLimitCfgCurrent limit configuration
Returns
Error Code generated by function. 0 indicates no error.

◆ configSupplyCurrentLimit() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configSupplyCurrentLimit ( SupplyCurrentLimitConfiguration  currLimitCfg,
int  timeoutMs 
)
inline

Configures the supply (input) current limit.

Parameters
currLimitCfgCurrent limit configuration
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ configSupplyCurrentLimit() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configSupplyCurrentLimit ( SupplyCurrentLimitConfiguration  currLimitCfg)
inline

Configures the supply (input) current limit.

Parameters
currLimitCfgCurrent limit configuration
Returns
Error Code generated by function. 0 indicates no error.

◆ configurePID() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configurePID ( TalonFXPIDSetConfiguration  pid,
int  pidIdx,
int  timeoutMs 
)
inlineprotected

Configures all PID set persistent settings (overloaded so timeoutMs is 50 ms and pidIdx is 0).

Parameters
pidObject with all of the PID set persistant settings
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configurePID() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.configurePID ( TalonFXPIDSetConfiguration  pid)
inlineprotected

Configures all PID set persistent settings (overloaded so timeoutMs is 50 ms and pidIdx is 0).

Parameters
pidObject with all of the PID set persistant settings
Returns
Error Code generated by function. 0 indicates no error.

◆ getAllConfigs() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.getAllConfigs ( TalonFXConfiguration  allConfigs,
int  timeoutMs 
)
inline

Gets all persistant settings.

Parameters
allConfigsObject with all of the persistant settings
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ getAllConfigs() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonFX.getAllConfigs ( TalonFXConfiguration  allConfigs)
inline

Gets all persistant settings (overloaded so timeoutMs is 50 ms).

Parameters
allConfigsObject with all of the persistant settings
Returns
Error Code generated by function. 0 indicates no error.

◆ getPIDConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.TalonFX.getPIDConfigs ( TalonFXPIDSetConfiguration  pid,
int  pidIdx,
int  timeoutMs 
)
inline

Gets all PID set persistant settings.

Parameters
pidObject with all of the PID set persistant settings
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.

◆ getPIDConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.TalonFX.getPIDConfigs ( TalonFXPIDSetConfiguration  pid)
inline

Gets all PID set persistant settings (overloaded so timeoutMs is 50 ms and pidIdx is 0).

Parameters
pidObject with all of the PID set persistant settings

◆ getSensorCollection()

TalonFXSensorCollection com.ctre.phoenix.motorcontrol.can.TalonFX.getSensorCollection ( )
inline
Returns
object that can get/set individual raw sensor values.

◆ set() [1/2]

void com.ctre.phoenix.motorcontrol.can.TalonFX.set ( TalonFXControlMode  mode,
double  value 
)
inline

Sets the appropriate output on the talon, depending on the mode.

Parameters
modeThe output mode to apply. In PercentOutput, the output is between -1.0 and 1.0, with 0.0 as stopped. In Current mode, output value is in amperes. In Velocity mode, output value is in position change / 100ms. In Position mode, output value is in encoder ticks or an analog value, depending on the sensor. In Follower mode, the output value is the integer device ID of the talon to duplicate.
valueThe setpoint value, as described above.

Standard Driving Example: _talonLeft.set(ControlMode.PercentOutput, leftJoy); _talonRght.set(ControlMode.PercentOutput, rghtJoy);

◆ set() [2/2]

void com.ctre.phoenix.motorcontrol.can.TalonFX.set ( TalonFXControlMode  mode,
double  demand0,
DemandType  demand1Type,
double  demand1 
)
inline
Parameters
modeSets the appropriate output on the talon, depending on the mode.
demand0The output value to apply. such as advanced feed forward and/or auxiliary close-looping in firmware. In PercentOutput, the output is between -1.0 and 1.0, with 0.0 as stopped. In Current mode, output value is in amperes. In Velocity mode, output value is in position change / 100ms. In Position mode, output value is in encoder ticks or an analog value, depending on the sensor. See In Follower mode, the output value is the integer device ID of the talon to duplicate.
demand1TypeThe demand type for demand1. Neutral: Ignore demand1 and apply no change to the demand0 output. AuxPID: Use demand1 to set the target for the auxiliary PID 1. Auxiliary PID is always executed as standard Position PID control. ArbitraryFeedForward: Use demand1 as an arbitrary additive value to the demand0 output. In PercentOutput the demand0 output is the motor output, and in closed-loop modes the demand0 output is the output of PID0.
demand1Supplmental output value. AuxPID: Target position in Sensor Units ArbitraryFeedForward: Percent Output between -1.0 and 1.0

Arcade Drive Example: _talonLeft.set(ControlMode.PercentOutput, joyForward, DemandType.ArbitraryFeedForward, +joyTurn); _talonRght.set(ControlMode.PercentOutput, joyForward, DemandType.ArbitraryFeedForward, -joyTurn);

Drive Straight Example: Note: Selected Sensor Configuration is necessary for both PID0 and PID1. _talonLeft.follow(_talonRght, FollwerType.AuxOutput1); _talonRght.set(ControlMode.PercentOutput, joyForward, DemandType.AuxPID, desiredRobotHeading);

Drive Straight to a Distance Example: Note: Other configurations (sensor selection, PID gains, etc.) need to be set. _talonLeft.follow(_talonRght, FollwerType.AuxOutput1); _talonRght.set(ControlMode.MotionMagic, targetDistance, DemandType.AuxPID, desiredRobotHeading);

◆ setInverted()

void com.ctre.phoenix.motorcontrol.can.TalonFX.setInverted ( TalonFXInvertType  invertType)
inline

Inverts the hbridge output of the motor controller in relation to the master if present

This does not impact sensor phase and should not be used to correct sensor polarity.

This will allow you to either:

  • Spin counterclockwise (default)
  • Spin Clockwise (invert direction)
  • Always follow the master regardless of master's inversion
  • Always oppose the master regardless of master's inversion
Parameters
invertTypeInvert state to set.

The documentation for this class was generated from the following file: