24namespace motorcontrol {
181 int timeoutMs = 0) = 0;
195 int timeoutMs = 0) = 0;
208 int timeoutMs = 0) = 0;
221 int timeoutMs = 0) = 0;
234 int timeoutMs = 0) = 0;
247 int timeoutMs = 0) = 0;
261 int timeoutMs = 0) = 0;
279 int timeoutMs = 0) = 0;
293 int timeoutMs = 0) = 0;
373 double coefficient,
int pidIdx = 0,
int timeoutMs = 0) = 0;
394 int timeoutMs = 0)= 0;
463 int timeoutMs = 50) = 0;
497 int timeoutMs = 0) = 0;
536 int deviceID,
int timeoutMs = 0) = 0;
558 int deviceID,
int timeoutMs = 0) = 0;
583 int timeoutMs = 0) = 0;
596 int timeoutMs = 0) = 0;
609 int timeoutMs = 0) = 0;
622 int timeoutMs = 0) = 0;
726 int timeoutMs = 0) = 0;
741 double allowableCloseLoopError,
int timeoutMs = 0) = 0;
757 int timeoutMs = 0) = 0;
831 int timeoutMs = 0) = 0;
931 int timeoutMs = 0) = 0;
946 int timeoutMs = 0) = 0;
1309 int timeoutMs = 0) = 0;
1345 uint8_t subValue,
int ordinal,
int timeoutMs = 0) = 0;
1360 int timeoutMs = 0) = 0;
Interface for followers.
Definition IFollower.h:14
Interface for motor controllers.
Definition IMotorController.h:34
virtual void NeutralOutput()=0
Neutral the motor output by setting control mode to disabled.
virtual ErrorCode SetStatusFramePeriod(StatusFrame frame, uint8_t periodMs, int timeoutMs=0)=0
Sets the period of the given status frame.
virtual ControlMode GetControlMode()=0
virtual ErrorCode SetControlFramePeriod(ControlFrame frame, int periodMs)=0
Sets the period of the given control frame.
virtual ErrorCode ConfigMotionProfileTrajectoryPeriod(int baseTrajDurationMs, int timeoutMs=0)=0
When trajectory points are processed in the motion profile executer, the MPE determines how long to a...
virtual double GetSelectedSensorVelocity(int pidIdx=0)=0
Get the selected sensor velocity.
virtual void Set(ControlMode mode, double demand0, DemandType demand1Type, double demand1)=0
virtual ErrorCode ConfigClosedloopRamp(double secondsFromNeutralToFull, int timeoutMs=0)=0
Configures the closed-loop ramp rate of throttle output.
virtual ErrorCode ConfigRemoteFeedbackFilter(ctre::phoenix::motorcontrol::can::BaseTalon &talonRef, int remoteOrdinal, int timeoutMs=0)=0
Select what remote device and signal to assign to Remote Sensor 0 or Remote Sensor 1.
virtual ErrorCode Config_kD(int slotIdx, double value, int timeoutMs=0)=0
Sets the 'D' constant in the given parameter slot.
virtual ErrorCode ConfigMaxIntegralAccumulator(int slotIdx, double iaccum, int timeoutMs=0)=0
Sets the maximum integral accumulator in the given parameter slot.
virtual ErrorCode GetLastError()=0
Gets the last error generated by this object.
virtual ErrorCode GetStickyFaults(StickyFaults &toFill)=0
Polls the various sticky fault flags.
virtual ErrorCode ConfigRemoteFeedbackFilter(int deviceID, RemoteSensorSource remoteSensorSource, int remoteOrdinal, int timeoutMs=0)=0
Select what remote device and signal to assign to Remote Sensor 0 or Remote Sensor 1.
virtual ErrorCode ConfigSelectedFeedbackSensor(RemoteFeedbackDevice feedbackDevice, int pidIdx=0, int timeoutMs=0)=0
Select the remote feedback device for the motor controller.
virtual void SetNeutralMode(NeutralMode neutralMode)=0
Sets the mode of operation during neutral throttle output.
virtual void OverrideLimitSwitchesEnable(bool enable)=0
Sets the enable state for limit switches.
virtual ErrorCode ConfigFeedbackNotContinuous(bool feedbackNotContinuous, int timeoutMs=0)=0
Disables continuous tracking of the position for analog and pulse-width.
virtual double GetSelectedSensorPosition(int pidIdx=0)=0
Get the selected sensor position (in raw sensor units).
virtual bool IsVoltageCompensationEnabled()=0
Returns the enable state of Voltage Compensation that the caller has set.
virtual ErrorCode SetIntegralAccumulator(double iaccum, int pidIdx=0, int timeoutMs=0)=0
Sets the integral accumulator.
virtual ErrorCode ConfigLimitSwitchDisableNeutralOnLOS(bool limitSwitchDisableNeutralOnLOS, int timeoutMs=0)=0
Disables limit switches triggering (if enabled) when the sensor is no longer detected.
virtual ErrorCode ConfigAuxPIDPolarity(bool invert, int timeoutMs=0)=0
Configures the Polarity of the Auxiliary PID (PID1).
virtual ErrorCode ChangeMotionControlFramePeriod(int periodMs)=0
Calling application can opt to speed up the handshaking between the robot API and the controller to i...
virtual double GetActiveTrajectoryVelocity(int pidIdx=0)=0
Gets the active trajectory target velocity for using MotionMagic/MotionProfile control modes.
virtual ErrorCode ConfigPulseWidthPeriod_EdgesPerRot(int pulseWidthPeriod_EdgesPerRot, int timeoutMs=0)=0
Sets the edges per rotation of a pulse width sensor.
virtual double ConfigGetParameter(ParamEnum paramEnum, int ordinal, int timeoutMs=0)=0
Gets a parameter.
virtual ErrorCode ConfigVoltageMeasurementFilter(int filterWindowSamples, int timeoutMs=0)=0
Configures the voltage measurement filter.
virtual ErrorCode ConfigSoftLimitDisableNeutralOnLOS(bool softLimitDisableNeutralOnLOS, int timeoutMs=0)=0
Disables soft limits triggering (if enabled) when the sensor is no longer detected.
virtual double GetErrorDerivative(int pidIdx=0)=0
Gets the derivative of the closed-loop error.
virtual ErrorCode ConfigForwardLimitSwitchSource(RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs=0)=0
Configures the forward limit switch for a remote source.
virtual int GetDeviceID()=0
Returns the Device ID.
virtual double GetClosedLoopTarget(int pidIdx=0)=0
Gets the current target of a given closed loop.
virtual ErrorCode ConfigReverseLimitSwitchSource(RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs=0)=0
Configures the reverse limit switch for a remote source.
virtual ErrorCode ConfigNominalOutputForward(double percentOut, int timeoutMs=0)=0
Configures the forward nominal output percentage.
virtual double GetClosedLoopError(int pidIdx=0)=0
Gets the closed-loop error.
virtual ErrorCode ConfigFactoryDefault(int timeout)=0
Revert all configurations to factory default values.
virtual double GetMotorOutputPercent()=0
Gets the output percentage of the motor controller.
virtual ErrorCode ConfigNeutralDeadband(double percentDeadband, int timeoutMs=0)=0
Configures the output deadband percentage.
virtual double GetBusVoltage()=0
Gets the bus voltage seen by the device.
virtual ErrorCode Config_IntegralZone(int slotIdx, double izone, int timeoutMs=0)=0
Sets the Integral Zone constant in the given parameter slot.
virtual ErrorCode ConfigReverseSoftLimitEnable(bool enable, int timeoutMs=0)=0
Configures the reverse soft limit enable.
virtual ErrorCode Config_kF(int slotIdx, double value, int timeoutMs=0)=0
Sets the 'F' constant in the given parameter slot.
virtual bool GetInverted() const =0
virtual int ConfigGetCustomParam(int paramIndex, int timeoutMs=0)=0
Gets the value of a custom parameter.
virtual ErrorCode ClearStickyFaults(int timeoutMs=0)=0
Clears all sticky faults.
virtual ErrorCode ConfigNominalOutputReverse(double percentOut, int timeoutMs=0)=0
Configures the reverse nominal output percentage.
virtual ErrorCode GetFaults(Faults &toFill)=0
Polls the various fault flags.
virtual double GetIntegralAccumulator(int pidIdx=0)=0
Gets the iaccum value.
virtual ErrorCode ConfigAllowableClosedloopError(int slotIdx, double allowableCloseLoopError, int timeoutMs=0)=0
Sets the allowable closed-loop error in the given parameter slot.
virtual ErrorCode SelectProfileSlot(int slotIdx, int pidIdx)=0
Selects which profile slot to use for closed-loop control.
virtual double GetTemperature()=0
Gets the temperature of the motor controller.
virtual ErrorCode ConfigSetCustomParam(int newValue, int paramIndex, int timeoutMs=0)=0
Sets the value of a custom parameter.
virtual ErrorCode ConfigPeakOutputReverse(double percentOut, int timeoutMs=0)=0
Configures the reverse peak output percentage.
virtual ErrorCode SetSelectedSensorPosition(double sensorPos, int pidIdx=0, int timeoutMs=50)=0
Sets the sensor position to the given value.
virtual void Set(ControlMode Mode, double demand)=0
Sets the appropriate output on the talon, depending on the mode.
virtual ErrorCode ConfigSetParameter(ParamEnum param, double value, uint8_t subValue, int ordinal, int timeoutMs=0)=0
Sets a parameter.
virtual int GetMotionProfileTopLevelBufferCount()=0
Retrieve just the buffer count for the api-level (top) buffer.
virtual ErrorCode GetMotionProfileStatus(ctre::phoenix::motion::MotionProfileStatus &statusToFill)=0
Retrieve all status information.
virtual void SetInverted(bool invert)=0
Inverts the hbridge output of the motor controller.
virtual ErrorCode ConfigSensorTerm(SensorTerm sensorTerm, FeedbackDevice feedbackDevice, int timeoutMs=0)=0
Select what sensor term should be bound to switch feedback device.
virtual ErrorCode ConfigPulseWidthPeriod_FilterWindowSz(int pulseWidthPeriod_FilterWindowSz, int timeoutMs=0)=0
Sets the number of samples to use in smoothing a pulse width sensor with a rolling average.
virtual double GetMotorOutputVoltage()=0
virtual ErrorCode ConfigClosedLoopPeakOutput(int slotIdx, double percentOut, int timeoutMs=0)=0
Sets the peak closed-loop output.
virtual ErrorCode ConfigForwardSoftLimitThreshold(double forwardSensorLimit, int timeoutMs=0)=0
Configures the forward soft limit threhold.
virtual ErrorCode ConfigReverseSoftLimitThreshold(double reverseSensorLimit, int timeoutMs=0)=0
Configures the reverse soft limit threshold.
virtual ErrorCode ClearMotionProfileHasUnderrun(int timeoutMs=0)=0
Clear the "Has Underrun" flag.
virtual ErrorCode ConfigClosedLoopPeriod(int slotIdx, int loopTimeMs, int timeoutMs=0)=0
Sets the loop time (in milliseconds) of the PID closed-loop calculations.
virtual ErrorCode ConfigMotionSCurveStrength(int curveStrength, int timeoutMs)=0
Sets the Motion Magic S Curve Strength.
virtual ErrorCode Config_kP(int slotIdx, double value, int timeoutMs=0)=0
Sets the 'P' constant in the given parameter slot.
virtual void OverrideSoftLimitsEnable(bool enable)=0
Can be used to override-disable the soft limits.
virtual ErrorCode Config_kI(int slotIdx, double value, int timeoutMs=0)=0
Sets the 'I' constant in the given parameter slot.
virtual bool HasResetOccurred()=0
Returns true if the device has reset since last call.
virtual ErrorCode ConfigClearPositionOnQuadIdx(bool clearPositionOnQuadIdx, int timeoutMs=0)=0
Enables clearing the position of the feedback sensor when the quadrature index signal is detected.
virtual ErrorCode ConfigSelectedFeedbackCoefficient(double coefficient, int pidIdx=0, int timeoutMs=0)=0
The Feedback Coefficient is a scalar applied to the value of the feedback sensor.
virtual ErrorCode ConfigVoltageCompSaturation(double voltage, int timeoutMs=0)=0
Configures the Voltage Compensation saturation voltage.
virtual void EnableVoltageCompensation(bool enable)=0
Enables voltage compensation.
virtual ErrorCode ConfigForwardSoftLimitEnable(bool enable, int timeoutMs=0)=0
Configures the forward soft limit enable.
virtual ErrorCode ConfigOpenloopRamp(double secondsFromNeutralToFull, int timeoutMs=0)=0
Configures the open-loop ramp rate of throttle output.
virtual double GetActiveTrajectoryPosition(int pidIdx=0)=0
Gets the active trajectory target position for using MotionMagic/MotionProfile control modes.
virtual ErrorCode ConfigClearPositionOnLimitR(bool clearPositionOnLimitR, int timeoutMs=0)=0
Enables clearing the position of the feedback sensor when the reverse limit switch is triggered.
virtual int GetBaseID()=0
virtual void ProcessMotionProfileBuffer()=0
This must be called periodically to funnel the trajectory points from the API's top level buffer to t...
virtual ErrorCode ConfigMotionCruiseVelocity(double sensorUnitsPer100ms, int timeoutMs=0)=0
Sets the Motion Magic Cruise Velocity.
virtual void SetInverted(InvertType invertType)=0
Inverts the hbridge output of the motor controller in relation to the master if present.
virtual ~IMotorController()
Definition IMotorController.h:36
virtual bool IsMotionProfileTopLevelBufferFull()=0
Retrieve just the buffer full for the api-level (top) buffer.
virtual ErrorCode ConfigPeakOutputForward(double percentOut, int timeoutMs=0)=0
Configures the forward peak output percentage.
virtual ErrorCode ConfigClearPositionOnLimitF(bool clearPositionOnLimitF, int timeoutMs=0)=0
Enables clearing the position of the feedback sensor when the forward limit switch is triggered.
virtual ErrorCode ConfigMotionAcceleration(double sensorUnitsPer100msPerSec, int timeoutMs=0)=0
Sets the Motion Magic Acceleration.
virtual ErrorCode ConfigRemoteSensorClosedLoopDisableNeutralOnLOS(bool remoteSensorClosedLoopDisableNeutralOnLOS, int timeoutMs=0)=0
Disables going to neutral (brake/coast) when a remote sensor is no longer detected.
virtual double GetActiveTrajectoryArbFeedFwd(int pidIdx=0)=0
Gets the active trajectory arbitrary feedforward using MotionMagic/MotionProfile control modes.
virtual int GetStatusFramePeriod(StatusFrame frame, int timeoutMs=0)=0
Gets the period of the given status frame.
virtual void SetSensorPhase(bool PhaseSensor)=0
Sets the phase of the sensor.
virtual ErrorCode PushMotionProfileTrajectory(const ctre::phoenix::motion::TrajectoryPoint &trajPt)=0
Push another trajectory point into the top level buffer (which is emptied into the motor controller's...
virtual int GetFirmwareVersion()=0
Gets the firmware version of the device.
virtual ErrorCode ClearMotionProfileTrajectories()=0
Clear the buffered motion profile in both controller's RAM (bottom), and in the API (top).
CTRE Talon SRX Motor Controller when used on CAN Bus.
Definition BaseTalon.h:260
ControlMode
Choose the control mode for a motor controller.
Definition ControlMode.h:11
DemandType
How to interpret a demand value.
Definition DemandType.h:10
InvertType
Choose the invert type of the motor controller.
Definition InvertType.h:14
SensorTerm
Choose the sensor term for a motor controller.
Definition SensorTerm.h:11
LimitSwitchNormal
Choose whether the limit switch is normally open or normally closed.
Definition LimitSwitchType.h:62
RemoteSensorSource
Choose the remote sensor source for a motor controller.
Definition RemoteSensorSource.h:13
RemoteFeedbackDevice
Choose the remote feedback device for a motor controller.
Definition FeedbackDevice.h:131
RemoteLimitSwitchSource
Remote Limit switch source enum.
Definition LimitSwitchType.h:35
FeedbackDevice
Choose the feedback device for a motor controller.
Definition FeedbackDevice.h:14
NeutralMode
Choose the neutral mode for a motor controller.
Definition NeutralMode.h:11
ControlFrame
Control Frames for motor controllers.
Definition ControlFrame.h:11
StatusFrame
The different status frames available to motor controllers.
Definition StatusFrame.h:99
ParamEnum
Signal enumeration for generic signal access.
Definition paramEnum.h:13
ErrorCode
Definition ErrorCode.h:13
WPI Compliant Pigeon class.
Definition PigeonIMU_StickyFaults.h:6
Motion Profile Status This is simply a data transer object.
Definition MotionProfileStatus.h:15
Motion Profile Trajectory Point This is simply a data transfer object.
Definition TrajectoryPoint.h:11
All the faults available to motor controllers.
Definition Faults.h:11
All the sticky faults available to motor controllers.
Definition StickyFaults.h:11