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

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

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

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from com.ctre.phoenix.motorcontrol.can.BaseMotorController
VictorSPXSimCollection getVictorSPXSimCollection ()
 
double getOutputCurrent ()
 
ErrorCode configForwardLimitSwitchSource (int typeValue, int normalOpenOrCloseValue, int deviceID, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (int typeValue, int normalOpenOrCloseValue, int deviceID, int timeoutMs)
 
ErrorCode baseConfigAllSettings (BaseMotorControllerConfiguration allConfigs, int timeoutMs)
 
ErrorCode baseConfigurePID (BasePIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
void baseGetPIDConfigs (BasePIDSetConfiguration pid, int pidIdx, int timeoutMs)
 
void baseGetAllConfigs (BaseMotorControllerConfiguration allConfigs, int timeoutMs)
 
- Protected Attributes inherited from com.ctre.phoenix.motorcontrol.can.BaseMotorController
long m_handle
 

Detailed Description

VEX Victor SPX Motor Controller when used on CAN Bus.

Constructor & Destructor Documentation

◆ VictorSPX()

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

Constructor

Parameters
deviceNumber[0,62]

Member Function Documentation

◆ configAllSettings() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.VictorSPX.configAllSettings ( VictorSPXConfiguration  allConfigs,
int  timeoutMs 
)
inline

Configures all persistent settings.

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

◆ configAllSettings() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.can.VictorSPX.configAllSettings ( VictorSPXConfiguration  allConfigs)
inline

Configures all persistent settings (overloaded so timeoutMs is 50 ms).

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

◆ getAllConfigs() [1/2]

void com.ctre.phoenix.motorcontrol.can.VictorSPX.getAllConfigs ( VictorSPXConfiguration  allConfigs,
int  timeoutMs 
)
inline

Gets all persistant settings.

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

◆ getAllConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.VictorSPX.getAllConfigs ( VictorSPXConfiguration  allConfigs)
inline

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

Parameters
allConfigsObject with all of the persistant settings

◆ getPIDConfigs() [1/2]

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

Gets all PID set persistant settings.

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

◆ getPIDConfigs() [2/2]

void com.ctre.phoenix.motorcontrol.can.VictorSPX.getPIDConfigs ( VictorSPXPIDSetConfiguration  pid)
inline

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

Parameters
pidObject with all of the PID set persistant settings

◆ getSimCollection()

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

◆ set() [1/2]

void com.ctre.phoenix.motorcontrol.can.VictorSPX.set ( VictorSPXControlMode  mode,
double  value 
)
inline

Sets the appropriate output on the motor controller, 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 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 motor controller to duplicate.
valueThe setpoint value, as described above.

Standard Driving Example: _victorLeft.set(ControlMode.PercentOutput, leftJoy); _victorRght.set(ControlMode.PercentOutput, rghtJoy);

◆ set() [2/2]

void com.ctre.phoenix.motorcontrol.can.VictorSPX.set ( VictorSPXControlMode  mode,
double  demand0,
DemandType  demand1Type,
double  demand1 
)
inline
Parameters
modeSets the appropriate output on the motor controller, 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 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 motor controller 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: _victorLeft.set(ControlMode.PercentOutput, joyForward, DemandType.ArbitraryFeedForward, +joyTurn); _victorRght.set(ControlMode.PercentOutput, joyForward, DemandType.ArbitraryFeedForward, -joyTurn);

Drive Straight Example: Note: Selected Sensor Configuration is necessary for both PID0 and PID1. _victorLeft.follow(_victorRght, FollwerType.AuxOutput1); _victorRght.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. _victorLeft.follow(_victorRght, FollwerType.AuxOutput1); _victorRght.set(ControlMode.MotionMagic, targetDistance, DemandType.AuxPID, desiredRobotHeading);


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