ASCO Aerial Autonomy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
Controller< SensorDataType, GoalType, ControlType > Class Template Referenceabstract

Base Controller class. More...

#include <base_controller.h>

Public Member Functions

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...
 

Protected Member Functions

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...
 

Detailed Description

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
SensorDataTypeThe type of sensor the controller takes in
GoalTypeThe type of goal the controller takes in
ControlTypeThe type of control the controller returns

Constructor & Destructor Documentation

template<class SensorDataType, class GoalType, class ControlType>
virtual Controller< SensorDataType, GoalType, ControlType >::~Controller ( )
inlinevirtual

Destructor.

Member Function Documentation

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>
ControllerStatus Controller< SensorDataType, GoalType, ControlType >::isConverged ( SensorDataType  sensor_data)
inline

Check if controller is converged.

Parameters
sensor_dataSensor 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

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.

Parameters
sensor_dataData to be used for checking convergence
goalThis is compared against sensor data
Returns
controller status that contains an enum and debug information.

Implemented in BuiltInVelocityController, BuiltInPositionController, ConstantHeadingDepthController, RelativePoseController, VelocityBasedPositionController, and ManualRPYTController.

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_dataData required for control loop. Can also be estimator data
controlControl 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

Run the control loop and return control arguments.

Parameters
sensor_dataData required for control loop. Can also be estimator data
goalThe set-point for the controller
controlOutput Control values to send to hardware
Returns
True if the run is successful

Implemented in ConstantHeadingDepthController, RelativePoseController, VelocityBasedPositionController, BuiltInController< GoalType >, ManualRPYTController, BuiltInController< PositionYaw >, and BuiltInController< VelocityYaw >.

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
goalThe goal for control loop

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