CTRE_Phoenix  5.14.0
com.ctre.phoenix.motorcontrol.can.BaseMotorController Class Referenceabstract

Inherits com.ctre.phoenix.motorcontrol.IMotorController.

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

Public Member Functions

 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)
 

Protected Member Functions

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

long m_handle
 

Detailed Description

Base motor controller features for all CTRE CAN motor controllers.

Constructor & Destructor Documentation

◆ BaseMotorController()

com.ctre.phoenix.motorcontrol.can.BaseMotorController.BaseMotorController ( int  arbId)
inline

Constructor for motor controllers.

Parameters
arbId

Member Function Documentation

◆ baseConfigAllSettings()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.baseConfigAllSettings ( BaseMotorControllerConfiguration  allConfigs,
int  timeoutMs 
)
inlineprotected

Configures all base persistant settings.

Parameters
allConfigsObject with all of the base 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.

◆ baseConfigurePID()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.baseConfigurePID ( BasePIDSetConfiguration  pid,
int  pidIdx,
int  timeoutMs 
)
inlineprotected

Configures all base PID set persistant settings.

Parameters
pidObject with all of the base 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.

◆ baseGetAllConfigs()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.baseGetAllConfigs ( BaseMotorControllerConfiguration  allConfigs,
int  timeoutMs 
)
inlineprotected

Gets all base persistant settings.

Parameters
allConfigsObject with all of the base 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.

◆ baseGetPIDConfigs()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.baseGetPIDConfigs ( BasePIDSetConfiguration  pid,
int  pidIdx,
int  timeoutMs 
)
inlineprotected

Gets all base PID set persistant settings.

Parameters
pidObject with all of the base 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.

◆ changeMotionControlFramePeriod()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.changeMotionControlFramePeriod ( int  periodMs)
inline

Calling application can opt to speed up the handshaking between the robot API and the controller to increase the download rate of the controller's Motion Profile. Ideally the period should be no more than half the period of a trajectory point.

Parameters
periodMsThe transmit period in ms.
Returns
Error Code generated by function. 0 indicates no error.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ clearMotionProfileHasUnderrun() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.clearMotionProfileHasUnderrun ( int  timeoutMs)
inline

Clear the "Has Underrun" flag. Typically this is called after application has confirmed an underrun had occured.

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

◆ clearMotionProfileHasUnderrun() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.clearMotionProfileHasUnderrun ( )
inline

Clear the "Has Underrun" flag. Typically this is called after application has confirmed an underrun had occured.

Returns
Error Code generated by function. 0 indicates no error.

◆ clearMotionProfileTrajectories()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.clearMotionProfileTrajectories ( )
inline

Clear the buffered motion profile in both controller's RAM (bottom), and in the API (top).

Returns
Error Code generated by function. 0 indicates no error.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ clearStickyFaults() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.clearStickyFaults ( int  timeoutMs)
inline

Clears all sticky faults.

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
Last Error Code generated by a function.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ clearStickyFaults() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.clearStickyFaults ( )
inline

Clears all sticky faults.

Returns
Last Error Code generated by a function.

◆ config_IntegralZone() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_IntegralZone ( int  slotIdx,
int  izone,
int  timeoutMs 
)
inline

Sets the Integral Zone constant in the given parameter slot. If the (absolute) closed-loop error is outside of this zone, integral accumulator is automatically cleared. This ensures than integral wind up events will stop after the sensor gets far enough from its target.

Parameters
slotIdxParameter slot for the constant.
izoneValue of the Integral Zone constant (closed loop error units X 1ms).
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.IMotorController.

◆ config_IntegralZone() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_IntegralZone ( int  slotIdx,
int  izone 
)
inline

Sets the Integral Zone constant in the given parameter slot. If the (absolute) closed-loop error is outside of this zone, integral accumulator is automatically cleared. This ensures than integral wind up events will stop after the sensor gets far enough from its target.

Parameters
slotIdxParameter slot for the constant.
izoneValue of the Integral Zone constant (closed loop error units X 1ms).
Returns
Error Code generated by function. 0 indicates no error.

◆ config_kD() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kD ( int  slotIdx,
double  value,
int  timeoutMs 
)
inline

Sets the 'D' constant in the given parameter slot.

This is multiplied by derivative error (sensor units per PID loop, typically 1ms). Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '250' to get full output if derr is 4096u (Mag Encoder 1 rotation) per 1000 loops (typ 1 sec)

Parameters
slotIdxParameter slot for the constant.
valueValue of the D constant.
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.IMotorController.

◆ config_kD() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kD ( int  slotIdx,
double  value 
)
inline

Sets the 'D' constant in the given parameter slot.

This is multiplied by derivative error (sensor units per PID loop, typically 1ms). Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '250' to get full output if derr is 4096u (Mag Encoder 1 rotation) per 1000 loops (typ 1 sec)

Parameters
slotIdxParameter slot for the constant.
valueValue of the D constant.
Returns
Error Code generated by function. 0 indicates no error.

◆ config_kF() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kF ( int  slotIdx,
double  value,
int  timeoutMs 
)
inline

Sets the 'F' constant in the given parameter slot.

See documentation for calculation details. If using velocity, motion magic, or motion profile, use (1023 * duty-cycle / sensor-velocity-sensor-units-per-100ms).

Parameters
slotIdxParameter slot for the constant.
valueValue of the F constant.
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.IMotorController.

◆ config_kF() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kF ( int  slotIdx,
double  value 
)
inline

Sets the 'F' constant in the given parameter slot.

See documentation for calculation details. If using velocity, motion magic, or motion profile, use (1023 * duty-cycle / sensor-velocity-sensor-units-per-100ms).

Parameters
slotIdxParameter slot for the constant.
valueValue of the F constant.
Returns
Error Code generated by function. 0 indicates no error.

◆ config_kI() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kI ( int  slotIdx,
double  value,
int  timeoutMs 
)
inline

Sets the 'I' constant in the given parameter slot. This is multiplied by accumulated closed loop error in sensor units every PID Loop. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.00025' to get full output if err is 4096u for 1000 loops (accumulater holds 4,096,000), [which is equivalent to one CTRE mag encoder rotation for 1000 milliseconds].

Parameters
slotIdxParameter slot for the constant.
valueValue of the I constant.
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.IMotorController.

◆ config_kI() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kI ( int  slotIdx,
double  value 
)
inline

Sets the 'I' constant in the given parameter slot. This is multiplied by accumulated closed loop error in sensor units every PID Loop. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.00025' to get full output if err is 4096u for 1000 loops (accumulater holds 4,096,000), [which is equivalent to one CTRE mag encoder rotation for 1000 milliseconds].

Parameters
slotIdxParameter slot for the constant.
valueValue of the I constant.
Returns
Error Code generated by function. 0 indicates no error.

◆ config_kP() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kP ( int  slotIdx,
double  value,
int  timeoutMs 
)
inline

Sets the 'P' constant in the given parameter slot. This is multiplied by closed loop error in sensor units. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.25' to get full output if err is 4096u (Mag Encoder 1 rotation)

Parameters
slotIdxParameter slot for the constant.
valueValue of the P constant.
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.IMotorController.

◆ config_kP() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.config_kP ( int  slotIdx,
double  value 
)
inline

Sets the 'P' constant in the given parameter slot. This is multiplied by closed loop error in sensor units. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.25' to get full output if err is 4096u (Mag Encoder 1 rotation)

Parameters
slotIdxParameter slot for the constant.
valueValue of the P constant.
Returns
Error Code generated by function. 0 indicates no error.

◆ configAllowableClosedloopError() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configAllowableClosedloopError ( int  slotIdx,
int  allowableClosedLoopError,
int  timeoutMs 
)
inline

Sets the allowable closed-loop error in the given parameter slot.

Parameters
slotIdxParameter slot for the constant.
allowableClosedLoopErrorValue of the allowable closed-loop error in sensor units (or sensor units per 100ms for velocity).
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.IMotorController.

◆ configAllowableClosedloopError() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configAllowableClosedloopError ( int  slotIdx,
int  allowableClosedLoopError 
)
inline

Sets the allowable closed-loop error in the given parameter slot.

