6 #include <aerial_autonomy/uav_basic_events.h>
7 #include <glog/logging.h>
8 #include <parsernode/common.h>
10 namespace be = uav_basic_events;
17 template <
class LogicStateMachineT>
21 VLOG(1) <<
"Folding Arm!";
31 template <
class LogicStateMachineT>
35 VLOG(1) <<
"Folding Arm to right angle!";
45 template <
class LogicStateMachineT>
49 VLOG(1) <<
"Powering off Arm!";
50 robot_system.
power(
false);
59 template <
class LogicStateMachineT>
63 VLOG(1) <<
"Powering on Arm!";
64 robot_system.
power(
true);
73 template <
class LogicStateMachineT>
78 LOG(WARNING) <<
"Robot system not enabled!";
90 template <
class LogicStateMachineT>
94 LOG(WARNING) <<
"Aborting arm controller";
108 template <
class LogicStateMachineT>
111 bool run(
ArmSystem &robot_system, LogicStateMachineT &logic_state_machine) {
114 LOG(WARNING) <<
"Arm not enabled! Aborting!";
115 logic_state_machine.process_event(be::Abort());
126 template <
class LogicStateMachineT>
136 bool run(
ArmSystem &robot_system, LogicStateMachineT &logic_state_machine) {
138 VLOG(1) <<
"Completed Folding arm!";
139 logic_state_machine.process_event(
Completed());
141 }
else if (!robot_system.
enabled()) {
142 LOG(WARNING) <<
"Arm not enabled!";
143 logic_state_machine.process_event(be::Abort());
155 template <
class LogicStateMachineT>
164 template <
class LogicStateMachineT>
171 template <
class LogicStateMachineT>
Power on the arm.
Definition: arm_functors.h:60
void run(ArmSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: arm_functors.h:20
Abort arm controller.
Definition: arm_functors.h:91
void run(ArmSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: arm_functors.h:93
Base state for all states in logic state machine.
Definition: base_state.h:24
bool run(ArmSystem &robot_system, LogicStateMachineT &logic_state_machine)
Function to check when folding arm is complete. If arm is not enabled, then abort.
Definition: arm_functors.h:136
action to fold arm
Definition: arm_functors.h:18
void abortController(HardwareType hardware_type)
Remove active controller for given hardware type.
Definition: base_robot_system.h:126
Check when folding arm is complete.
Definition: arm_functors.h:127
void foldArm()
Set the arm joints to a known folded configuration.
Definition: arm_system.h:79
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
bool run(ArmSystem &robot_system, LogicStateMachineT &logic_state_machine)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: arm_functors.h:111
Action functor that does not require the event triggering it.
Definition: base_functors.h:113
action to move arm to right angle
Definition: arm_functors.h:32
bool guard(ArmSystem &robot_system_)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: arm_functors.h:76
Power off arm.
Definition: arm_functors.h:46
void run(ArmSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: arm_functors.h:62
action for checking arm status.
Definition: arm_functors.h:109
bool getCommandStatus() const
Verify the status of grip/power on/off and fold/rightArm commands.
Definition: arm_system.h:138
bool enabled() const
If arm is enabled return.
Definition: arm_system.h:145
void run(ArmSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: arm_functors.h:34
Same state as above. Used to distinguish between landing and takeoff.
Definition: arm_functors.h:165
void run(ArmSystem &robot_system)
Override this run function for different sub classes. This function performs the logic checking for e...
Definition: arm_functors.h:48
void rightArm()
Set the arm joints to a known L shaped configuration.
Definition: arm_system.h:84
Guard functor that does not require the event triggering it.
Definition: base_functors.h:157
Owns, initializes, and facilitates communication between different hardware/software components...
Definition: arm_system.h:18
Same state as above. Used to distinguish between landing and takeoff.
Definition: arm_functors.h:172
void power(bool state)
Power the arm on/off.
Definition: arm_system.h:68
Check arm is enabled before picking objects.
Definition: arm_functors.h:74