-
Notifications
You must be signed in to change notification settings - Fork 124
Expand file tree
/
Copy pathexample_play_fsm.h
More file actions
55 lines (41 loc) · 1.16 KB
/
example_play_fsm.h
File metadata and controls
55 lines (41 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "proto/parameters.pb.h"
#include "shared/constants.h"
#include "software/ai/hl/stp/play/play.h"
#include "software/ai/hl/stp/tactic/move/move_tactic.h"
#include "software/logger/logger.h"
/**
* An example Play that moves the robots in a circle around the ball
*/
struct ExamplePlayFSM
{
class MoveState;
struct ControlParams
{
};
DEFINE_PLAY_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS
/**
* Creates an example play FSM
*
*/
explicit ExamplePlayFSM();
/**
* Action that moves the robots to certain positions around the ball
*
* @param event the ExamplePlayFSM Update event
*/
void moveToPosition(const Update& event);
auto operator()()
{
using namespace boost::sml;
DEFINE_SML_STATE(MoveState)
DEFINE_SML_EVENT(Update)
DEFINE_SML_ACTION(moveToPosition)
return make_transition_table(
// src_state + event [guard] / action = dest_state
*MoveState_S + Update_E / moveToPosition_A = MoveState_S,
X + Update_E = X);
}
private:
std::vector<std::shared_ptr<MoveTactic>> move_tactics;
};