Thunderbots Project
Loading...
Searching...
No Matches
halt_fsm.h
1#pragma once
2
3#include "software/ai/hl/stp/tactic/tactic.h"
4
5struct HaltFSM
6{
7 public:
8 class StopState;
9
11 {
12 };
13
14 DEFINE_TACTIC_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS
15
19 explicit HaltFSM() {}
20
26 void updateStop(const Update& event);
27
35 bool stopDone(const Update& event);
36
37 auto operator()()
38 {
39 using namespace boost::sml;
40
41 DEFINE_SML_STATE(StopState)
42 DEFINE_SML_EVENT(Update)
43 DEFINE_SML_GUARD(stopDone)
44 DEFINE_SML_ACTION(updateStop)
45
46 return make_transition_table(
47 // src_state + event [guard] / action = dest_state
48 *StopState_S + Update_E[!stopDone_G] / updateStop_A = StopState_S,
49 StopState_S + Update_E[stopDone_G] / updateStop_A = X,
50 X + Update_E[!stopDone_G] / updateStop_A = StopState_S,
51 X + Update_E[stopDone_G] / updateStop_A = X);
52 }
53};
Definition halt_fsm.h:11
Definition halt_fsm.h:6
DEFINE_TACTIC_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS HaltFSM()
Definition halt_fsm.h:19
bool stopDone(const Update &event)
Definition halt_fsm.cpp:8
void updateStop(const Update &event)
Definition halt_fsm.cpp:3