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

Performs a single step of extracting data, running controller and sending data back to hardware. More...

#include <base_controller_hardware_connector.h>

Inheritance diagram for ControllerHardwareConnector< SensorDataType, GoalType, ControlType >:
Inheritance graph
[legend]
Collaboration diagram for ControllerHardwareConnector< SensorDataType, GoalType, ControlType >:
Collaboration graph
[legend]

Public Member Functions

 ControllerHardwareConnector (Controller< SensorDataType, GoalType, ControlType > &controller, HardwareType hardware_type)
 ControlHardwareConnector runs the controller and sends the commands to hardware. More...
 
virtual void run ()
 Extracts sensor data, run controller and send data back to hardware. More...
 
void setGoal (GoalType goal)
 Set the goal for controller. More...
 
GoalType getGoal () const
 Get the goal for controller. More...
 
HardwareType getHardwareType ()
 Return the type of hardware (HardwareType) used by the controller. More...
 
ControllerStatus getStatus () const
 Provide the status of the controller. More...
 
- Public Member Functions inherited from AbstractControllerHardwareConnector
virtual ~AbstractControllerHardwareConnector ()
 Destructor to get polymorphism. More...
 

Protected Member Functions

virtual bool extractSensorData (SensorDataType &sensor_data)=0
 extract relevant data from hardware/estimators More...
 
virtual void sendHardwareCommands (ControlType controls)=0
 Send hardware commands for example UAV rpy. More...
 

Protected Attributes

HardwareType hardware_type_
 Type of hardware controlled by the controller. More...
 

Detailed Description

template<class SensorDataType, class GoalType, class ControlType>
class ControllerHardwareConnector< SensorDataType, GoalType, ControlType >

Performs a single step of extracting data, running controller and sending data back to hardware.

Template Parameters
SensorDataTypeType of data to take from hardware
GoalTypeType of goal for controller
ControlTypeType of control sent to hardware

Constructor & Destructor Documentation

template<class SensorDataType, class GoalType, class ControlType>
ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::ControllerHardwareConnector ( Controller< SensorDataType, GoalType, ControlType > &  controller,
HardwareType  hardware_type 
)
inline

ControlHardwareConnector runs the controller and sends the commands to hardware.

The subclass controlhardwareconnectors should take the required hardware in the constructor and implement the run function to get the command from controller and send to hardware

Parameters
controllerController to run during run function
hardware_typeType of Hardware. Used to group the connectors and ensure only one connector is running per hardware type.

Member Function Documentation

template<class SensorDataType, class GoalType, class ControlType>
virtual bool ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::extractSensorData ( SensorDataType &  sensor_data)
protectedpure virtual

extract relevant data from hardware/estimators

Parameters
sensor_dataData to be updated based on sensor measurements
Returns
true if extraction succeeded otherwise false

Implemented in VisualServoingControllerArmConnector, VisualServoingControllerDroneConnector, PositionControllerDroneConnector, BuiltInVelocityControllerDroneConnector, and ManualRPYTControllerDroneConnector.

template<class SensorDataType, class GoalType, class ControlType>
GoalType ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::getGoal ( ) const
inline

Get the goal for controller.

Returns
Goal for controller
template<class SensorDataType, class GoalType, class ControlType>
HardwareType ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::getHardwareType ( )
inline

Return the type of hardware (HardwareType) used by the controller.

Returns
return the type of hardware used by the controller
template<class SensorDataType, class GoalType, class ControlType>
ControllerStatus ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::getStatus ( ) const
inlinevirtual

Provide the status of the controller.

Returns
The status of the controller

Implements AbstractControllerHardwareConnector.

template<class SensorDataType, class GoalType, class ControlType>
virtual void ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::run ( )
inlinevirtual

Extracts sensor data, run controller and send data back to hardware.

Implements AbstractControllerHardwareConnector.

template<class SensorDataType, class GoalType, class ControlType>
virtual void ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::sendHardwareCommands ( ControlType  controls)
protectedpure virtual

Send hardware commands for example UAV rpy.

Parameters
controlsData structure the UAV is expecting

Implemented in VisualServoingControllerArmConnector, VisualServoingControllerDroneConnector, PositionControllerDroneConnector, BuiltInVelocityControllerDroneConnector, and ManualRPYTControllerDroneConnector.

template<class SensorDataType, class GoalType, class ControlType>
void ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::setGoal ( GoalType  goal)
inline

Set the goal for controller.

Parameters
goalGoal for controller

Member Data Documentation

template<class SensorDataType, class GoalType, class ControlType>
HardwareType ControllerHardwareConnector< SensorDataType, GoalType, ControlType >::hardware_type_
protected

Type of hardware controlled by the controller.

Used to group controllers. Only one controller will be running per hardware.


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