Parameters
slotIdxParameter slot for the constant.
allowableClosedLoopErrorValue of the allowable closed-loop error in sensor units (or sensor units per 100ms for velocity).
Returns
Error Code generated by function. 0 indicates no error.

◆ configAuxPIDPolarity() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configAuxPIDPolarity ( boolean  invert,
int  timeoutMs 
)
inline

Configures the Polarity of the Auxiliary PID (PID1).

Standard Polarity: Primary Output = PID0 + PID1, Auxiliary Output = PID0 - PID1,

Inverted Polarity: Primary Output = PID0 - PID1, Auxiliary Output = PID0 + PID1,

Parameters
invertIf true, use inverted PID1 output polarity.
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

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ configAuxPIDPolarity() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configAuxPIDPolarity ( boolean  invert)
inline

Configures the Polarity of the Auxiliary PID (PID1).

Standard Polarity: Primary Output = PID0 + PID1, Auxiliary Output = PID0 - PID1,

Inverted Polarity: Primary Output = PID0 - PID1, Auxiliary Output = PID0 + PID1,

Parameters
invertIf true, use inverted PID1 output polarity.
Returns
Error Code

◆ configClearPositionOnLimitF()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClearPositionOnLimitF ( boolean  clearPositionOnLimitF,
int  timeoutMs 
)
inline

Enables clearing the position of the feedback sensor when the forward limit switch is triggered.

Parameters
clearPositionOnLimitFWhether clearing is enabled, defaults false
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.

◆ configClearPositionOnLimitR()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClearPositionOnLimitR ( boolean  clearPositionOnLimitR,
int  timeoutMs 
)
inline

Enables clearing the position of the feedback sensor when the reverse limit switch is triggered

Parameters
clearPositionOnLimitRWhether clearing is enabled, defaults false
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.

◆ configClearPositionOnQuadIdx()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClearPositionOnQuadIdx ( boolean  clearPositionOnQuadIdx,
int  timeoutMs 
)
inline

Enables clearing the position of the feedback sensor when the quadrature index signal is detected

Parameters
clearPositionOnQuadIdxWhether clearing is enabled, defaults false
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.

◆ configClosedLoopPeakOutput() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClosedLoopPeakOutput ( int  slotIdx,
double  percentOut,
int  timeoutMs 
)
inline

Sets the peak closed-loop output. This peak output is slot-specific and is applied to the output of the associated PID loop. This setting is seperate from the generic Peak Output setting.

Parameters
slotIdxParameter slot for the constant.
percentOutPeak Percent Output from 0 to 1. This value is absolute and the magnitude will apply in both forward and reverse directions.
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.IMotorController.

◆ configClosedLoopPeakOutput() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClosedLoopPeakOutput ( int  slotIdx,
double  percentOut 
)
inline

Sets the peak closed-loop output. This peak output is slot-specific and is applied to the output of the associated PID loop. This setting is seperate from the generic Peak Output setting.

Parameters
slotIdxParameter slot for the constant.
percentOutPeak Percent Output from 0 to 1. This value is absolute and the magnitude will apply in both forward and reverse directions.
Returns
Error Code generated by function. 0 indicates no error.

◆ configClosedLoopPeriod() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClosedLoopPeriod ( int  slotIdx,
int  loopTimeMs,
int  timeoutMs 
)
inline

Sets the loop time (in milliseconds) of the PID closed-loop calculations. Default value is 1 ms.

Parameters
slotIdxParameter slot for the constant.
loopTimeMsLoop timing of the closed-loop calculations. Minimum value of 1 ms, maximum of 64 ms.
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.IMotorController.

◆ configClosedLoopPeriod() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClosedLoopPeriod ( int  slotIdx,
int  loopTimeMs 
)
inline

Sets the loop time (in milliseconds) of the PID closed-loop calculations. Default value is 1 ms.

Parameters
slotIdxParameter slot for the constant.
loopTimeMsLoop timing of the closed-loop calculations. Minimum value of 1 ms, maximum of 64 ms.
Returns
Error Code generated by function. 0 indicates no error.

◆ configClosedloopRamp() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClosedloopRamp ( double  secondsFromNeutralToFull,
int  timeoutMs 
)
inline

Configures the closed-loop ramp rate of throttle output.

Parameters
secondsFromNeutralToFullMinimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
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.IMotorController.

◆ configClosedloopRamp() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configClosedloopRamp ( double  secondsFromNeutralToFull)
inline

Configures the closed-loop ramp rate of throttle output.

Parameters
secondsFromNeutralToFullMinimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
Returns
Error Code generated by function. 0 indicates no error.

◆ configFactoryDefault() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configFactoryDefault ( int  timeoutMs)
inline

Revert all configurations to factory default values. Use this before your individual config* calls to avoid having to config every single param.

Alternatively you can use the configAllSettings routine.

Parameters
timeoutMsTimeout value in ms. Function will generate error if config is not successful within timeout.
Returns
Error Code generated by function. 0 indicates no error.

◆ configFactoryDefault() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configFactoryDefault ( )
inline

Revert all configurations to factory default values. Use this before your individual config* calls to avoid having to config every single param.

Alternatively you can use the configAllSettings routine.

Returns
Error Code generated by function. 0 indicates no error.

◆ configFeedbackNotContinuous()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configFeedbackNotContinuous ( boolean  feedbackNotContinuous,
int  timeoutMs 
)
inline

Disables continuous tracking of the position for analog and pulse-width. If the signal goes from 4095 to 0 (pulse-width) a motor controller will continue to read 4096 by default. If overflow tracking is disabled, it will wrap to 0 (not continuous)

If using pulse-width on CTRE Mag Encoder (within one rotation) or absolute analog sensor (within one rotation), setting feedbackNotContinuous to true is recommended, to prevent intermittent connections from causing sensor "jumps" of 4096 (or 1024 for analog) units.

Parameters
feedbackNotContinuousTrue to disable the overflow tracking.
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/5]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configForwardLimitSwitchSource ( RemoteLimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  deviceID,
int  timeoutMs 
)
inline

Configures the forward limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-F pin of another Talon or CANifier.

Parameters
typeRemote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
deviceIDDevice ID of remote source (Talon SRX or CANifier device ID).
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.IMotorController.

◆ configForwardLimitSwitchSource() [2/5]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configForwardLimitSwitchSource ( RemoteLimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  deviceID 
)
inline

Configures the forward limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-F pin of another Talon or CANifier.

Parameters
typeRemote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
deviceIDDevice ID of remote source (Talon SRX or CANifier device ID).
Returns
Error Code generated by function. 0 indicates no error.

◆ configForwardLimitSwitchSource() [3/5]

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

◆ configForwardLimitSwitchSource() [4/5]

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

◆ configForwardLimitSwitchSource() [5/5]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configForwardLimitSwitchSource ( int  typeValue,
int  normalOpenOrCloseValue,
int  deviceID,
int  timeoutMs 
)
inlineprotected

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
typeValueLimit 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
normalOpenOrCloseValueSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
deviceIDDevice ID of remote source (Talon SRX or CANifier device ID).
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.

◆ configForwardSoftLimitEnable() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configForwardSoftLimitEnable ( boolean  enable,
int  timeoutMs 
)
inline

Configures the forward soft limit enable.

Parameters
enableForward Sensor Position Limit Enable.
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.IMotorController.

◆ configForwardSoftLimitEnable() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configForwardSoftLimitEnable ( boolean  enable)
inline

Configures the forward soft limit enable.

Parameters
enableForward Sensor Position Limit Enable.
Returns
Error Code generated by function. 0 indicates no error.

◆ configForwardSoftLimitThreshold() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configForwardSoftLimitThreshold ( int  forwardSensorLimit,
int  timeoutMs 
)
inline

Configures the forward soft limit threhold.

Parameters
forwardSensorLimitForward Sensor Position Limit (in raw sensor units).
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.IMotorController.

◆ configForwardSoftLimitThreshold() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configForwardSoftLimitThreshold ( int  forwardSensorLimit)
inline

Configures the forward soft limit threhold.

Parameters
forwardSensorLimitForward Sensor Position Limit (in raw sensor units).
Returns
Error Code generated by function. 0 indicates no error.

