CTRE_Phoenix 5.20.2
com.ctre.phoenix.motorcontrol.can.BaseTalon Class Reference

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

Inherited by com.ctre.phoenix.motorcontrol.can.TalonFX, and com.ctre.phoenix.motorcontrol.can.TalonSRX.

Public Member Functions

 BaseTalon (int deviceNumber, String model, String canbus)
 
 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 (SensorVelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (SensorVelocityMeasPeriod period)
 
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, String canbus)
 
 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 configRemoteFeedbackFilter (BaseTalon talonRef, int remoteOrdinal, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (BaseTalon talonRef, 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 (SensorVelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (SensorVelocityMeasPeriod period)
 
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)
 
void set (ControlMode Mode, double demand)
 
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 configOpenloopRamp (double secondsFromNeutralToFull, int timeoutMs)
 
ErrorCode configClosedloopRamp (double secondsFromNeutralToFull, int timeoutMs)
 
ErrorCode configPeakOutputForward (double percentOut, int timeoutMs)
 
ErrorCode configPeakOutputReverse (double percentOut, int timeoutMs)
 
ErrorCode configNominalOutputForward (double percentOut, int timeoutMs)
 
ErrorCode configNominalOutputReverse (double percentOut, int timeoutMs)
 
ErrorCode configNeutralDeadband (double percentDeadband, int timeoutMs)
 
ErrorCode configVoltageCompSaturation (double voltage, int timeoutMs)
 
ErrorCode configVoltageMeasurementFilter (int filterWindowSamples, int timeoutMs)
 
void enableVoltageCompensation (boolean enable)
 
double getBusVoltage ()
 
double getMotorOutputPercent ()
 
double getMotorOutputVoltage ()
 
double getTemperature ()
 
ErrorCode configSelectedFeedbackSensor (RemoteFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSelectedFeedbackCoefficient (double coefficient, int pidIdx, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (int deviceID, RemoteSensorSource remoteSensorSource, int remoteOrdinal, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (CANCoder canCoderRef, int remoteOrdinal, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (BaseTalon talonRef, int remoteOrdinal, int timeoutMs)
 
ErrorCode configSensorTerm (SensorTerm sensorTerm, FeedbackDevice feedbackDevice, int timeoutMs)
 
double getSelectedSensorPosition (int pidIdx)
 
double getSelectedSensorVelocity (int pidIdx)
 
ErrorCode setSelectedSensorPosition (double sensorPos, int pidIdx, int timeoutMs)
 
ErrorCode setControlFramePeriod (ControlFrame frame, int periodMs)
 
ErrorCode setStatusFramePeriod (StatusFrame frame, int periodMs, int timeoutMs)
 
int getStatusFramePeriod (StatusFrame frame, int timeoutMs)
 
ErrorCode configForwardLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs)
 
void overrideLimitSwitchesEnable (boolean enable)
 
ErrorCode configForwardSoftLimitThreshold (double forwardSensorLimit, int timeoutMs)
 
ErrorCode configReverseSoftLimitThreshold (double reverseSensorLimit, int timeoutMs)
 
ErrorCode configForwardSoftLimitEnable (boolean enable, int timeoutMs)
 
ErrorCode configReverseSoftLimitEnable (boolean enable, int timeoutMs)
 
void overrideSoftLimitsEnable (boolean enable)
 
ErrorCode config_kP (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kI (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kD (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kF (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_IntegralZone (int slotIdx, double izone, int timeoutMs)
 
ErrorCode configAllowableClosedloopError (int slotIdx, double allowableCloseLoopError, int timeoutMs)
 
ErrorCode configMaxIntegralAccumulator (int slotIdx, double iaccum, int timeoutMs)
 
ErrorCode configClosedLoopPeakOutput (int slotIdx, double percentOut, int timeoutMs)
 
ErrorCode configClosedLoopPeriod (int slotIdx, int loopTimeMs, int timeoutMs)
 
ErrorCode configAuxPIDPolarity (boolean invert, int timeoutMs)
 
ErrorCode setIntegralAccumulator (double iaccum, int pidIdx, int timeoutMs)
 
double getClosedLoopError (int pidIdx)
 
double getIntegralAccumulator (int pidIdx)
 
double getErrorDerivative (int pidIdx)
 
void selectProfileSlot (int slotIdx, int pidIdx)
 
double getClosedLoopTarget (int pidIdx)
 
double getActiveTrajectoryPosition ()
 
double getActiveTrajectoryVelocity ()
 
ErrorCode configMotionCruiseVelocity (double sensorUnitsPer100ms, int timeoutMs)
 
ErrorCode configMotionAcceleration (double sensorUnitsPer100msPerSec, int timeoutMs)
 
ErrorCode configMotionSCurveStrength (int curveStrength, int timeoutMs)
 
ErrorCode configMotionProfileTrajectoryPeriod (int baseTrajDurationMs, int timeoutMs)
 
ErrorCode clearMotionProfileTrajectories ()
 
int getMotionProfileTopLevelBufferCount ()
 
ErrorCode pushMotionProfileTrajectory (TrajectoryPoint trajPt)
 
boolean isMotionProfileTopLevelBufferFull ()
 
void processMotionProfileBuffer ()
 
ErrorCode getMotionProfileStatus (MotionProfileStatus statusToFill)
 
ErrorCode clearMotionProfileHasUnderrun (int timeoutMs)
 
ErrorCode changeMotionControlFramePeriod (int periodMs)
 
ErrorCode getLastError ()
 
ErrorCode getFaults (Faults toFill)
 
ErrorCode getStickyFaults (StickyFaults toFill)
 
ErrorCode clearStickyFaults (int timeoutMs)
 
int getFirmwareVersion ()
 
boolean hasResetOccurred ()
 
ErrorCode configSetCustomParam (int newValue, int paramIndex, int timeoutMs)
 
int configGetCustomParam (int paramIndex, int timeoutMs)
 
ErrorCode configSetParameter (ParamEnum param, double value, int subValue, int ordinal, int timeoutMs)
 
ErrorCode configSetParameter (int param, double value, int subValue, int ordinal, int timeoutMs)
 
double configGetParameter (ParamEnum paramEnum, int ordinal, int timeoutMs)
 
double configGetParameter (int paramEnum, int ordinal, int timeoutMs)
 
int getBaseID ()
 
int getDeviceID ()
 
ControlMode getControlMode ()
 
void setInverted (boolean invert)
 
boolean getInverted ()
 
void follow (IMotorController masterToFollow)
 
void valueUpdated ()
 
- Public Member Functions inherited from com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced
ErrorCode configSelectedFeedbackSensor (FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitCfg, int timeoutMs)
 
ErrorCode setStatusFramePeriod (StatusFrameEnhanced frame, int periodMs, int timeoutMs)
 
int getStatusFramePeriod (StatusFrameEnhanced frame, int timeoutMs)
 
double getOutputCurrent ()
 
ErrorCode configVelocityMeasurementPeriod (SensorVelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementWindow (int windowSize, int timeoutMs)
 
ErrorCode configForwardLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
 

Protected Member Functions

SensorCollection getTalonSRXSensorCollection ()
 
TalonFXSensorCollection getTalonFXSensorCollection ()
 
TalonSRXSimCollection getTalonSRXSimCollection ()
 
TalonFXSimCollection getTalonFXSimCollection ()
 
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

◆ BaseTalon() [1/2]

com.ctre.phoenix.motorcontrol.can.BaseTalon.BaseTalon ( int  deviceNumber,
String  model,
String  canbus 
)
inline

Constructor for BaseTalon object

Parameters
deviceNumberCAN Device ID of Device

◆ BaseTalon() [2/2]

com.ctre.phoenix.motorcontrol.can.BaseTalon.BaseTalon ( int  deviceNumber,
String  model 
)
inline

Constructor for BaseTalon object

Parameters
deviceNumberCAN Device ID of Device

Member Function Documentation

◆ configAllSettings() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.configAllSettings ( BaseTalonConfiguration  allConfigs)
inlineprotected

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.

◆ configAllSettings() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.configAllSettings ( BaseTalonConfiguration  allConfigs,
int  timeoutMs 
)
inlineprotected

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.

◆ configForwardLimitSwitchSource() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ configForwardLimitSwitchSource() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ configReverseLimitSwitchSource() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

◆ configReverseLimitSwitchSource() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

◆ configSupplyCurrentLimit()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Reimplemented in com.ctre.phoenix.motorcontrol.can.TalonFX, and com.ctre.phoenix.motorcontrol.can.TalonSRX.

◆ configurePID() [1/2]

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

◆ configurePID() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.configurePID ( BaseTalonPIDSetConfiguration  pid,
int  pidIdx,
int  timeoutMs,
boolean  enableOptimizations 
)
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.
enableOptimizationsEnable the optimization technique
Returns
Error Code generated by function. 0 indicates no error.

◆ configVelocityMeasurementPeriod() [1/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.configVelocityMeasurementPeriod ( SensorVelocityMeasPeriod  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.sensors.SensorVelocityMeasPeriod
Returns
Error Code generated by function. 0 indicates no error.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ configVelocityMeasurementPeriod() [2/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.configVelocityMeasurementPeriod ( SensorVelocityMeasPeriod  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.sensors.SensorVelocityMeasPeriod
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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ configVelocityMeasurementPeriod() [3/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Deprecated:
Use the overload with SensorVelocityMeasPeriod instead.
Parameters
periodDesired period for the velocity measurement.
See also
com.ctre.phoenix.motorcontrol.VelocityMeasPeriod
Returns
Error Code generated by function. 0 indicates no error.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ configVelocityMeasurementPeriod() [4/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Deprecated:
Use the overload with SensorVelocityMeasPeriod instead.
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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ configVelocityMeasurementWindow() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ configVelocityMeasurementWindow() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ getAllConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.BaseTalon.getAllConfigs ( BaseTalonConfiguration  allConfigs)
inlineprotected

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

Parameters
allConfigsObject with all of the persistant settings

◆ getAllConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.BaseTalon.getAllConfigs ( BaseTalonConfiguration  allConfigs,
int  timeoutMs 
)
inlineprotected

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.

◆ getOutputCurrent()

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

Gets the output current of the motor controller. In the case of TalonSRX class, this routine returns supply current for legacy reasons. In order to get the "true" output current, call GetStatorCurrent(). In the case of TalonFX class, this routine returns the true output stator current.

Deprecated:
Use getStatorCurrent/getSupplyCurrent instead.
Returns
The output current (in amps).

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ getPIDConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.BaseTalon.getPIDConfigs ( BaseTalonPIDSetConfiguration  pid)
inlineprotected

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

◆ getPIDConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.BaseTalon.getPIDConfigs ( BaseTalonPIDSetConfiguration  pid,
int  pidIdx,
int  timeoutMs 
)
inlineprotected

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.

◆ getStatorCurrent()

double com.ctre.phoenix.motorcontrol.can.BaseTalon.getStatorCurrent ( )
inline

Gets the stator/output current of the motor controller.

Returns
The stator/output current (in amps).

◆ getStatusFramePeriod() [1/2]

int com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ getStatusFramePeriod() [2/2]

int com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

Reimplemented from com.ctre.phoenix.motorcontrol.can.BaseMotorController.

◆ getSupplyCurrent()

double com.ctre.phoenix.motorcontrol.can.BaseTalon.getSupplyCurrent ( )
inline

Gets the supply/input current of the motor controller.

Returns
The supply/input current (in amps).

◆ isFwdLimitSwitchClosed()

int com.ctre.phoenix.motorcontrol.can.BaseTalon.isFwdLimitSwitchClosed ( )
inline

Is forward limit switch closed.

Returns
'1' iff forward limit switch input is closed, 0 iff switch is open. This function works regardless if limit switch feature is enabled. Remote limit features do not impact this routine.

◆ isRevLimitSwitchClosed()

int com.ctre.phoenix.motorcontrol.can.BaseTalon.isRevLimitSwitchClosed ( )
inline

Is reverse limit switch closed.

Returns
'1' iff reverse limit switch is closed, 0 iff switch is open. This function works regardless if limit switch feature is enabled. Remote limit features do not impact this routine.

◆ setStatusFramePeriod() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.

◆ setStatusFramePeriod() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseTalon.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.


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