|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
#include <asyncPosPidController.hpp>
Public Member Functions | |
| AsyncPosPIDController (const std::shared_ptr< ControllerInput< double > > &iinput, const std::shared_ptr< ControllerOutput< double > > &ioutput, const TimeUtil &itimeUtil, double ikP, double ikI, double ikD, double ikBias=0, double iratio=1, std::unique_ptr< Filter > iderivativeFilter=std::make_unique< PassthroughFilter >(), const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger()) | |
| An async position PID controller. | |
| AsyncPosPIDController (const std::shared_ptr< OffsetableControllerInput > &iinput, const std::shared_ptr< ControllerOutput< double > > &ioutput, const TimeUtil &itimeUtil, double ikP, double ikI, double ikD, double ikBias=0, double iratio=1, std::unique_ptr< Filter > iderivativeFilter=std::make_unique< PassthroughFilter >(), const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger()) | |
| An async position PID controller. | |
| void | tarePosition () override |
| Sets the "absolute" zero position of the controller to its current position. | |
| void | setMaxVelocity (std::int32_t imaxVelocity) override |
| This implementation does not respect the maximum velocity. | |
| void | setGains (const IterativePosPIDController::Gains &igains) |
| Set controller gains. | |
| IterativePosPIDController::Gains | getGains () const |
| Gets the current gains. | |
Public Member Functions inherited from okapi::AsyncWrapper< double, double > | |
| AsyncWrapper (const std::shared_ptr< ControllerInput< double > > &iinput, const std::shared_ptr< ControllerOutput< double > > &ioutput, const std::shared_ptr< IterativeController< double, double > > &icontroller, const Supplier< std::unique_ptr< AbstractRate > > &irateSupplier, const double iratio=1, std::shared_ptr< Logger > ilogger=Logger::getDefaultLogger()) | |
A wrapper class that transforms an IterativeController into an AsyncController by running it in another task. | |
| AsyncWrapper (AsyncWrapper< double, double > &&other)=delete | |
| AsyncWrapper< double, double > & | operator= (AsyncWrapper< double, double > &&other)=delete |
| ~AsyncWrapper () override | |
| void | setTarget (const double itarget) override |
| Sets the target for the controller. | |
| void | controllerSet (const 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 |
| Returns the last calculated output of the controller. | |
| 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 (const QTime &isampleTime) |
| Set time between loops. | |
| void | setOutputLimits (const double imax, const double imin) |
| Set controller output bounds. | |
| void | setControllerSetTargetLimits (double itargetMax, double itargetMin) |
| Sets the (soft) limits for the target range that controllerSet() scales into. | |
| double | getMaxOutput () |
| Get the upper output bound. | |
| double | getMinOutput () |
| Get the lower output bound. | |
| 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 (const bool iisDisabled) override |
| Sets whether the controller is off or on. | |
| bool | isDisabled () const override |
| Returns whether the controller is currently disabled. | |
| void | waitUntilSettled () override |
| Blocks the current task until the controller has settled. | |
| void | startThread () |
| Starts the internal thread. | |
| CrossplatformThread * | getThread () const |
| Returns the underlying thread handle. | |
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< OffsetableControllerInput > | offsettableInput |
| std::shared_ptr< IterativePosPIDController > | internalController |
Protected Attributes inherited from okapi::AsyncWrapper< double, double > | |
| std::shared_ptr< Logger > | logger |
| Supplier< std::unique_ptr< AbstractRate > > | rateSupplier |
| std::shared_ptr< ControllerInput< double > > | input |
| std::shared_ptr< ControllerOutput< double > > | output |
| std::shared_ptr< IterativeController< double, double > > | controller |
| bool | hasFirstTarget |
| double | lastTarget |
| double | ratio |
| std::atomic_bool | dtorCalled |
| CrossplatformThread * | task |
Additional Inherited Members | |
Protected Member Functions inherited from okapi::AsyncWrapper< double, double > | |
| void | loop () |
| virtual void | resumeMovement () |
| Resumes moving after the controller is reset. | |
Static Protected Member Functions inherited from okapi::AsyncWrapper< double, double > | |
| static void | trampoline (void *context) |
Definition at line 17 of file asyncPosPidController.hpp.
| okapi::AsyncPosPIDController::AsyncPosPIDController | ( | const std::shared_ptr< ControllerInput< double > > & | iinput, |
| const std::shared_ptr< ControllerOutput< double > > & | ioutput, | ||
| const TimeUtil & | itimeUtil, | ||
| double | ikP, | ||
| double | ikI, | ||
| double | ikD, | ||
| double | ikBias = 0, |
||
| double | iratio = 1, |
||
| std::unique_ptr< Filter > | iderivativeFilter = std::make_unique< PassthroughFilter >(), |
||
| const std::shared_ptr< Logger > & | ilogger = Logger::getDefaultLogger() |
||
| ) |
An async position PID controller.
| iinput | The controller input. Will be turned into an OffsettableControllerInput. |
| ioutput | The controller output. |
| itimeUtil | The TimeUtil. |
| ikP | The proportional gain. |
| ikI | The integral gain. |
| ikD | The derivative gain. |
| ikBias | The controller bias. |
| iratio | Any external gear ratio. |
| iderivativeFilter | The derivative filter. |
| okapi::AsyncPosPIDController::AsyncPosPIDController | ( | const std::shared_ptr< OffsetableControllerInput > & | iinput, |
| const std::shared_ptr< ControllerOutput< double > > & | ioutput, | ||
| const TimeUtil & | itimeUtil, | ||
| double | ikP, | ||
| double | ikI, | ||
| double | ikD, | ||
| double | ikBias = 0, |
||
| double | iratio = 1, |
||
| std::unique_ptr< Filter > | iderivativeFilter = std::make_unique< PassthroughFilter >(), |
||
| const std::shared_ptr< Logger > & | ilogger = Logger::getDefaultLogger() |
||
| ) |
An async position PID controller.
| iinput | The controller input. |
| ioutput | The controller output. |
| itimeUtil | The TimeUtil. |
| ikP | The proportional gain. |
| ikI | The integral gain. |
| ikD | The derivative gain. |
| ikBias | The controller bias. |
| iratio | Any external gear ratio. |
| iderivativeFilter | The derivative filter. |
| IterativePosPIDController::Gains okapi::AsyncPosPIDController::getGains | ( | ) | const |
Gets the current gains.
| void okapi::AsyncPosPIDController::setGains | ( | const IterativePosPIDController::Gains & | igains | ) |
Set controller gains.
| igains | The new gains. |
|
overridevirtual |
This implementation does not respect the maximum velocity.
| imaxVelocity | Ignored. |
Implements okapi::AsyncPositionController< double, double >.
|
overridevirtual |
Sets the "absolute" zero position of the controller to its current position.
Implements okapi::AsyncPositionController< double, double >.
|
protected |
Definition at line 98 of file asyncPosPidController.hpp.
|
protected |
Definition at line 97 of file asyncPosPidController.hpp.