#include <ClosedLoopConfig.h>
Inherits rev::spark::BaseConfig.
|
| ClosedLoopConfig ()=default |
|
| ~ClosedLoopConfig () override=default |
|
| ClosedLoopConfig (const ClosedLoopConfig &)=delete |
|
ClosedLoopConfig & | operator= (const ClosedLoopConfig &)=delete |
|
| ClosedLoopConfig (ClosedLoopConfig &&) noexcept=delete |
|
ClosedLoopConfig & | operator= (ClosedLoopConfig &&) noexcept=delete |
|
ClosedLoopConfig & | Apply (ClosedLoopConfig &config) |
|
ClosedLoopConfig & | Apply (SmartMotionConfig &config) |
|
ClosedLoopConfig & | Apply (MAXMotionConfig &config) |
|
ClosedLoopConfig & | Pidf (double p, double i, double d, double ff, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | Pid (double p, double i, double d, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | P (double p, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | I (double i, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | D (double d, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | VelocityFF (double ff, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | DFilter (double dFilter, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | IZone (double iZone, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | MinOutput (double minOutput, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | MaxOutput (double maxOutput, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | OutputRange (double minOutput, double maxOutput, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | IMaxAccum (double iMaxAccum, ClosedLoopSlot slot=kSlot0) |
|
ClosedLoopConfig & | PositionWrappingEnabled (bool enabled) |
|
ClosedLoopConfig & | PositionWrappingMinInput (double minInput) |
|
ClosedLoopConfig & | PositionWrappingMaxInput (double maxInput) |
|
ClosedLoopConfig & | PositionWrappingInputRange (double minInput, double maxInput) |
|
ClosedLoopConfig & | SetFeedbackSensor (FeedbackSensor sensor) |
|
std::string | Flatten () override |
|
virtual | ~BaseConfig ()=default |
|
◆ FeedbackSensor
Enumerator |
---|
kNoSensor | |
kPrimaryEncoder | |
kAnalogSensor | |
kAlternateOrExternalEncoder | |
kAbsoluteEncoder | |
◆ ClosedLoopConfig() [1/3]
rev::spark::ClosedLoopConfig::ClosedLoopConfig |
( |
| ) |
|
|
default |
◆ ~ClosedLoopConfig()
rev::spark::ClosedLoopConfig::~ClosedLoopConfig |
( |
| ) |
|
|
overridedefault |
◆ ClosedLoopConfig() [2/3]
◆ ClosedLoopConfig() [3/3]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Apply() [1/3]
Applies settings from another ClosedLoopConfig to this one, including all of its nested configurations.
Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters
-
- Returns
- The updated ClosedLoopConfig for method chaining
◆ Apply() [2/3]
Applies settings from a SmartMotionConfig to this ClosedLoopConfig.
Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters
-
- Returns
- The updated ClosedLoopConfig for method chaining
◆ Apply() [3/3]
Applies settings from a MAXMotionConfig to this ClosedLoopConfig.
Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters
-
- Returns
- The updated ClosedLoopConfig for method chaining
◆ Pidf()
Set the PIDF gains of the controller for a specific closed loop slot.
- Parameters
-
p | The proportional gain value |
i | The integral gain value |
d | The derivative gain value |
ff | The velocity feedforward value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ Pid()
Set the PID gains of the controller for a specific closed loop slot.
- Parameters
-
p | The proportional gain value |
i | The integral gain value |
d | The derivative gain value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ P()
Set the proportional gain of the controller for a specific closed loop slot.
- Parameters
-
p | The proportional gain value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ I()
Set the integral gain of the controller for a specific closed loop slot.
- Parameters
-
i | The integral gain value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ D()
Set the derivative gain of the controller for a specific closed loop slot.
- Parameters
-
d | The derivative gain value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ VelocityFF()
Set the velocity feedforward gain of the controller for a specific closed loop slot.
- Parameters
-
ff | The velocity feedforward gain value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ DFilter()
Set the derivative filter of the controller for a specific closed loop slot.
- Parameters
-
dFilter | The derivative filter value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ IZone()
Set the integral zone of the controller for a specific closed loop slot.
- Parameters
-
iZone | The integral zone value |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ MinOutput()
Set the minimum output of the controller for a specific closed loop slot.
- Parameters
-
minOutput | The minimum output value in the range [-1, 1] |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ MaxOutput()
Set the maximum output of the controller for a specific closed loop slot.
- Parameters
-
maxOutput | The maximum output value in the range [-1, 1] |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ OutputRange()
Set the output range of the controller for a specific closed loop slot.
- Parameters
-
minOutput | The minimum output value in the range [-1, 1] |
maxOutput | The maximum output value in the range [-1, 1] |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ IMaxAccum()
Set the maximum I accumulator of the controller for a specific closed loop slot. This value is used to constrain the I accumulator to help manage integral wind-up.
- Parameters
-
iMaxAccum | The max value to constrain the I accumulator to |
slot | The closed loop slot to set the values for |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ PositionWrappingEnabled()
Enable or disable PID wrapping for position closed loop control.
- Parameters
-
enabled | True to enable position PID wrapping |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ PositionWrappingMinInput()
ClosedLoopConfig & ClosedLoopConfig::PositionWrappingMinInput |
( |
double |
minInput | ) |
|
Set the minimum input value for PID wrapping with position closed loop control.
- Parameters
-
minInput | The value of min input for the position |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ PositionWrappingMaxInput()
ClosedLoopConfig & ClosedLoopConfig::PositionWrappingMaxInput |
( |
double |
maxInput | ) |
|
Set the maximum input value for PID wrapping with position closed loop control
- Parameters
-
maxInput | The value of max input for the position |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ PositionWrappingInputRange()
ClosedLoopConfig & ClosedLoopConfig::PositionWrappingInputRange |
( |
double |
minInput, |
|
|
double |
maxInput |
|
) |
| |
Set the input range for PID wrapping with position closed loop control
- Parameters
-
minInput | The value of min input for the position |
maxInput | The value of max input for the position |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ SetFeedbackSensor()
Set the feedback sensor of the controller. The controller will use this sensor as the source of feedback for its closed loop control.
The default feedback sensor is assumed to be the primary encoder for either brushless or brushed mode. This can be changed to another feedback sensor for the controller such as an analog sensor, absolute encoder, or alternate/external encoder.
- Parameters
-
sensor | The feedback sensor |
- Returns
- The modified ClosedLoopConfig object for method chaining
◆ Flatten()
std::string ClosedLoopConfig::Flatten |
( |
| ) |
|
|
overridevirtual |
◆ maxMotion
◆ smartMotion
The documentation for this class was generated from the following files: