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

Closed-loop controller that steps iteratively using the step method below. More...

#include <iterativeController.hpp>

Inheritance diagram for okapi::IterativeController< Input, Output >:
okapi::ClosedLoopController< Input, Output > okapi::ControllerOutput< Input > okapi::IterativePositionController< double, double > okapi::IterativeVelocityController< double, double > okapi::IterativePositionController< Input, Output > okapi::IterativeVelocityController< Input, Output > okapi::IterativePosPIDController okapi::IterativeMotorVelocityController okapi::IterativeVelPIDController

Public Member Functions

virtual Output step (Input ireading)=0
 Do one iteration of the controller.
 
virtual Output getOutput () const =0
 Returns the last calculated output 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.
 
virtual Output getMaxOutput ()=0
 Get the upper output bound.
 
virtual Output getMinOutput ()=0
 Get the lower output bound.
 
virtual void setSampleTime (QTime isampleTime)=0
 Set time between loops.
 
virtual QTime getSampleTime () const =0
 Get the last set sample time.
 
- Public Member Functions inherited from okapi::ClosedLoopController< Input, Output >
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::IterativeController< Input, Output >

Closed-loop controller that steps iteratively using the step method below.

ControllerOutput::controllerSet() should set the controller's target to the input scaled by the output bounds.

Definition at line 19 of file iterativeController.hpp.

Member Function Documentation

◆ getMaxOutput()

template<typename Input , typename Output >
virtual Output okapi::IterativeController< Input, Output >::getMaxOutput ( )
pure virtual

Get the upper output bound.

Returns
the upper output bound

Implemented in okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, and okapi::IterativeVelPIDController.

◆ getMinOutput()

template<typename Input , typename Output >
virtual Output okapi::IterativeController< Input, Output >::getMinOutput ( )
pure virtual

Get the lower output bound.

Returns
the lower output bound

Implemented in okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, and okapi::IterativeVelPIDController.

◆ getOutput()

template<typename Input , typename Output >
virtual Output okapi::IterativeController< Input, Output >::getOutput ( ) const
pure virtual

Returns the last calculated output of the controller.

Implemented in okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, and okapi::IterativeVelPIDController.

◆ getSampleTime()

template<typename Input , typename Output >
virtual QTime okapi::IterativeController< Input, Output >::getSampleTime ( ) const
pure virtual

Get the last set sample time.

Returns
sample time

Implemented in okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, and okapi::IterativeVelPIDController.

◆ setControllerSetTargetLimits()

template<typename Input , typename Output >
virtual void okapi::IterativeController< Input, Output >::setControllerSetTargetLimits ( Output  itargetMax,
Output  itargetMin 
)
pure virtual

Sets the (soft) limits for the target range that controllerSet() scales into.

The target computed by controllerSet() is scaled into the range [-itargetMin, itargetMax].

Parameters
itargetMaxThe new max target for controllerSet().
itargetMinThe new min target for controllerSet().

◆ setOutputLimits()

template<typename Input , typename Output >
virtual void okapi::IterativeController< Input, Output >::setOutputLimits ( Output  imax,
Output  imin 
)
pure virtual

Set controller output bounds.

Parameters
imaxmax output
iminmin output

◆ setSampleTime()

template<typename Input , typename Output >
virtual void okapi::IterativeController< Input, Output >::setSampleTime ( QTime  isampleTime)
pure virtual

Set time between loops.

Parameters
isampleTimetime between loops

Implemented in okapi::IterativeMotorVelocityController, okapi::IterativePosPIDController, and okapi::IterativeVelPIDController.

◆ step()

template<typename Input , typename Output >
virtual Output okapi::IterativeController< Input, Output >::step ( Input  ireading)
pure virtual

Do one iteration of the controller.

Parameters
ireadingA new measurement.
Returns
The controller output.

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