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

Inherits com.ctre.phoenix.motorcontrol.can.BaseMotorController, and com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

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

Public Member Functions

 TalonSRX (int deviceNumber)
 
SensorCollection getSensorCollection ()
 
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 ()
 
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 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)
 
ErrorCode configurePID (TalonSRXPIDSetConfiguration pid, int pidIdx, int timeoutMs, boolean enableOptimizations)
 
ErrorCode configurePID (TalonSRXPIDSetConfiguration pid)
 
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.BaseMotorController
 BaseMotorController (int arbId)
 
ErrorCode DestroyObject ()
 
long getHandle ()
 
int getDeviceID ()
 
void set (ControlMode mode, double outputValue)
 
void set (ControlMode mode, double demand0, double demand1)
 
void set (ControlMode mode, double demand0, DemandType demand1Type, double demand1)
 
void neutralOutput ()
 
void setNeutralMode (NeutralMode neutralMode)
 
void enableHeadingHold (boolean enable)
 
void selectDemandType (boolean value)
 
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)
 
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 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)
 
int getSelectedSensorPosition (int pidIdx)
 
int getSelectedSensorPosition ()
 
int getSelectedSensorVelocity (int pidIdx)
 
int getSelectedSensorVelocity ()
 
ErrorCode setSelectedSensorPosition (int sensorPos, int pidIdx, int timeoutMs)
 
ErrorCode setSelectedSensorPosition (int 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 (int forwardSensorLimit, int timeoutMs)
 
ErrorCode configForwardSoftLimitThreshold (int forwardSensorLimit)
 
ErrorCode configReverseSoftLimitThreshold (int reverseSensorLimit, int timeoutMs)
 
ErrorCode configReverseSoftLimitThreshold (int 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, int izone, int timeoutMs)
 
ErrorCode config_IntegralZone (int slotIdx, int izone)
 
ErrorCode configAllowableClosedloopError (int slotIdx, int allowableClosedLoopError, int timeoutMs)
 
ErrorCode configAllowableClosedloopError (int slotIdx, int 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)
 
int getClosedLoopError (int pidIdx)
 
int 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 ()
 
int getActiveTrajectoryPosition ()
 
int getActiveTrajectoryPosition (int pidIdx)
 
int getActiveTrajectoryVelocity ()
 
int getActiveTrajectoryVelocity (int pidIdx)
 
double getActiveTrajectoryHeading ()
 
double getActiveTrajectoryArbFeedFwd ()
 
double getActiveTrajectoryArbFeedFwd (int pidIdx)
 
ErrorCode configMotionCruiseVelocity (int sensorUnitsPer100ms, int timeoutMs)
 
ErrorCode configMotionCruiseVelocity (int sensorUnitsPer100ms)
 
ErrorCode configMotionAcceleration (int sensorUnitsPer100msPerSec, int timeoutMs)
 
ErrorCode configMotionAcceleration (int 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)
 

Additional Inherited Members

- Protected Member Functions inherited from com.ctre.phoenix.motorcontrol.can.BaseMotorController
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)
 
- 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 peristant 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 peristant 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).

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.

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ 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).

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.

◆ configForwardLimitSwitchSource() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configForwardLimitSwitchSource ( LimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  timeoutMs 
)
inline

Configures a limit switch for a local/remote source.

For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon, CANifier, or local Gadgeteer feedback connector.

If the sensor is remote, a device ID of zero is assumed. If that's not desired, use the four parameter version of this function.

Parameters
typeLimit switch source. User can choose between the feedback connector, remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
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.

◆ configForwardLimitSwitchSource() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configForwardLimitSwitchSource ( LimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose 
)
inline

Configures a limit switch for a local/remote source.

For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon, CANifier, or local Gadgeteer feedback connector.

If the sensor is remote, a device ID of zero is assumed. If that's not desired, use the four parameter version of this function.

Parameters
typeLimit switch source. User can choose between the feedback connector, remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
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).

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.

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ configPeakCurrentDuration() [2/2]

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

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

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).

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.

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ configPeakCurrentLimit() [2/2]

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

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

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.

◆ configReverseLimitSwitchSource() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configReverseLimitSwitchSource ( LimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  timeoutMs 
)
inline

Configures a limit switch for a local/remote source.

For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon, CANifier, or local Gadgeteer feedback connector.

If the sensor is remote, a device ID of zero is assumed. If that's not desired, use the four parameter version of this function.

Parameters
typeLimit switch source.
See also
com.ctre.phoenix.motorcontrol.LimitSwitchSource User can choose between the feedback connector, remote Talon SRX, CANifier, or deactivate the feature.
Parameters
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
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.

