]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robofsm/events.h
robofsm: Fix names of events
[eurobot/public.git] / src / robofsm / events.h
1 /**
2  * @file        events.h
3  * @brief       FSM events
4  * @author      Petr Silhavik
5  *
6  */
7
8 #include <boost/statechart/event.hpp>
9
10 #ifndef EVENTS_H
11 #define EVENTS_H
12 namespace sc = boost::statechart;
13
14 struct evTimeout : sc::event< evTimeout > {
15         void *ev_ptr;
16         evTimeout(void *par = NULL) : ev_ptr(par) {};
17 };
18
19 struct evRunSubFSM : sc::event< evRunSubFSM > {
20         void *ev_ptr;
21         evRunSubFSM(void *par = NULL) : ev_ptr(par) {};
22 };
23
24 struct evTargetDetected : sc::event< evTargetDetected > {
25         void *ev_ptr;
26         evTargetDetected(void *par = NULL) : ev_ptr(par) {};
27 };
28
29 struct evEntry : sc::event< evEntry > {
30         void *ev_ptr;
31         evEntry(void *par = NULL) : ev_ptr(par) {};
32 };
33 /**
34  * evReturn - return from subfsm.
35  */
36 struct evReturn : sc::event< evReturn > {
37         void *ev_ptr;
38         evReturn(void *par = NULL) : ev_ptr(par) {};
39 };
40
41 /**
42  * evTimer - Basic event for timeout.
43  */
44 struct evTimer : sc::event< evTimer > {
45         void *ev_ptr;
46         evTimer(void *par = NULL) : ev_ptr(par) {};
47 };
48
49 /**
50  * evStart - Changed state of start connector.
51  */
52 struct evStart : sc::event< evStart > {
53         void *ev_ptr;
54         evStart(void *par = NULL) : ev_ptr(par) {};
55 };
56
57 /**
58  * evCraneDone - Crane is in requested position.
59  */
60 struct evCraneDone : sc::event< evCraneDone > {
61         void *ev_ptr;
62         evCraneDone(void *par = NULL) : ev_ptr(par) {};
63 };
64
65 /**
66  * evCameraDone - 
67  */
68 struct evCameraDone : sc::event< evCameraDone > {
69         void *ev_ptr;
70         evCameraDone(void *par = NULL) : ev_ptr(par) {};
71 };
72
73 /**
74  * evSwitchStrategy - Switch between strategies.
75  */
76 struct evSwitchStrategy : sc::event< evSwitchStrategy > {
77         void *ev_ptr;
78         evSwitchStrategy(void *par = NULL) : ev_ptr(par) {};
79 };
80
81 /**
82  * evMotionDone - Previously submitted motion is finished.
83  */
84 struct evMotionDone : sc::event< evMotionDone > {
85         void *ev_ptr;
86         evMotionDone(void *par = NULL) : ev_ptr(par) {};
87 };
88
89 /**
90  * evMotionError - "Motion FSM cannot finish the requested command even after several attempts (obstacles on the road, lost several times etc.).
91  */
92 struct evMotionError : sc::event< evMotionError > {
93         void *ev_ptr;
94         evMotionError(void *par = NULL) : ev_ptr(par) {};
95 };
96
97 /**
98  * evMoveStop - Stop current motion as fast as possible.
99  */
100 struct evMoveStop : sc::event< evMoveStop > {
101         void *ev_ptr;
102         evMoveStop(void *par = NULL) : ev_ptr(par) {};
103 };
104
105 /**
106  * evNewTarget - New target (point or trajectory) is sent.
107  */
108 struct evNewTarget : sc::event< evNewTarget > {
109         void *ev_ptr;
110         evNewTarget(void *par = NULL) : ev_ptr(par) {};
111 };
112
113 /**
114  * evTrajectoryLost - Actual position of the robot is too far from reference.
115  */
116 struct evTrajectoryLost : sc::event< evTrajectoryLost > {
117         void *ev_ptr;
118         evTrajectoryLost(void *par = NULL) : ev_ptr(par) {};
119 };
120
121 /**
122  * evTrajectoryDone - Reference position is at the end of the previously submitted trajectory.
123  */
124 struct evTrajectoryDone : sc::event< evTrajectoryDone > {
125         void *ev_ptr;
126         evTrajectoryDone(void *par = NULL) : ev_ptr(par) {};
127 };
128
129 /**
130  * evObstacle - An obstacle is detected on actual trajectory - we must avoid it.
131  */
132 struct evObstacle : sc::event< evObstacle > {
133         void *ev_ptr;
134         evObstacle(void *par = NULL) : ev_ptr(par) {};
135 };
136
137 /**
138  * evObstacleBehind - An obstacle is behind the robot.
139  */
140 struct evObstacleBehind : sc::event< evObstacleBehind > {
141         void *ev_ptr;
142         evObstacleBehind(void *par = NULL) : ev_ptr(par) {};
143 };
144
145 /**
146  * evObstacleSide - An obstacle is beside the robot.
147  */
148 struct evObstacleSide : sc::event< evObstacleSide > {
149         void *ev_ptr;
150         evObstacleSide(void *par = NULL) : ev_ptr(par) {};
151 };
152
153 /**
154  * evCompetitionTimeout - An obstacle is beside the robot.
155  */
156 struct evCompetitionTimeout : sc::event< evCompetitionTimeout > {
157         void *ev_ptr;
158         evCompetitionTimeout(void *par = NULL) : ev_ptr(par) {};
159 };
160
161 #endif