5 #include <glog/logging.h>
29 virtual void run() = 0;
52 template <
class SensorDataType,
class GoalType,
class ControlType>
73 controller_(controller) {}
82 SensorDataType sensor_data;
86 "Cannot extract sensor data");
89 if (!controller_.run(sensor_data, control)) {
95 status_ = controller_.isConverged(sensor_data);
104 controller_.setGoal(goal);
111 GoalType
getGoal()
const {
return controller_.getGoal(); }
Base Controller class.
Definition: base_controller.h:18
void setGoal(GoalType goal)
Set the goal for controller.
Definition: base_controller_hardware_connector.h:102
virtual ControllerStatus getStatus() const =0
Provide the status of the controller.
Status of the controller.
Definition: controller_status.h:10
virtual void run()
Extracts sensor data, run controller and send data back to hardware.
Definition: base_controller_hardware_connector.h:78
Base for ControllerHardwareConnector class.
Definition: base_controller_hardware_connector.h:21
HardwareType getHardwareType()
Return the type of hardware (HardwareType) used by the controller.
Definition: base_controller_hardware_connector.h:118
Performs a single step of extracting data, running controller and sending data back to hardware...
Definition: base_controller_hardware_connector.h:53
ControllerStatus getStatus() const
Provide the status of the controller.
Definition: base_controller_hardware_connector.h:125
GoalType getGoal() const
Get the goal for controller.
Definition: base_controller_hardware_connector.h:111
ControllerHardwareConnector(Controller< SensorDataType, GoalType, ControlType > &controller, HardwareType hardware_type)
ControlHardwareConnector runs the controller and sends the commands to hardware.
Definition: base_controller_hardware_connector.h:69
virtual bool extractSensorData(SensorDataType &sensor_data)=0
extract relevant data from hardware/estimators
HardwareType hardware_type_
Type of hardware controlled by the controller.
Definition: base_controller_hardware_connector.h:152
Controller active.
Definition: controller_status.h:16
virtual ~AbstractControllerHardwareConnector()
Destructor to get polymorphism.
Definition: base_controller_hardware_connector.h:41
virtual void run()=0
Abstract run function.
HardwareType
Type of hardware used by ControllerHardwareConnector. Enum ID must be contiguous. ...
Definition: base_controller_hardware_connector.h:11
Controller is critical and unable to continue.
Definition: controller_status.h:18
virtual void sendHardwareCommands(ControlType controls)=0
Send hardware commands for example UAV rpy.