◆ configReverseLimitSwitchSource() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configReverseLimitSwitchSource ( LimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose 
)
inline

Configures a limit switch for a local/remote source.

For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon, CANifier, or local Gadgeteer feedback connector.

If the sensor is remote, a device ID of zero is assumed. If that's not desired, use the four parameter version of this function.

Parameters
typeLimit switch source.
See also
com.ctre.phoenix.motorcontrol.LimitSwitchSource User can choose between the feedback connector, remote Talon SRX, CANifier, or deactivate the feature.
Parameters
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
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,
boolean  enableOptimizations 
)
inline

Configures all PID set peristant 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.
enableOptimizationsEnable the optimization technique
Returns
Error Code generated by function. 0 indicates no error.

◆ configurePID() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configurePID ( TalonSRXPIDSetConfiguration  pid)
inline

Configures all PID set peristant 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.

◆ configVelocityMeasurementPeriod() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configVelocityMeasurementPeriod ( VelocityMeasPeriod  period,
int  timeoutMs 
)
inline

Configures the period of each velocity sample. Every 1ms a position value is sampled, and the delta between that sample and the position sampled kPeriod ms ago is inserted into a filter. kPeriod is configured with this function.

Parameters
periodDesired period for the velocity measurement.
See also
com.ctre.phoenix.motorcontrol.VelocityMeasPeriod
Parameters
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.

◆ configVelocityMeasurementPeriod() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configVelocityMeasurementPeriod ( VelocityMeasPeriod  period)
inline

Configures the period of each velocity sample. Every 1ms a position value is sampled, and the delta between that sample and the position sampled kPeriod ms ago is inserted into a filter. kPeriod is configured with this function.

Parameters
periodDesired period for the velocity measurement.
See also
com.ctre.phoenix.motorcontrol.VelocityMeasPeriod
Returns
Error Code generated by function. 0 indicates no error.

◆ configVelocityMeasurementWindow() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configVelocityMeasurementWindow ( int  windowSize,
int  timeoutMs 
)
inline

Sets the number of velocity samples used in the rolling average velocity measurement.

Parameters
windowSizeNumber of samples in the rolling average of velocity measurement. Valid values are 1,2,4,8,16,32. If another value is specified, it will truncate to nearest support value.
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.

◆ configVelocityMeasurementWindow() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.configVelocityMeasurementWindow ( int  windowSize)
inline

Sets the number of velocity samples used in the rolling average velocity measurement.

Parameters
windowSizeNumber of samples in the rolling average of velocity measurement. Valid values are 1,2,4,8,16,32. If another value is specified, it will truncate to nearest support value.
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.

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

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ 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

◆ getOutputCurrent()

double com.ctre.phoenix.motorcontrol.can.TalonSRX.getOutputCurrent ( )
inline

Gets the output current of the motor controller.

Returns
The output current (in amps).

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ 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.

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ getStatusFramePeriod() [1/2]

int com.ctre.phoenix.motorcontrol.can.TalonSRX.getStatusFramePeriod ( StatusFrameEnhanced  frame,
int  timeoutMs 
)
inline

Gets the period of the given status frame.

Parameters
frameFrame to get the period of.
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
Period of the given status frame.

Implements com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.

◆ getStatusFramePeriod() [2/2]

int com.ctre.phoenix.motorcontrol.can.TalonSRX.getStatusFramePeriod ( StatusFrameEnhanced  frame)
inline

Gets the period of the given status frame.

Parameters
frameFrame to get the period of.
Returns
Period of the given status frame.

◆ setStatusFramePeriod() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.setStatusFramePeriod ( StatusFrameEnhanced  frame,
int  periodMs,
int  timeoutMs 
)
inline

Sets the period of the given status frame.

User ensure CAN Bus utilization is not high.

This setting is not persistent and is lost when device is reset. If this is a concern, calling application can use hasResetOccurred() to determine if the status frame needs to be reconfigured.

Parameters
frameFrame whose period is to be changed.
periodMsPeriod in ms for the given frame.
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.

◆ setStatusFramePeriod() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.TalonSRX.setStatusFramePeriod ( StatusFrameEnhanced  frame,
int  periodMs 
)
inline

Sets the period of the given status frame.

User ensure CAN Bus utilization is not high.

This setting is not persistent and is lost when device is reset. If this is a concern, calling application can use hasResetOccurred() to determine if the status frame needs to be reconfigured.

Parameters
frameFrame whose period is to be changed.
periodMsPeriod in ms for the given frame.
Returns
Error Code generated by function. 0 indicates no error.

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