6 #include <aerial_autonomy/uav_basic_events.h>
7 #include <glog/logging.h>
8 #include <parsernode/common.h>
15 template <
class LogicStateMachineT>
19 VLOG(1) <<
"Takingoff!";
29 template <
class LogicStateMachineT>
33 VLOG(1) <<
"Aborting Takeoff!";
43 template <
class LogicStateMachineT>
47 parsernode::common::quaddata data = robot_system.
getUAVData();
50 if (data.batterypercent >
54 LOG(WARNING) <<
"Battery too low! " << data.batterypercent
55 <<
"\% SoCannot takeoff";
66 template <
class LogicStateMachineT>
76 bool run(
UAVSystem &robot_system, LogicStateMachineT &logic_state_machine) {
77 parsernode::common::quaddata data = robot_system.
getUAVData();
79 if (data.localpos.z >=
82 VLOG(1) <<
"Completed Takeoff";
83 logic_state_machine.process_event(
Completed());
95 template <
class LogicStateMachineT>
Base state for all states in logic state machine.
Definition: base_state.h:24
Completed Event for transition from for example Landing to Landed etc.
Definition: completed_event.h:6
Internal action that returns whether it processed an event.
Definition: base_functors.h:208
Action functor that does not require the event triggering it.
Definition: base_functors.h:113
Owns, initializes, and facilitates communication between different hardware/software components...
Definition: uav_system.h:21
void run(UAVSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: takeoff_functors.h:32
Check when takeoff is complete, and ensure enough battery voltage.
Definition: takeoff_functors.h:67
void takeOff()
Public API call to takeoff.
Definition: uav_system.h:118
parsernode::common::quaddata getUAVData() const
Get sensor data from UAV.
Definition: uav_system.h:109
void land()
Public API call to land.
Definition: uav_system.h:130
Guard to avoid accidental takeoff.
Definition: takeoff_functors.h:44
void run(UAVSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: takeoff_functors.h:18
Guard functor that does not require the event triggering it.
Definition: base_functors.h:157
UAVSystemConfig getConfiguration()
Get system configuration.
Definition: uav_system.h:192
action to perform when aborting takeoff
Definition: takeoff_functors.h:30
action to take when starting takeoff
Definition: takeoff_functors.h:16
bool guard(UAVSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: takeoff_functors.h:46
bool run(UAVSystem &robot_system, LogicStateMachineT &logic_state_machine)
Function to check when takeoff is complete. If battery is low while takeoff, trigger Land event...
Definition: takeoff_functors.h:76