8 #include <aerial_autonomy/uav_basic_events.h>
9 #include <glog/logging.h>
10 #include <parsernode/common.h>
12 namespace be = uav_basic_events;
19 template <
class LogicStateMachineT>
32 template <
class LogicStateMachineT>
36 LOG(WARNING) <<
"Aborting UAV Controller";
47 template <
class LogicStateMachineT>
49 :
GuardFunctor<PositionYaw, UAVSystem, LogicStateMachineT> {
51 parsernode::common::quaddata data = robot_system.
getUAVData();
52 geometry_msgs::Vector3 current_position = data.localpos;
55 const double &tolerance_pos =
58 if (std::abs(current_position.x - goal.
x) > tolerance_pos ||
59 std::abs(current_position.y - goal.
y) > tolerance_pos ||
60 std::abs(current_position.z - goal.
z) > tolerance_pos) {
61 LOG(WARNING) <<
"Goal not within the position tolerance";
73 template <
class LogicStateMachineT>
85 template <
class LogicStateMachineT>
Logic to abort if controller status is critical.
Definition: hovering_functors.h:57
double y
y component in m
Definition: position.h:23
Base state for all states in logic state machine.
Definition: base_state.h:24
void abortController(HardwareType hardware_type)
Remove active controller for given hardware type.
Definition: base_robot_system.h:126
Transition action to perform when going into position control mode.
Definition: position_control_functors.h:20
double x
x component in m
Definition: position.h:22
Stores Position, yaw. PositionYaw is used as the goal for UAV systems.
Definition: position_yaw.h:10
bool guard(const PositionYaw &goal, UAVSystem &robot_system)
Override this guard function for different sub classes. This function decides whether to call the run...
Definition: position_control_functors.h:50
void run(UAVSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: position_control_functors.h:35
Action functor that does not require the event triggering it.
Definition: base_functors.h:113
void setGoal(GoalT goal)
sets goal to the connector and swaps the active connector with the specified connector type...
Definition: base_robot_system.h:59
Owns, initializes, and facilitates communication between different hardware/software components...
Definition: uav_system.h:21
Action Functor for a given event, robot system, state machine.
Definition: base_functors.h:68
Action Functor for a given event, robot system, state machine.
Definition: base_functors.h:20
Manages communication between a drone plugin and a position controller that outputs position commands...
Definition: position_controller_drone_connector.h:14
parsernode::common::quaddata getUAVData() const
Get sensor data from UAV.
Definition: uav_system.h:109
void run(const PositionYaw &goal, UAVSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: position_control_functors.h:22
Internal action when hovering.
Definition: hovering_functors.h:21
double z
z component in m
Definition: position.h:24
UAVSystemConfig getConfiguration()
Get system configuration.
Definition: uav_system.h:192
Action sequence that runs until one of the actions returns false.
Definition: shorting_action_sequence.h:46
Transition action to perform when aborting any UAV Controller.
Definition: position_control_functors.h:33
Guard function to check the goal is within tolerance before starting towards goal.
Definition: position_control_functors.h:48