LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::ClosedLoopController< Input, Output > Class Template Referenceabstract

An abstract closed-loop controller. More...

#include <closedLoopController.hpp>

Inheritance diagram for okapi::ClosedLoopController< Input, Output >:
okapi::ControllerOutput< Input > okapi::AsyncController< std::string, double > okapi::AsyncController< std::string, PathfinderPoint > okapi::AsyncController< double, double > okapi::IterativeController< double, double > okapi::AsyncController< Input, Output > okapi::IterativeController< Input, Output > okapi::AsyncPositionController< std::string, double > okapi::AsyncPositionController< std::string, PathfinderPoint > okapi::AsyncPositionController< double, double > okapi::AsyncVelocityController< double, double > okapi::AsyncWrapper< double, double > okapi::AsyncPositionController< Input, Output > okapi::AsyncVelocityController< Input, Output > okapi::AsyncWrapper< Input, Output > okapi::IterativePositionController< double, double > okapi::IterativeVelocityController< double, double > okapi::IterativePositionController< Input, Output > okapi::IterativeVelocityController< Input, Output >

Public Member Functions

virtual ~ClosedLoopController ()=default
 
virtual void setTarget (Input itarget)=0
 Sets the target for the controller.
 
virtual Input getTarget ()=0
 Gets the last set target, or the default target if none was set.
 
virtual Input getProcessValue () const =0
 
virtual Output getError () const =0
 Returns the last error of the controller.
 
virtual bool isSettled ()=0
 Returns whether the controller has settled at the target.
 
virtual void reset ()=0
 Resets the controller's internal state so it is similar to when it was first initialized, while keeping any user-configured information.
 
virtual void flipDisable ()=0
 Changes whether the controller is off or on.
 
virtual void flipDisable (bool iisDisabled)=0
 Sets whether the controller is off or on.
 
virtual bool isDisabled () const =0
 Returns whether the controller is currently disabled.
 
- Public Member Functions inherited from okapi::ControllerOutput< Input >
virtual void controllerSet (Input ivalue)=0
 Writes the value of the controller output.
 

Detailed Description

template<typename Input, typename Output>
class okapi::ClosedLoopController< Input, Output >

An abstract closed-loop controller.

Template Parameters
InputThe target/input type.
OutputThe error/output type.

Definition at line 19 of file closedLoopController.hpp.

Constructor & Destructor Documentation

◆ ~ClosedLoopController()

template<typename Input , typename Output >
virtual okapi::ClosedLoopController< Input, Output >::~ClosedLoopController ( )
virtualdefault

Member Function Documentation

◆ flipDisable() [1/2]

template<typename Input , typename Output >
virtual void okapi::ClosedLoopController< Input, Output >::flipDisable ( )
pure virtual

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.

Implemented in okapi::AsyncLinearMotionProfileController, okapi::AsyncMotionProfileController, okapi::AsyncPosIntegratedController, okapi::AsyncVelIntegratedController, okapi::AsyncWrapper< Input, Output >, okapi::AsyncWrapper< double, double >, okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, and okapi::IterativeVelPIDController.

◆ flipDisable() [2/2]

template<typename Input , typename Output >
virtual void okapi::ClosedLoopController< Input, Output >::flipDisable ( bool  iisDisabled)
pure virtual

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.

Parameters
iisDisabledwhether the controller is disabled

Implemented in okapi::AsyncLinearMotionProfileController, okapi::AsyncMotionProfileController, okapi::AsyncPosIntegratedController, okapi::AsyncVelIntegratedController, okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, okapi::IterativeVelPIDController, okapi::AsyncWrapper< Input, Output >, and okapi::AsyncWrapper< double, double >.

◆ getError()

template<typename Input , typename Output >
virtual Output okapi::ClosedLoopController< Input, Output >::getError ( ) const
pure virtual

◆ getProcessValue()

◆ getTarget()

◆ isDisabled()

template<typename Input , typename Output >
virtual bool okapi::ClosedLoopController< Input, Output >::isDisabled ( ) const
pure virtual

◆ isSettled()

template<typename Input , typename Output >
virtual bool okapi::ClosedLoopController< Input, Output >::isSettled ( )
pure virtual

Returns whether the controller has settled at the target.

Determining what settling means is implementation-dependent.

If the controller is disabled, this method must return true.

Returns
whether the controller is settled

Implemented in okapi::AsyncLinearMotionProfileController, okapi::AsyncMotionProfileController, okapi::AsyncPosIntegratedController, okapi::AsyncVelIntegratedController, okapi::AsyncWrapper< Input, Output >, okapi::AsyncWrapper< double, double >, okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, and okapi::IterativeVelPIDController.

◆ reset()

template<typename Input , typename Output >
virtual void okapi::ClosedLoopController< Input, Output >::reset ( )
pure virtual

◆ setTarget()

template<typename Input , typename Output >
virtual void okapi::ClosedLoopController< Input, Output >::setTarget ( Input  itarget)
pure virtual

Sets the target for the controller.

Parameters
itargetthe new target

Implemented in okapi::AsyncWrapper< Input, Output >.


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