Base Controller class.
More...
#include <base_controller.h>
|
| virtual bool | run (SensorDataType sensor_data, ControlType &control) |
| | Run the control loop and return control arguments. More...
|
| |
| ControllerStatus | isConverged (SensorDataType sensor_data) |
| | Check if controller is converged. More...
|
| |
| virtual void | setGoal (GoalType goal) |
| | set the goal condition for the controller. Should use internal locking as the run function can be called from a separate thread More...
|
| |
| virtual GoalType | getGoal () const |
| | get the goal condition for the controller. Should use internal locking as the run function can be called from a separate thread More...
|
| |
| virtual | ~Controller () |
| | Destructor. More...
|
| |
|
| virtual bool | runImplementation (SensorDataType sensor_data, GoalType goal, ControlType &control)=0 |
| | Run the control loop and return control arguments. More...
|
| |
| virtual ControllerStatus | isConvergedImplementation (SensorDataType sensor_data, GoalType goal)=0 |
| | Implementation for checking convergence to be implemented by subclasses. This function is called after runImplementation function and that can be used to store any information required for checking convergence. More...
|
| |
template<class SensorDataType, class GoalType, class ControlType>
class Controller< SensorDataType, GoalType, ControlType >
Base Controller class.
subclass should implement the runImplementation function which takes as input the sensor data and the desired goal and returns a control value.
- Template Parameters
-
| SensorDataType | The type of sensor the controller takes in |
| GoalType | The type of goal the controller takes in |
| ControlType | The type of control the controller returns |
template<class SensorDataType, class GoalType, class ControlType>
template<class SensorDataType, class GoalType, class ControlType>
| virtual GoalType Controller< SensorDataType, GoalType, ControlType >::getGoal |
( |
| ) |
const |
|
inlinevirtual |
get the goal condition for the controller. Should use internal locking as the run function can be called from a separate thread
template<class SensorDataType, class GoalType, class ControlType>
Check if controller is converged.
- Parameters
-
| sensor_data | Sensor data to compare against goal for convergence checking |
- Returns
- controller status that contains an enum and debug information.
template<class SensorDataType, class GoalType, class ControlType>
| virtual ControllerStatus Controller< SensorDataType, GoalType, ControlType >::isConvergedImplementation |
( |
SensorDataType |
sensor_data, |
|
|
GoalType |
goal |
|
) |
| |
|
protectedpure virtual |
template<class SensorDataType, class GoalType, class ControlType>
| virtual bool Controller< SensorDataType, GoalType, ControlType >::run |
( |
SensorDataType |
sensor_data, |
|
|
ControlType & |
control |
|
) |
| |
|
inlinevirtual |
Run the control loop and return control arguments.
- Parameters
-
| sensor_data | Data required for control loop. Can also be estimator data |
| control | Control values to send to hardware |
- Returns
- True if the control run is successful
template<class SensorDataType, class GoalType, class ControlType>
| virtual bool Controller< SensorDataType, GoalType, ControlType >::runImplementation |
( |
SensorDataType |
sensor_data, |
|
|
GoalType |
goal, |
|
|
ControlType & |
control |
|
) |
| |
|
protectedpure virtual |
template<class SensorDataType, class GoalType, class ControlType>
| virtual void Controller< SensorDataType, GoalType, ControlType >::setGoal |
( |
GoalType |
goal | ) |
|
|
inlinevirtual |
set the goal condition for the controller. Should use internal locking as the run function can be called from a separate thread
- Parameters
-
| goal | The goal for control loop |
The documentation for this class was generated from the following file: