|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
#include <iterativeMotorVelocityController.hpp>
Public Member Functions | |
| IterativeMotorVelocityController (const std::shared_ptr< AbstractMotor > &imotor, const std::shared_ptr< IterativeVelocityController< double, double > > &icontroller) | |
| Velocity controller that automatically writes to the motor. | |
| double | step (double ireading) override |
| Do one iteration of the controller. | |
| void | setTarget (double itarget) override |
| Sets the target for the controller. | |
| void | controllerSet (double ivalue) override |
| Writes the value of the controller output. | |
| double | getTarget () override |
| Gets the last set target, or the default target if none was set. | |
| double | getProcessValue () const override |
| double | getOutput () const override |
| Returns the last calculated output of the controller. | |
| double | getMaxOutput () override |
| Get the upper output bound. | |
| double | getMinOutput () override |
| Get the lower output bound. | |
| double | getError () const override |
| Returns the last error of the controller. | |
| bool | isSettled () override |
| Returns whether the controller has settled at the target. | |
| void | setSampleTime (QTime isampleTime) override |
| Set time between loops in ms. | |
| void | setOutputLimits (double imax, double imin) override |
| Set controller output bounds. | |
| void | setControllerSetTargetLimits (double itargetMax, double itargetMin) override |
| Sets the (soft) limits for the target range that controllerSet() scales into. | |
| void | reset () override |
| Resets the controller's internal state so it is similar to when it was first initialized, while keeping any user-configured information. | |
| void | flipDisable () override |
| Changes whether the controller is off or on. | |
| void | flipDisable (bool iisDisabled) override |
| Sets whether the controller is off or on. | |
| bool | isDisabled () const override |
| Returns whether the controller is currently disabled. | |
| QTime | getSampleTime () const override |
| Get the last set sample time. | |
Public Member Functions inherited from okapi::IterativeController< Input, Output > | |
| virtual Output | step (Input ireading)=0 |
| Do one iteration of the controller. | |
| virtual void | setOutputLimits (Output imax, Output imin)=0 |
| Set controller output bounds. | |
| virtual void | setControllerSetTargetLimits (Output itargetMax, Output itargetMin)=0 |
| Sets the (soft) limits for the target range that controllerSet() scales into. | |
Public Member Functions inherited from okapi::ClosedLoopController< Input, Output > | |
| virtual | ~ClosedLoopController ()=default |
| virtual void | setTarget (Input itarget)=0 |
| Sets the target for the controller. | |
Public Member Functions inherited from okapi::ControllerOutput< Input > | |
| virtual void | controllerSet (Input ivalue)=0 |
| Writes the value of the controller output. | |
Protected Attributes | |
| std::shared_ptr< AbstractMotor > | motor |
| std::shared_ptr< IterativeVelocityController< double, double > > | controller |
Definition at line 14 of file iterativeMotorVelocityController.hpp.
| okapi::IterativeMotorVelocityController::IterativeMotorVelocityController | ( | const std::shared_ptr< AbstractMotor > & | imotor, |
| const std::shared_ptr< IterativeVelocityController< double, double > > & | icontroller | ||
| ) |
Velocity controller that automatically writes to the motor.
|
override |
Writes the value of the controller output.
This method might be automatically called in another thread by the controller. The range of input values is expected to be [-1, 1].
| ivalue | the controller's output in the range [-1, 1] |
|
overridevirtual |
Changes whether the controller is off or on.
Turning the controller on after it was off will cause the controller to move to its last set target, unless it was reset in that time.
Implements okapi::ClosedLoopController< Input, Output >.
|
overridevirtual |
Sets whether the controller is off or on.
Turning the controller on after it was off will cause the controller to move to its last set target, unless it was reset in that time.
| iisDisabled | whether the controller is disabled |
Implements okapi::ClosedLoopController< Input, Output >.
|
overridevirtual |
Returns the last error of the controller.
Does not update when disabled.
Implements okapi::ClosedLoopController< Input, Output >.
|
overridevirtual |
Get the upper output bound.
Implements okapi::IterativeController< Input, Output >.
|
overridevirtual |
Get the lower output bound.
Implements okapi::IterativeController< Input, Output >.
|
overridevirtual |
Returns the last calculated output of the controller.
Implements okapi::IterativeController< Input, Output >.
|
overridevirtual |
Implements okapi::ClosedLoopController< Input, Output >.
|
overridevirtual |
Get the last set sample time.
Implements okapi::IterativeController< Input, Output >.
|
overridevirtual |
Gets the last set target, or the default target if none was set.
Implements okapi::ClosedLoopController< Input, Output >.
|
overridevirtual |
Returns whether the controller is currently disabled.
Implements okapi::ClosedLoopController< Input, Output >.
|
overridevirtual |
Returns whether the controller has settled at the target.
Determining what settling means is implementation-dependent.
Implements okapi::ClosedLoopController< Input, Output >.
|
overridevirtual |
Resets the controller's internal state so it is similar to when it was first initialized, while keeping any user-configured information.
Implements okapi::ClosedLoopController< Input, Output >.
|
override |
Sets the (soft) limits for the target range that controllerSet() scales into.
The target computed by controllerSet() is scaled into the range [-itargetMin, itargetMax].
| itargetMax | The new max target for controllerSet(). |
| itargetMin | The new min target for controllerSet(). |
|
override |
Set controller output bounds.
| imax | max output |
| imin | min output |
|
overridevirtual |
Set time between loops in ms.
| isampleTime | time between loops in ms |
Implements okapi::IterativeController< Input, Output >.
|
override |
Sets the target for the controller.
|
override |
Do one iteration of the controller.
| inewReading | new measurement |
|
protected |
Definition at line 148 of file iterativeMotorVelocityController.hpp.
|
protected |
Definition at line 147 of file iterativeMotorVelocityController.hpp.