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

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

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

Public Member Functions

 TalonSRX (int deviceNumber)
 
void set (TalonSRXControlMode mode, double value)
 
void set (TalonSRXControlMode mode, double demand0, DemandType demand1Type, double demand1)
 
SensorCollection getSensorCollection ()
 
TalonSRXSimCollection getSimCollection ()
 
ErrorCode configSelectedFeedbackSensor (TalonSRXFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitConfigs, int timeoutMs)
 
ErrorCode configSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitConfigs)
 
ErrorCode configPeakCurrentLimit (int amps, int timeoutMs)
 
ErrorCode configPeakCurrentLimit (int amps)
 
ErrorCode configPeakCurrentDuration (int milliseconds, int timeoutMs)
 
ErrorCode configPeakCurrentDuration (int milliseconds)
 
ErrorCode configContinuousCurrentLimit (int amps, int timeoutMs)
 
ErrorCode configContinuousCurrentLimit (int amps)
 
void enableCurrentLimit (boolean enable)
 
void getPIDConfigs (TalonSRXPIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
void getPIDConfigs (TalonSRXPIDSetConfiguration pid)
 
ErrorCode configAllSettings (TalonSRXConfiguration allConfigs, int timeoutMs)
 
ErrorCode configAllSettings (TalonSRXConfiguration allConfigs)
 
void getAllConfigs (TalonSRXConfiguration allConfigs, int timeoutMs)
 
void getAllConfigs (TalonSRXConfiguration 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 (TalonSRXPIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
ErrorCode configurePID (TalonSRXPIDSetConfiguration 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
 

Detailed Description

CTRE Talon SRX Motor Controller when used on CAN Bus.

Constructor & Destructor Documentation

◆ TalonSRX()

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

Constructor for TalonSRX object

Parameters
deviceNumberCAN Device ID of Device

Member Function Documentation

◆ configAllSettings() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configAllSettings ( TalonSRXConfiguration  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.TalonSRX.configAllSettings ( TalonSRXConfiguration  allConfigs)
inline

Configures all persistent 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.

◆ configContinuousCurrentLimit() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configContinuousCurrentLimit ( int  amps,
int  timeoutMs 
)
inline

Configure the continuous allowable current-draw (when current limit is enabled).

Supply current limiting is also available via configSupplyCurrentLimit(), which is a common routine with Talon FX.

Current limit is activated when current exceeds the peak limit for longer than the peak duration. Then software will limit to the continuous limit. This ensures current limiting while allowing for momentary excess current events.

For simpler current-limiting (single threshold) use ConfigContinuousCurrentLimit() and set the peak to zero: ConfigPeakCurrentLimit(0).

Parameters
ampsAmperes to limit.
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.

◆ configContinuousCurrentLimit() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configContinuousCurrentLimit ( int  amps)
inline

Configure the continuous allowable current-draw (when current limit is enabled).

Supply current limiting is also available via configSupplyCurrentLimit(), which is a common routine with Talon FX.

Current limit is activated when current exceeds the peak limit for longer than the peak duration. Then software will limit to the continuous limit. This ensures current limiting while allowing for momentary excess current events.

For simpler current-limiting (single threshold) use ConfigContinuousCurrentLimit() and set the peak to zero: ConfigPeakCurrentLimit(0).

Parameters
ampsAmperes to limit.
Returns
Error Code generated by function. 0 indicates no error.

◆ configPeakCurrentDuration() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configPeakCurrentDuration ( int  milliseconds,
int  timeoutMs 
)
inline

Configure the peak allowable duration (when current limit is enabled).

Supply current limiting is also available via configSupplyCurrentLimit(), which is a common routine with Talon FX.

Current limit is activated when current exceeds the peak limit for longer than the peak duration. Then software will limit to the continuous limit. This ensures current limiting while allowing for momentary excess current events.

For simpler current-limiting (single threshold) use ConfigContinuousCurrentLimit() and set the peak to zero: ConfigPeakCurrentLimit(0).

Parameters
millisecondsHow long to allow current-draw past peak limit.
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.

◆ configPeakCurrentDuration() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configPeakCurrentDuration ( int  milliseconds)
inline

Configure the peak allowable duration (when current limit is enabled).

Supply current limiting is also available via configSupplyCurrentLimit(), which is a common routine with Talon FX.

Current limit is activated when current exceeds the peak limit for longer than the peak duration. Then software will limit to the continuous limit. This ensures current limiting while allowing for momentary excess current events.

For simpler current-limiting (single threshold) use ConfigContinuousCurrentLimit() and set the peak to zero: ConfigPeakCurrentLimit(0).

Parameters
millisecondsHow long to allow current-draw past peak limit.
Returns
Error Code generated by function. 0 indicates no error.

◆ configPeakCurrentLimit() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configPeakCurrentLimit ( int  amps,
int  timeoutMs 
)
inline

Configure the peak allowable current (when current limit is enabled).

Supply current limiting is also available via configSupplyCurrentLimit(), which is a common routine with Talon FX.

Current limit is activated when current exceeds the peak limit for longer than the peak duration. Then software will limit to the continuous limit. This ensures current limiting while allowing for momentary excess current events.

For simpler current-limiting (single threshold) use ConfigContinuousCurrentLimit() and set the peak to zero: ConfigPeakCurrentLimit(0).

Parameters
ampsAmperes to limit.
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.

◆ configPeakCurrentLimit() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configPeakCurrentLimit ( int  amps)
inline

Configure the peak allowable current (when current limit is enabled).

Supply current limiting is also available via configSupplyCurrentLimit(), which is a common routine with Talon FX.

Current limit is activated when current exceeds the peak limit for longer than the peak duration. Then software will limit to the continuous limit. This ensures current limiting while allowing for momentary excess current events.

For simpler current-limiting (single threshold) use ConfigContinuousCurrentLimit() and set the peak to zero: ConfigPeakCurrentLimit(0).

Parameters
ampsAmperes to limit.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSelectedFeedbackSensor()

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

Select the feedback device for the motor controller.

Parameters
feedbackDeviceTalon SRX 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.

◆ configSupplyCurrentLimit() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configSupplyCurrentLimit ( SupplyCurrentLimitConfiguration  currLimitConfigs,
int  timeoutMs 
)
inline

Configures the supply (input) current limit.

Parameters
currLimitConfigsCurrent 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.TalonSRX.configSupplyCurrentLimit ( SupplyCurrentLimitConfiguration  currLimitConfigs)
inline

Configures the supply (input) current limit.

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

◆ configurePID() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configurePID ( TalonSRXPIDSetConfiguration  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.TalonSRX.configurePID ( TalonSRXPIDSetConfiguration  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.

◆ enableCurrentLimit()

void com.ctre.phoenix.motorcontrol.can.TalonSRX.enableCurrentLimit ( boolean  enable)
inline

Enable or disable Current Limit.

Supply current limiting is also available via configSupplyCurrentLimit(), which is a common routine with Talon FX.

Parameters
enableEnable state of current limit.
See also
configPeakCurrentLimit(int,int)
configPeakCurrentDuration(int,int)
configContinuousCurrentLimit(int,int)

◆ getAllConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.TalonSRX.getAllConfigs ( TalonSRXConfiguration  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.

◆ getAllConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.TalonSRX.getAllConfigs ( TalonSRXConfiguration  allConfigs)
inline

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

Parameters
allConfigsObject with all of the persistant settings

◆ getPIDConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.TalonSRX.getPIDConfigs ( TalonSRXPIDSetConfiguration  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.TalonSRX.getPIDConfigs ( TalonSRXPIDSetConfiguration  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()

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

◆ getSimCollection()

TalonSRXSimCollection com.ctre.phoenix.motorcontrol.can.TalonSRX.getSimCollection ( )
inline
Returns
object that can get/set simulation inputs.

◆ set() [1/2]

void com.ctre.phoenix.motorcontrol.can.TalonSRX.set ( TalonSRXControlMode  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.TalonSRX.set ( TalonSRXControlMode  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);


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