◆ configGetCustomParam() [1/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.configGetCustomParam ( int  paramIndex,
int  timeoutMs 
)
inline

Gets the value of a custom parameter.

Parameters
paramIndexIndex of custom parameter [0,1].
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
Value of the custom param.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ configGetCustomParam() [2/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.configGetCustomParam ( int  paramIndex)
inline

Gets the value of a custom parameter.

Parameters
paramIndexIndex of custom parameter [0,1].
Returns
Value of the custom param.

◆ configGetParameter() [1/4]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.configGetParameter ( ParamEnum  param,
int  ordinal,
int  timeoutMs 
)
inline

Gets a parameter.

Parameters
paramParameter enumeration.
ordinalOrdinal of parameter.
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
Value of parameter.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ configGetParameter() [2/4]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.configGetParameter ( ParamEnum  param,
int  ordinal 
)
inline

Gets a parameter.

Parameters
paramParameter enumeration.
ordinalOrdinal of parameter.
Returns
Value of parameter.

◆ configGetParameter() [3/4]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.configGetParameter ( int  param,
int  ordinal,
int  timeoutMs 
)
inline

Gets a parameter.

Parameters
paramParameter enumeration.
ordinalOrdinal of parameter.
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
Value of parameter.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ configGetParameter() [4/4]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.configGetParameter ( int  param,
int  ordinal 
)
inline

Gets a parameter.

Parameters
paramParameter enumeration.
ordinalOrdinal of parameter.
Returns
Value of parameter.

◆ configLimitSwitchDisableNeutralOnLOS()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configLimitSwitchDisableNeutralOnLOS ( boolean  limitSwitchDisableNeutralOnLOS,
int  timeoutMs 
)
inline

Disables limit switches triggering (if enabled) when the sensor is no longer detected.

Parameters
limitSwitchDisableNeutralOnLOSdisable triggering
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.

◆ configMaxIntegralAccumulator() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMaxIntegralAccumulator ( int  slotIdx,
double  iaccum,
int  timeoutMs 
)
inline

Sets the maximum integral accumulator in the given parameter slot.

Parameters
slotIdxParameter slot for the constant.
iaccumValue of the maximum integral accumulator (closed loop error units X 1ms).
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.IMotorController.

◆ configMaxIntegralAccumulator() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMaxIntegralAccumulator ( int  slotIdx,
double  iaccum 
)
inline

Sets the maximum integral accumulator in the given parameter slot.

Parameters
slotIdxParameter slot for the constant.
iaccumValue of the maximum integral accumulator (closed loop error units X 1ms).
Returns
Error Code generated by function. 0 indicates no error.

◆ configMotionAcceleration() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionAcceleration ( int  sensorUnitsPer100msPerSec,
int  timeoutMs 
)
inline

Sets the Motion Magic Acceleration. This is the target acceleration that the motion magic curve generator can use.

Parameters
sensorUnitsPer100msPerSecMotion Magic Acceleration (in raw sensor units per 100 ms per second).
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.IMotorController.

◆ configMotionAcceleration() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionAcceleration ( int  sensorUnitsPer100msPerSec)
inline

Sets the Motion Magic Acceleration. This is the target acceleration that the motion magic curve generator can use.

Parameters
sensorUnitsPer100msPerSecMotion Magic Acceleration (in raw sensor units per 100 ms per second).
Returns
Error Code generated by function. 0 indicates no error.

◆ configMotionCruiseVelocity() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionCruiseVelocity ( int  sensorUnitsPer100ms,
int  timeoutMs 
)
inline

Sets the Motion Magic Cruise Velocity. This is the peak target velocity that the motion magic curve generator can use.

Parameters
sensorUnitsPer100msMotion Magic Cruise Velocity (in raw sensor units per 100 ms).
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.IMotorController.

◆ configMotionCruiseVelocity() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionCruiseVelocity ( int  sensorUnitsPer100ms)
inline

Sets the Motion Magic Cruise Velocity. This is the peak target velocity that the motion magic curve generator can use.

Parameters
sensorUnitsPer100msMotion Magic Cruise Velocity (in raw sensor units per 100 ms).
Returns
Error Code generated by function. 0 indicates no error.

◆ configMotionProfileTrajectoryInterpolationEnable() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionProfileTrajectoryInterpolationEnable ( boolean  enable,
int  timeoutMs 
)
inline

When trajectory points are processed in the buffer, the motor controller can linearly interpolate additional trajectory points between the buffered points. The time delta between these interpolated points is 1 ms.

By default this feature is enabled.

Parameters
enableWhether to enable the trajectory point interpolation feature.
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.

◆ configMotionProfileTrajectoryInterpolationEnable() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionProfileTrajectoryInterpolationEnable ( boolean  enable)
inline

When trajectory points are processed in the buffer, the motor controller can linearly interpolate additional trajectory points between the buffered points. The time delta between these interpolated points is 1 ms.

By default this feature is enabled.

Parameters
enableWhether to enable the trajectory point interpolation feature.
Returns
Error Code generated by function. 0 indicates no error.

◆ configMotionProfileTrajectoryPeriod() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionProfileTrajectoryPeriod ( int  baseTrajDurationMs,
int  timeoutMs 
)
inline

When trajectory points are processed in the motion profile executer, the MPE determines how long to apply the active trajectory point by summing baseTrajDurationMs with the timeDur of the trajectory point (see TrajectoryPoint).

This allows general selection of the execution rate of the points with 1ms resolution, while allowing some degree of change from point to point.

Parameters
baseTrajDurationMsThe base duration time of every trajectory point. This is summed with the trajectory points unique timeDur.
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.IMotorController.

◆ configMotionProfileTrajectoryPeriod() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionProfileTrajectoryPeriod ( int  baseTrajDurationMs)
inline

When trajectory points are processed in the motion profile executer, the MPE determines how long to apply the active trajectory point by summing baseTrajDurationMs with the timeDur of the trajectory point (see TrajectoryPoint).

This allows general selection of the execution rate of the points with 1ms resolution, while allowing some degree of change from point to point.

Parameters
baseTrajDurationMsThe base duration time of every trajectory point. This is summed with the trajectory points unique timeDur.
Returns
Error Code generated by function. 0 indicates no error.

◆ configMotionSCurveStrength() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionSCurveStrength ( int  curveStrength,
int  timeoutMs 
)
inline

Sets the Motion Magic S Curve Strength. Call this before using Motion Magic. Modifying this during a Motion Magic action should be avoided.

Parameters
curveStrength0 to use Trapezoidal Motion Profile. [1,8] for S-Curve (greater value yields greater smoothing).
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.IMotorController.

◆ configMotionSCurveStrength() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configMotionSCurveStrength ( int  curveStrength)
inline

Sets the Motion Magic S Curve Strength. Call this before using Motion Magic. Modifying this during a Motion Magic action should be avoided.

Parameters
curveStrength0 to use Trapezoidal Motion Profile. [1,8] for S-Curve (greater value yields greater smoothing).
Returns
Error Code generated by function. 0 indicates no error.

◆ configNeutralDeadband() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configNeutralDeadband ( double  percentDeadband,
int  timeoutMs 
)
inline

Configures the output deadband percentage.

Parameters
percentDeadbandDesired deadband percentage. Minimum is 0.1%, Maximum is 25%. Pass 0.04 for 4% (factory default).
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.IMotorController.

◆ configNeutralDeadband() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configNeutralDeadband ( double  percentDeadband)
inline

Configures the output deadband percentage.

Parameters
percentDeadbandDesired deadband percentage. Minimum is 0.1%, Maximum is 25%. Pass 0.04 for 4% (factory default).
Returns
Error Code generated by function. 0 indicates no error.

◆ configNominalOutputForward() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configNominalOutputForward ( double  percentOut,
int  timeoutMs 
)
inline

Configures the forward nominal output percentage.

Parameters
percentOutNominal (minimum) percent output. [0,+1]
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.IMotorController.

◆ configNominalOutputForward() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configNominalOutputForward ( double  percentOut)
inline

Configures the forward nominal output percentage.

Parameters
percentOutNominal (minimum) percent output. [0,+1]
Returns
Error Code generated by function. 0 indicates no error.

◆ configNominalOutputReverse() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configNominalOutputReverse ( double  percentOut,
int  timeoutMs 
)
inline

Configures the reverse nominal output percentage.

Parameters
percentOutNominal (minimum) percent output. [-1,0]
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.IMotorController.

◆ configNominalOutputReverse() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configNominalOutputReverse ( double  percentOut)
inline

Configures the reverse nominal output percentage.

Parameters
percentOutNominal (minimum) percent output. [-1,0]
Returns
Error Code generated by function. 0 indicates no error.

◆ configOpenloopRamp() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configOpenloopRamp ( double  secondsFromNeutralToFull,
int  timeoutMs 
)
inline

Configures the open-loop ramp rate of throttle output.

Parameters
secondsFromNeutralToFullMinimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
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.IMotorController.

◆ configOpenloopRamp() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configOpenloopRamp ( double  secondsFromNeutralToFull)
inline

Configures the open-loop ramp rate of throttle output.

Parameters
secondsFromNeutralToFullMinimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
Returns
Error Code generated by function. 0 indicates no error.

◆ configPeakOutputForward() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configPeakOutputForward ( double  percentOut,
int  timeoutMs 
)
inline

Configures the forward peak output percentage.

Parameters
percentOutDesired peak output percentage. [0,1]
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.IMotorController.

◆ configPeakOutputForward() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configPeakOutputForward ( double  percentOut)
inline

Configures the forward peak output percentage.

Parameters
percentOutDesired peak output percentage. [0,1]
Returns
Error Code generated by function. 0 indicates no error.

◆ configPeakOutputReverse() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configPeakOutputReverse ( double  percentOut,
int  timeoutMs 
)
inline

Configures the reverse peak output percentage.

Parameters
percentOutDesired peak output percentage.
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.IMotorController.

◆ configPeakOutputReverse() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configPeakOutputReverse ( double  percentOut)
inline

Configures the reverse peak output percentage.

Parameters
percentOutDesired peak output percentage.
Returns
Error Code generated by function. 0 indicates no error.

◆ configPulseWidthPeriod_EdgesPerRot()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configPulseWidthPeriod_EdgesPerRot ( int  pulseWidthPeriod_EdgesPerRot,
int  timeoutMs 
)
inline

Sets the edges per rotation of a pulse width sensor. (This should be set for tachometer use).

Parameters
pulseWidthPeriod_EdgesPerRotedges per rotation
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.

◆ configPulseWidthPeriod_FilterWindowSz()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configPulseWidthPeriod_FilterWindowSz ( int  pulseWidthPeriod_FilterWindowSz,
int  timeoutMs 
)
inline

Sets the number of samples to use in smoothing a pulse width sensor with a rolling average. Default is 1 (no smoothing).

Parameters
pulseWidthPeriod_FilterWindowSzsamples for rolling avg
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.

◆ configRemoteFeedbackFilter() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configRemoteFeedbackFilter ( int  deviceID,
RemoteSensorSource  remoteSensorSource,
int  remoteOrdinal,
int  timeoutMs 
)
inline

Select what remote device and signal to assign to Remote Sensor 0 or Remote Sensor 1. After binding a remote device and signal to Remote Sensor X, you may select Remote Sensor X as a PID source for closed-loop features.

Parameters
deviceIDThe device ID of the remote sensor device.
remoteSensorSourceThe remote sensor device and signal type to bind.
remoteOrdinal0 for configuring Remote Sensor 0, 1 for configuring Remote Sensor 1
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.IMotorController.

◆ configRemoteFeedbackFilter() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configRemoteFeedbackFilter ( int  deviceID,
RemoteSensorSource  remoteSensorSource,
int  remoteOrdinal 
)
inline

Select what remote device and signal to assign to Remote Sensor 0 or Remote Sensor 1. After binding a remote device and signal to Remote Sensor X, you may select Remote Sensor X as a PID source for closed-loop features.

Parameters
deviceIDThe device ID of the remote sensor device.
remoteSensorSourceThe remote sensor device and signal type to bind.
remoteOrdinal0 for configuring Remote Sensor 0, 1 for configuring Remote Sensor 1
Returns
Error Code generated by function. 0 indicates no error.

◆ configRemoteSensorClosedLoopDisableNeutralOnLOS()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configRemoteSensorClosedLoopDisableNeutralOnLOS ( boolean  remoteSensorClosedLoopDisableNeutralOnLOS,
int  timeoutMs 
)
inline

Disables going to neutral (brake/coast) when a remote sensor is no longer detected.

Parameters
remoteSensorClosedLoopDisableNeutralOnLOSdisable going to neutral
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.

◆ configReverseLimitSwitchSource() [1/3]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configReverseLimitSwitchSource ( RemoteLimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  deviceID,
int  timeoutMs 
)
inline

Configures the reverse limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon or CANifier.

Parameters
typeRemote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
deviceIDDevice ID of remote source (Talon SRX or CANifier device ID).
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.IMotorController.

◆ configReverseLimitSwitchSource() [2/3]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configReverseLimitSwitchSource ( RemoteLimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  deviceID 
)
inline

Configures the reverse limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon or CANifier.

Parameters
typeRemote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
deviceIDDevice ID of remote source (Talon SRX or CANifier device ID).
Returns
Error Code generated by function. 0 indicates no error.

◆ configReverseLimitSwitchSource() [3/3]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configReverseLimitSwitchSource ( int  typeValue,
int  normalOpenOrCloseValue,
int  deviceID,
int  timeoutMs 
)
inlineprotected

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
typeValueLimit 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
normalOpenOrCloseValueSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
deviceIDThe device ID of the remote sensor device.
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.

◆ configReverseSoftLimitEnable() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configReverseSoftLimitEnable ( boolean  enable,
int  timeoutMs 
)
inline

Configures the reverse soft limit enable.

Parameters
enableReverse Sensor Position Limit Enable.
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.IMotorController.

◆ configReverseSoftLimitEnable() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configReverseSoftLimitEnable ( boolean  enable)
inline

Configures the reverse soft limit enable.

Parameters
enableReverse Sensor Position Limit Enable.
Returns
Error Code generated by function. 0 indicates no error.

◆ configReverseSoftLimitThreshold() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configReverseSoftLimitThreshold ( int  reverseSensorLimit,
int  timeoutMs 
)
inline

Configures the reverse soft limit threshold.

Parameters
reverseSensorLimitReverse Sensor Position Limit (in raw sensor units).
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.IMotorController.

◆ configReverseSoftLimitThreshold() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configReverseSoftLimitThreshold ( int  reverseSensorLimit)
inline

Configures the reverse soft limit threshold.

Parameters
reverseSensorLimitReverse Sensor Position Limit (in raw sensor units).
Returns
Error Code generated by function. 0 indicates no error.

◆ configSelectedFeedbackCoefficient() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSelectedFeedbackCoefficient ( double  coefficient,
int  pidIdx,
int  timeoutMs 
)
inline

The Feedback Coefficient is a scalar applied to the value of the feedback sensor. Useful when you need to scale your sensor values within the closed-loop calculations. Default value is 1.

Selected Feedback Sensor register in firmware is the decoded sensor value multiplied by the Feedback Coefficient.

Parameters
coefficientFeedback Coefficient value. Maximum value of 1. Resolution is 1/(2^16). Cannot be 0.
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.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ configSelectedFeedbackCoefficient() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSelectedFeedbackCoefficient ( double  coefficient)
inline

The Feedback Coefficient is a scalar applied to the value of the feedback sensor. Useful when you need to scale your sensor values within the closed-loop calculations. Default value is 1.

Selected Feedback Sensor register in firmware is the decoded sensor value multiplied by the Feedback Coefficient.

Parameters
coefficientFeedback Coefficient value. Maximum value of 1. Resolution is 1/(2^16). Cannot be 0.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSelectedFeedbackSensor() [1/4]

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

Select the remote feedback device for the motor controller. Most CTRE CAN motor controllers will support remote sensors over CAN.

Parameters
feedbackDeviceRemote 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.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ configSelectedFeedbackSensor() [2/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSelectedFeedbackSensor ( RemoteFeedbackDevice  feedbackDevice)
inline

Select the remote feedback device for the motor controller. Most CTRE CAN motor controllers will support remote sensors over CAN.

Parameters
feedbackDeviceRemote Feedback Device to select.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSelectedFeedbackSensor() [3/4]

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

Select the feedback device for the motor controller.

Parameters
feedbackDeviceFeedback 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.

◆ configSelectedFeedbackSensor() [4/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSelectedFeedbackSensor ( FeedbackDevice  feedbackDevice)
inline

Select the feedback device for the motor controller.

Parameters
feedbackDeviceFeedback Device to select.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSensorTerm() [1/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSensorTerm ( SensorTerm  sensorTerm,
FeedbackDevice  feedbackDevice,
int  timeoutMs 
)
inline

Select what sensor term should be bound to switch feedback device. Sensor Sum = Sensor Sum Term 0 - Sensor Sum Term 1 Sensor Difference = Sensor Diff Term 0 - Sensor Diff Term 1 The four terms are specified with this routine. Then Sensor Sum/Difference can be selected for closed-looping.

Parameters
sensorTermWhich sensor term to bind to a feedback source.
feedbackDeviceThe sensor signal to attach to sensorTerm.
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.IMotorController.

◆ configSensorTerm() [2/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSensorTerm ( SensorTerm  sensorTerm,
FeedbackDevice  feedbackDevice 
)
inline

Select what sensor term should be bound to switch feedback device. Sensor Sum = Sensor Sum Term 0 - Sensor Sum Term 1 Sensor Difference = Sensor Diff Term 0 - Sensor Diff Term 1 The four terms are specified with this routine. Then Sensor Sum/Difference can be selected for closed-looping.

Parameters
sensorTermWhich sensor term to bind to a feedback source.
feedbackDeviceThe sensor signal to attach to sensorTerm.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSensorTerm() [3/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSensorTerm ( SensorTerm  sensorTerm,
RemoteFeedbackDevice  feedbackDevice,
int  timeoutMs 
)
inline

Select what sensor term should be bound to switch feedback device. Sensor Sum = Sensor Sum Term 0 - Sensor Sum Term 1 Sensor Difference = Sensor Diff Term 0 - Sensor Diff Term 1 The four terms are specified with this routine. Then Sensor Sum/Difference can be selected for closed-looping.

Parameters
sensorTermWhich sensor term to bind to a feedback source.
feedbackDeviceThe sensor signal to attach to sensorTerm.
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.

◆ configSensorTerm() [4/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSensorTerm ( SensorTerm  sensorTerm,
RemoteFeedbackDevice  feedbackDevice 
)
inline

Select what sensor term should be bound to switch feedback device. Sensor Sum = Sensor Sum Term 0 - Sensor Sum Term 1 Sensor Difference = Sensor Diff Term 0 - Sensor Diff Term 1 The four terms are specified with this routine. Then Sensor Sum/Difference can be selected for closed-looping.

Parameters
sensorTermWhich sensor term to bind to a feedback source.
feedbackDeviceThe sensor signal to attach to sensorTerm.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSetCustomParam() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSetCustomParam ( int  newValue,
int  paramIndex,
int  timeoutMs 
)
inline

Sets the value of a custom parameter. This is for arbitrary use.

Sometimes it is necessary to save calibration/limit/target information in the device. Particularly if the device is part of a subsystem that can be replaced.

Parameters
newValueValue for custom parameter.
paramIndexIndex of custom parameter [0,1]
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.IMotorController.

◆ configSetCustomParam() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSetCustomParam ( int  newValue,
int  paramIndex 
)
inline

Sets the value of a custom parameter. This is for arbitrary use.

Sometimes it is necessary to save calibration/limit/target information in the device. Particularly if the device is part of a subsystem that can be replaced.

Parameters
newValueValue for custom parameter.
paramIndexIndex of custom parameter [0,1]
Returns
Error Code generated by function. 0 indicates no error.

◆ configSetParameter() [1/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSetParameter ( ParamEnum  param,
double  value,
int  subValue,
int  ordinal,
int  timeoutMs 
)
inline

Sets a parameter. Generally this is not used. This can be utilized in - Using new features without updating API installation. - Errata workarounds to circumvent API implementation. - Allows for rapid testing / unit testing of firmware.

Parameters
paramParameter enumeration.
valueValue of parameter.
subValueSubvalue for parameter. Maximum value of 255.
ordinalOrdinal of parameter.
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.IMotorController.

◆ configSetParameter() [2/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSetParameter ( ParamEnum  param,
double  value,
int  subValue,
int  ordinal 
)
inline

Sets a parameter. Generally this is not used. This can be utilized in - Using new features without updating API installation. - Errata workarounds to circumvent API implementation. - Allows for rapid testing / unit testing of firmware.

Parameters
paramParameter enumeration.
valueValue of parameter.
subValueSubvalue for parameter. Maximum value of 255.
ordinalOrdinal of parameter.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSetParameter() [3/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSetParameter ( int  param,
double  value,
int  subValue,
int  ordinal,
int  timeoutMs 
)
inline

Sets a parameter.

Parameters
paramParameter enumeration.
valueValue of parameter.
subValueSubvalue for parameter. Maximum value of 255.
ordinalOrdinal of parameter.
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.IMotorController.

◆ configSetParameter() [4/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSetParameter ( int  param,
double  value,
int  subValue,
int  ordinal 
)
inline

Sets a parameter.

Parameters
paramParameter enumeration.
valueValue of parameter.
subValueSubvalue for parameter. Maximum value of 255.
ordinalOrdinal of parameter.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSoftLimitDisableNeutralOnLOS()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configSoftLimitDisableNeutralOnLOS ( boolean  softLimitDisableNeutralOnLOS,
int  timeoutMs 
)
inline

Disables soft limits triggering (if enabled) when the sensor is no longer detected.

Parameters
softLimitDisableNeutralOnLOSdisable triggering
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.

◆ configureFilter() [1/3]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configureFilter ( FilterConfiguration  filter,
int  ordinal,
int  timeoutMs,
boolean  enableOptimizations 
)
inline

Configures all filter persistant settings.

Deprecated:
Use the 3-parameter configureFilter. 4-param version is deprecated and will be removed.
Parameters
filterObject with all of the filter persistant settings
ordinal0 for remote sensor 0 and 1 for remote sensor 1.
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.

◆ configureFilter() [2/3]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configureFilter ( FilterConfiguration  filter,
int  ordinal,
int  timeoutMs 
)
inline

Configures all filter persistant settings.

Deprecated:
Use configAll instead.
Parameters
filterObject with all of the filter persistant settings
ordinal0 for remote sensor 0 and 1 for remote sensor 1.
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.

◆ configureFilter() [3/3]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configureFilter ( FilterConfiguration  filter)
inline

Configures all filter persistant settings (overloaded so timeoutMs is 50 ms and ordinal is 0).

Deprecated:
Use configAll instead.
Parameters
filterObject with all of the filter persistant settings
Returns
Error Code generated by function. 0 indicates no error.

◆ configureSlot() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configureSlot ( SlotConfiguration  slot)
inline

Configures all slot persistant settings (overloaded so timeoutMs is 50 ms and slotIdx is 0

Deprecated:
Use configAll instead.
Parameters
slotObject with all of the slot persistant settings
Returns
Error Code generated by function. 0 indicates no error.

◆ configureSlot() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configureSlot ( SlotConfiguration  slot,
int  slotIdx,
int  timeoutMs 
)
inline

Configures all slot persistant settings

Deprecated:
Use configAll instead.
Parameters
slotObject with all of the slot persistant settings
slotIdxIndex of slot to configure
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.

◆ configVelocityMeasurementPeriod() [1/2]

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

Sets the period over which velocity measurements are taken.

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.

◆ configVelocityMeasurementPeriod() [2/2]

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

Sets the period over which velocity measurements are taken.

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

◆ configVelocityMeasurementWindow() [2/2]

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

◆ configVoltageCompSaturation() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configVoltageCompSaturation ( double  voltage,
int  timeoutMs 
)
inline

Configures the Voltage Compensation saturation voltage.

Parameters
voltageThis is the max voltage to apply to the hbridge when voltage compensation is enabled. For example, if 10 (volts) is specified and a TalonSRX is commanded to 0.5 (PercentOutput, closed-loop, etc) then the TalonSRX will attempt to apply a duty-cycle to produce 5V.
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.IMotorController.

◆ configVoltageCompSaturation() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configVoltageCompSaturation ( double  voltage)
inline

Configures the Voltage Compensation saturation voltage.

Parameters
voltageThis is the max voltage to apply to the hbridge when voltage compensation is enabled. For example, if 10 (volts) is specified and a TalonSRX is commanded to 0.5 (PercentOutput, closed-loop, etc) then the TalonSRX will attempt to apply a duty-cycle to produce 5V.
Returns
Error Code generated by function. 0 indicates no error.

◆ configVoltageMeasurementFilter() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configVoltageMeasurementFilter ( int  filterWindowSamples,
int  timeoutMs 
)
inline

Configures the voltage measurement filter.

Parameters
filterWindowSamplesNumber of samples in the rolling average of voltage measurement.
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.IMotorController.

◆ configVoltageMeasurementFilter() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.configVoltageMeasurementFilter ( int  filterWindowSamples)
inline

Configures the voltage measurement filter.

Parameters
filterWindowSamplesNumber of samples in the rolling average of voltage measurement.
Returns
Error Code generated by function. 0 indicates no error.

◆ DestroyObject()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.DestroyObject ( )
inline

Destructor for motor controllers

Returns
Error Code generated by function. 0 indicates no error.

◆ enableHeadingHold()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.enableHeadingHold ( boolean  enable)
inline

Enables a future feature called "Heading Hold". For now this simply updates the CAN signal to the motor controller. Future firmware updates will use this.

Parameters
enabletrue/false enable
Deprecated:
This has been replaced with the 4 param Set.

◆ enableVoltageCompensation()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.enableVoltageCompensation ( boolean  enable)
inline

Enables voltage compensation. If enabled, voltage compensation works in all control modes.

Be sure to configure the saturation voltage before enabling this.

Parameters
enableEnable state of voltage compensation.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ follow() [1/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.follow ( IMotorController  masterToFollow,
FollowerType  followerType 
)
inline

Set the control mode and output value so that this motor controller will follow another motor controller. Currently supports following Victor SPX and Talon SRX.

Parameters
masterToFollowMotor Controller object to follow.
followerTypeType of following control. Use AuxOutput1 to follow the master device's auxiliary output 1. Use PercentOutput for standard follower mode.

◆ follow() [2/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.follow ( IMotorController  masterToFollow)
inline

Set the control mode and output value so that this motor controller will follow another motor controller. Currently supports following Victor SPX and Talon SRX.

Parameters
masterToFollowMotor Controller to follow

Implements com.ctre.phoenix.motorcontrol.IFollower.

◆ getActiveTrajectoryArbFeedFwd() [1/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getActiveTrajectoryArbFeedFwd ( )
inline

Gets the active trajectory arbitrary feedforward for pid0 using MotionMagic/MotionProfile control modes.

Returns
The Active Trajectory ArbFeedFwd in units of percent output (where 0.01 is 1%).

◆ getActiveTrajectoryArbFeedFwd() [2/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getActiveTrajectoryArbFeedFwd ( int  pidIdx)
inline

Gets the active trajectory arbitrary feedforward using MotionMagic/MotionProfile control modes.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
The Active Trajectory ArbFeedFwd in units of percent output (where 0.01 is 1%).

◆ getActiveTrajectoryHeading()

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getActiveTrajectoryHeading ( )
inline

Gets the active trajectory target heading using MotionMagicArc/MotionProfileArc control modes.

Returns
The Active Trajectory Heading in degrees.
Deprecated:
Use getActiveTrajectoryPosition() with 1 passed as an argument instead.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getActiveTrajectoryPosition() [1/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getActiveTrajectoryPosition ( )
inline

Gets the active trajectory target position for pid0 using MotionMagic/MotionProfile control modes.

Returns
The Active Trajectory Position in sensor units.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getActiveTrajectoryPosition() [2/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getActiveTrajectoryPosition ( int  pidIdx)
inline

Gets the active trajectory target position using MotionMagic/MotionProfile control modes.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
The Active Trajectory Position in sensor units.

◆ getActiveTrajectoryVelocity() [1/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getActiveTrajectoryVelocity ( )
inline

Gets the active trajectory target velocity for pid0 using MotionMagic/MotionProfile control modes.

Returns
The Active Trajectory Velocity in sensor units per 100ms.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getActiveTrajectoryVelocity() [2/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getActiveTrajectoryVelocity ( int  pidIdx)
inline

Gets the active trajectory target velocity using MotionMagic/MotionProfile control modes.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
The Active Trajectory Velocity in sensor units per 100ms.

◆ getBaseID()

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getBaseID ( )
inline
Returns
BaseID of device

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getBusVoltage()

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getBusVoltage ( )
inline

Gets the bus voltage seen by the device.

Returns
The bus voltage value (in volts).

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getClosedLoopError() [1/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getClosedLoopError ( int  pidIdx)
inline

Gets the closed-loop error. The units depend on which control mode is in use.

If closed-loop is seeking a target sensor position, closed-loop error is the difference between target and current sensor value (in sensor units. Example 4096 units per rotation for CTRE Mag Encoder).

If closed-loop is seeking a target sensor velocity, closed-loop error is the difference between target and current sensor value (in sensor units per 100ms).

If using motion profiling or Motion Magic, closed loop error is calculated against the current target, and not the "final" target at the end of the profile/movement.

See Phoenix-Documentation information on units.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
Closed-loop error value.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getClosedLoopError() [2/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getClosedLoopError ( )
inline

Gets the closed-loop error. The units depend on which control mode is in use.

If closed-loop is seeking a target sensor position, closed-loop error is the difference between target and current sensor value (in sensor units. Example 4096 units per rotation for CTRE Mag Encoder).

If closed-loop is seeking a target sensor velocity, closed-loop error is the difference between target and current sensor value (in sensor units per 100ms).

If using motion profiling or Motion Magic, closed loop error is calculated against the current target, and not the "final" target at the end of the profile/movement.

See Phoenix-Documentation information on units.

Returns
Closed-loop error value.

◆ getClosedLoopTarget() [1/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getClosedLoopTarget ( int  pidIdx)
inline

Gets the current target of a given closed loop.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
The closed loop target.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getClosedLoopTarget() [2/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getClosedLoopTarget ( )
inline

Gets the current target of a given closed loop.

Returns
The closed loop target.

◆ getControlMode()

ControlMode com.ctre.phoenix.motorcontrol.can.BaseMotorController.getControlMode ( )
inline
Returns
control mode motor controller is in

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getDeviceID()

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getDeviceID ( )
inline

Returns the Device ID

Returns
Device number.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getErrorDerivative() [1/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getErrorDerivative ( int  pidIdx)
inline

Gets the derivative of the closed-loop error.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
The error derivative value.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getErrorDerivative() [2/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getErrorDerivative ( )
inline

Gets the derivative of the closed-loop error.

Returns
The error derivative value.

◆ getFaults()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.getFaults ( Faults  toFill)
inline

Polls the various fault flags.

Parameters
toFillCaller's object to fill with latest fault flags.
Returns
Last Error Code generated by a function.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getFilterConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.getFilterConfigs ( FilterConfiguration  filter,
int  ordinal,
int  timeoutMs 
)
inline

Gets all filter persistant settings.

Parameters
filterObject with all of the filter persistant settings
ordinal0 for remote sensor 0 and 1 for remote sensor 1.
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.

◆ getFilterConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.getFilterConfigs ( FilterConfiguration  filter)
inline

Gets all filter persistant settings (overloaded so timeoutMs is 50 ms and ordinal is 0).

Parameters
filterObject with all of the filter persistant settings

◆ getFirmwareVersion()

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getFirmwareVersion ( )
inline

Gets the firmware version of the device.

Returns
Firmware version of device. For example: version 1-dot-2 is 0x0102.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getHandle()

long com.ctre.phoenix.motorcontrol.can.BaseMotorController.getHandle ( )
inline
Returns
CCI handle for child classes.

◆ getIntegralAccumulator() [1/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getIntegralAccumulator ( int  pidIdx)
inline

Gets the iaccum value.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
Integral accumulator value (Closed-loop error X 1ms).

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getIntegralAccumulator() [2/2]

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getIntegralAccumulator ( )
inline

Gets the iaccum value.

Returns
Integral accumulator value (Closed-loop error X 1ms).

◆ getInverted()

boolean com.ctre.phoenix.motorcontrol.can.BaseMotorController.getInverted ( )
inline
Returns
invert setting of motor output.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getLastError()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.getLastError ( )
inline

Gets the last error generated by this object. Not all functions return an error code but can potentially report errors. This function can be used to retrieve those error codes.

Returns
Last Error Code generated by a function.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getMotionProfileStatus()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.getMotionProfileStatus ( MotionProfileStatus  statusToFill)
inline

Retrieve all status information. For best performance, Caller can snapshot all status information regarding the motion profile executer.

Parameters
statusToFillCaller supplied object to fill.

The members are filled, as follows...

topBufferRem: The available empty slots in the trajectory buffer. The robot API holds a "top buffer" of trajectory points, so your applicaion can dump several points at once. The API will then stream them into the low-level buffer, allowing the motor controller to act on them.

topBufferRem: The number of points in the top trajectory buffer.

btmBufferCnt: The number of points in the low level controller buffer.

hasUnderrun: Set if isUnderrun ever gets set. Can be manually cleared by clearMotionProfileHasUnderrun() or automatically cleared by startMotionProfile().

isUnderrun: This is set if controller needs to shift a point from its buffer into the active trajectory point however the buffer is empty. This gets cleared automatically when is resolved.

activePointValid: True if the active trajectory point is not empty, false otherwise. The members in activePoint are only valid if this signal is set.

isLast: is set/cleared based on the MP executer's current trajectory point's IsLast value. This assumes IsLast was set when PushMotionProfileTrajectory was used to insert the currently processed trajectory point.

profileSlotSelect: The currently processed trajectory point's selected slot. This can differ in the currently selected slot used for Position and Velocity servo modes

outputEnable: The current output mode of the motion profile executer (disabled, enabled, or hold). When changing the set() value in MP mode, it's important to check this signal to confirm the change takes effect before interacting with the top buffer.

Returns
Error Code generated by function. 0 indicates no error.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getMotionProfileTopLevelBufferCount()

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getMotionProfileTopLevelBufferCount ( )
inline

Retrieve just the buffer count for the api-level (top) buffer. This routine performs no CAN or data structure lookups, so its fast and ideal if caller needs to quickly poll the progress of trajectory points being emptied into controller's RAM. Otherwise just use GetMotionProfileStatus.

Returns
number of trajectory points in the top buffer.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getMotorOutputPercent()

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getMotorOutputPercent ( )
inline

Gets the output percentage of the motor controller.

Returns
Output of the motor controller (in percent).

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getMotorOutputVoltage()

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getMotorOutputVoltage ( )
inline
Returns
applied voltage to motor in volts.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getOutputCurrent()

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getOutputCurrent ( )
inlineprotected

Gets the output current of the motor controller.

Returns
The output current (in amps).

◆ getSelectedSensorPosition() [1/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getSelectedSensorPosition ( int  pidIdx)
inline

Get the selected sensor position (in raw sensor units).

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop. See Phoenix-Documentation for how to interpret.
Returns
Position of selected sensor (in raw sensor units).

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getSelectedSensorPosition() [2/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getSelectedSensorPosition ( )
inline

Get the selected sensor position (in raw sensor units).

Returns
Position of selected sensor (in raw sensor units).

◆ getSelectedSensorVelocity() [1/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getSelectedSensorVelocity ( int  pidIdx)
inline

Get the selected sensor velocity.

Parameters
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
Returns
selected sensor (in raw sensor units) per 100ms. See Phoenix-Documentation for how to interpret.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getSelectedSensorVelocity() [2/2]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getSelectedSensorVelocity ( )
inline

Get the selected sensor velocity.

Returns
selected sensor (in raw sensor units) per 100ms. See Phoenix-Documentation for how to interpret.

◆ getSlotConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.getSlotConfigs ( SlotConfiguration  slot,
int  slotIdx,
int  timeoutMs 
)
inline

Gets all slot persistant settings.

Parameters
slotObject with all of the slot persistant settings
slotIdxParameter slot for the constant.
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.

◆ getSlotConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.getSlotConfigs ( SlotConfiguration  slot)
inline

Gets all slot persistant settings (overloaded so timeoutMs is 50 ms and slotIdx is 0

Parameters
slotObject with all of the slot persistant settings

◆ getStatusFramePeriod() [1/6]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getStatusFramePeriod ( int  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.

◆ getStatusFramePeriod() [2/6]

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

Gets the period of the given status frame.

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

◆ getStatusFramePeriod() [3/6]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getStatusFramePeriod ( StatusFrame  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.IMotorController.

◆ getStatusFramePeriod() [4/6]

int com.ctre.phoenix.motorcontrol.can.BaseMotorController.getStatusFramePeriod ( StatusFrame  frame)
inline

Gets the period of the given status frame.

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

◆ getStatusFramePeriod() [5/6]

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

◆ getStatusFramePeriod() [6/6]

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

◆ getStickyFaults()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.getStickyFaults ( StickyFaults  toFill)
inline

Polls the various sticky fault flags.

Parameters
toFillCaller's object to fill with latest sticky fault flags.
Returns
Last Error Code generated by a function.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ getTemperature()

double com.ctre.phoenix.motorcontrol.can.BaseMotorController.getTemperature ( )
inline

Gets the temperature of the motor controller.

Returns
Temperature of the motor controller (in 'C)

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ hasResetOccurred()

boolean com.ctre.phoenix.motorcontrol.can.BaseMotorController.hasResetOccurred ( )
inline

Returns true if the device has reset since last call.

Returns
Has a Device Reset Occurred?

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ isMotionProfileFinished()

boolean com.ctre.phoenix.motorcontrol.can.BaseMotorController.isMotionProfileFinished ( )
inline

Determine if running MP is complete. This requires using the StartMotionProfile routine to start the MP. That is because managing the trajectory points is now done in a background thread (if StartMotionProfile is called).

If calling application uses the legacy API (more-complex buffering API) from previous years, than this API will not return true.

Returns
true if MP was started using StartMotionProfile, and it has completed execution (MPE is now in "hold").

◆ isMotionProfileTopLevelBufferFull()

boolean com.ctre.phoenix.motorcontrol.can.BaseMotorController.isMotionProfileTopLevelBufferFull ( )
inline

Retrieve just the buffer full for the api-level (top) buffer. This routine performs no CAN or data structure lookups, so its fast and ideal if caller needs to quickly poll. Otherwise just use GetMotionProfileStatus.

Returns
number of trajectory points in the top buffer.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ neutralOutput()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.neutralOutput ( )
inline

Neutral the motor output by setting control mode to disabled.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ overrideLimitSwitchesEnable()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.overrideLimitSwitchesEnable ( boolean  enable)
inline

Sets the enable state for limit switches.

Parameters
enableEnable state for limit switches.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ overrideSoftLimitsEnable()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.overrideSoftLimitsEnable ( boolean  enable)
inline

Can be used to override-disable the soft limits. This function can be used to quickly disable soft limits without having to modify the persistent configuration.

Parameters
enableEnable state for soft limit switches.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ processMotionProfileBuffer()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.processMotionProfileBuffer ( )
inline

This must be called periodically to funnel the trajectory points from the API's top level buffer to the controller's bottom level buffer. Recommendation is to call this twice as fast as the execution rate of the motion profile. So if MP is running with 20ms trajectory points, try calling this routine every 10ms. All motion profile functions are thread-safe through the use of a mutex, so there is no harm in having the caller utilize threading.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ pushMotionProfileTrajectory()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.pushMotionProfileTrajectory ( TrajectoryPoint  trajPt)
inline

Push another trajectory point into the top level buffer (which is emptied into the motor controller's bottom buffer as room allows).

Parameters
trajPtto push into buffer. The members should be filled in with these values...
    targPos:  servo position in sensor units.
targVel:  velocity to feed-forward in sensor units
            per 100ms.
    profileSlotSelect0  Which slot to get PIDF gains. PID is used for position servo. F is used
                   as the Kv constant for velocity feed-forward. Typically this is hardcoded
                   to the a particular slot, but you are free gain schedule if need be.
                   Choose from [0,3]
profileSlotSelect1 Which slot to get PIDF gains for auxiliary PId.
                   This only has impact during MotionProfileArc Control mode.
                   Choose from [0,1].
   isLastPoint  set to nonzero to signal motor controller to keep processing this
                trajectory point, instead of jumping to the next one
                when timeDurMs expires.  Otherwise MP executer will
                eventually see an empty buffer after the last point
                expires, causing it to assert the IsUnderRun flag.
                However this may be desired if calling application
                never wants to terminate the MP.
zeroPos  set to nonzero to signal motor controller to "zero" the selected
            position sensor before executing this trajectory point.
            Typically the first point should have this set only thus
            allowing the remainder of the MP positions to be relative to
            zero.
timeDur Duration to apply this trajectory pt.
            This time unit is ADDED to the exising base time set by
            configMotionProfileTrajectoryPeriod().
Returns
CTR_OKAY if trajectory point push ok. ErrorCode if buffer is full due to kMotionProfileTopBufferCapacity.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ selectDemandType()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.selectDemandType ( boolean  value)
inline

For now this simply updates the CAN signal to the motor controller. Future firmware updates will use this to control advanced auxiliary loop behavior.

Parameters
value
Deprecated:
This has been replaced with the 4 param Set.

◆ selectProfileSlot()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.selectProfileSlot ( int  slotIdx,
int  pidIdx 
)
inline

Selects which profile slot to use for closed-loop control.

Parameters
slotIdxProfile slot to select.
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ set() [1/3]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.set ( ControlMode  mode,
double  outputValue 
)
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.
outputValueThe setpoint value, as described above.

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

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ set() [2/3]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.set ( ControlMode  mode,
double  demand0,
double  demand1 
)
inline
Deprecated:
use 4 parameter set
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.
demand1Supplemental value. This will also be control mode specific for future features.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ set() [3/3]

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

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ setControlFramePeriod() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setControlFramePeriod ( ControlFrame  frame,
int  periodMs 
)
inline

Sets the period of the given control frame.

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.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ setControlFramePeriod() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setControlFramePeriod ( int  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.

◆ setIntegralAccumulator() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setIntegralAccumulator ( double  iaccum,
int  pidIdx,
int  timeoutMs 
)
inline

Sets the integral accumulator. Typically this is used to clear/zero the integral accumulator, however some use cases may require seeding the accumulator for a faster response.

Parameters
iaccumValue to set for the integral accumulator (closed loop error units X 1ms).
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.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ setIntegralAccumulator() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setIntegralAccumulator ( double  iaccum)
inline

Sets the integral accumulator. Typically this is used to clear/zero the integral accumulator, however some use cases may require seeding the accumulator for a faster response.

Parameters
iaccumValue to set for the integral accumulator (closed loop error units X 1ms).
Returns
Error Code generated by function. 0 indicates no error.

◆ setInverted() [1/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.setInverted ( boolean  invert)
inline

Inverts the hbridge output of the motor controller.

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

This will invert the hbridge output but NOT the LEDs. This ensures....

  • Green LEDs always represents positive request from robot-controller/closed-looping mode.
  • Green LEDs correlates to forward limit switch.
  • Green LEDs correlates to forward soft limit.
Parameters
invertInvert state to set.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ setInverted() [2/2]

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.setInverted ( InvertType  invertType)
inline

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

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

This will allow you to either:

  • Not invert the motor
  • Invert the motor
  • Always follow the master regardless of master's inversion
  • Always oppose the master regardless of master's inversion
Parameters
invertTypeInvert state to set.

◆ setNeutralMode()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.setNeutralMode ( NeutralMode  neutralMode)
inline

Sets the mode of operation during neutral throttle output.

Parameters
neutralModeThe desired mode of operation when the Controller output throttle is neutral (ie brake/coast)

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ setSelectedSensorPosition() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setSelectedSensorPosition ( int  sensorPos,
int  pidIdx,
int  timeoutMs 
)
inline

Sets the sensor position to the given value.

Parameters
sensorPosPosition to set for the selected sensor (in raw sensor units).
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.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ setSelectedSensorPosition() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setSelectedSensorPosition ( int  sensorPos)
inline

Sets the sensor position to the given value.

Parameters
sensorPosPosition to set for the selected sensor (in raw sensor units).
Returns
Error Code generated by function. 0 indicates no error.

◆ setSensorPhase()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.setSensorPhase ( boolean  PhaseSensor)
inline

Sets the phase of the sensor. Use when controller forward/reverse output doesn't correlate to appropriate forward/reverse reading of sensor. Pick a value so that positive PercentOutput yields a positive change in sensor. After setting this, user can freely call SetInverted() with any value.

Parameters
PhaseSensorIndicates whether to invert the phase of the sensor.

Implements com.ctre.phoenix.motorcontrol.IMotorController.

◆ setStatusFramePeriod() [1/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setStatusFramePeriod ( int  frameValue,
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
frameValueFrame 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.

◆ setStatusFramePeriod() [2/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setStatusFramePeriod ( int  frameValue,
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
frameValueFrame whose period is to be changed.
periodMsPeriod in ms for the given frame.
Returns
Error Code generated by function. 0 indicates no error.

◆ setStatusFramePeriod() [3/4]

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

Sets the period of the given status frame.

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

◆ setStatusFramePeriod() [4/4]

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.setStatusFramePeriod ( StatusFrame  frame,
int  periodMs 
)
inline

Sets the period of the given status frame.

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.

◆ startMotionProfile()

ErrorCode com.ctre.phoenix.motorcontrol.can.BaseMotorController.startMotionProfile ( BufferedTrajectoryPointStream  stream,
int  minBufferedPts,
ControlMode  motionProfControlMode 
)
inline

Simple one-shot firing of a complete MP. Starting in 2019, MPs can be fired by building a Buffered Trajectory Point Stream, and calling this routine.

Once called, the motor controller software will automatically ... [1] Clear the firmware buffer of trajectory points. [2] Clear the underrun flags [3] Reset an index within the Buffered Trajectory Point Stream (so that the same profile can be run again and again). [4] Start a background thread to manage MP streaming (if not already running). [5a] If current control mode already matches motionProfControlMode, set MPE Output to "Hold". [5b] If current control mode does not matches motionProfControlMode, apply motionProfControlMode and set MPE Output to "Disable". [6] Stream the trajectory points into the device's firmware buffer. [7] Once motor controller has at least minBufferedPts worth in the firmware buffer, MP will automatically start (MPE Output set to "Enable"). [8] Wait until MP finishes, then transitions the Motion Profile Executor's output to "Hold". [9] IsMotionProfileFinished() will now return true.

Calling application can use IsMotionProfileFinished() to determine when internal state machine reaches [7]. Calling application can cancel MP by calling set(). Otherwise do not call set() until MP has completed.

The legacy API from previous years requires the calling application to pass points via the ProcessMotionProfileBuffer and PushMotionProfileTrajectory. This is no longer required if using this StartMotionProfile/IsMotionProfileFinished API.

Parameters
streamA buffer that will be used to stream the trajectory points. Caller can fill this container with the entire trajectory point, regardless of size.
minBufferedPtsMinimum number of firmware buffered points before starting MP. Do not exceed device's firmware buffer capacity or MP will never fire (120 for Motion Profile, or 60 for Motion Profile Arc). Recommendation value for this would be five to ten samples depending on timeDur of the trajectory point.
motionProfControlModePass MotionProfile or MotionProfileArc.
Returns
nonzero error code if operation fails.

◆ valueUpdated()

void com.ctre.phoenix.motorcontrol.can.BaseMotorController.valueUpdated ( )
inline

When master makes a device, this routine is called to signal the update.

Implements com.ctre.phoenix.motorcontrol.IFollower.

Member Data Documentation

◆ m_handle

long com.ctre.phoenix.motorcontrol.can.BaseMotorController.m_handle
protected

Device handle


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