Thunderbots Project
Loading...
Searching...
No Matches
get_behind_ball_fsm.h
1#pragma once
2
3#include "software/ai/hl/stp/tactic/tactic.h"
4#include "software/geom/algorithms/contains.h"
5#include "software/geom/triangle.h"
6
8{
9 public:
10 class GetBehindBallState;
11
13 {
14 // The location where the chick will be taken, i.e. where we expect the ball to be
15 // when we chip or kick it
16 Point ball_location;
17 // The direction the Robot will chick in
18 Angle chick_direction;
19 };
20
21 DEFINE_TACTIC_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS
22
24
30 void updateMove(const Update& event);
31
39 bool behindBall(const Update& event);
40
41 auto operator()()
42 {
43 using namespace boost::sml;
44
45 DEFINE_SML_STATE(GetBehindBallState)
46 DEFINE_SML_EVENT(Update)
47
48 DEFINE_SML_GUARD(behindBall)
49 DEFINE_SML_ACTION(updateMove)
50
51
52 return make_transition_table(
53 // src_state + event [guard] / action = dest_state
54 *GetBehindBallState_S + Update_E[!behindBall_G] / updateMove_A,
55 GetBehindBallState_S + Update_E[behindBall_G] / updateMove_A = X,
56 X + Update_E[!behindBall_G] / updateMove_A = GetBehindBallState_S,
57 X + Update_E / SET_STOP_PRIMITIVE_ACTION = X);
58 }
59};
Definition angle.h:15
Definition point.h:14
Definition get_behind_ball_fsm.h:13
Definition get_behind_ball_fsm.h:8
void updateMove(const Update &event)
Definition get_behind_ball_fsm.cpp:9
bool behindBall(const Update &event)
Definition get_behind_ball_fsm.cpp:24