]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robofsm/strategy_get_central_buillon.cc
robofsm: Strategy pick central buillon
[eurobot/public.git] / src / robofsm / strategy_get_central_buillon.cc
1 #include "common-states.h"
2 #include "robot.h"
3 #include <ul_log.h>
4
5
6 UL_LOG_CUST(ulogd_strategy_get_central_buillon); /* Log domain name = ulogd + name of the file */
7 static FSM_STATE_DECL(pick_central_buillon);
8
9
10 FSM_STATE(get_central_buillon_first)
11 {
12         switch (FSM_EVENT) {
13                 case EV_ENTRY:
14                         start_entry();
15 #ifdef COMPETITION
16                         ul_logmsg("waiting for start\n");
17                         FSM_TIMER(1000);
18                         break;
19 #endif
20                 case EV_START:
21                         start_go();
22                         FSM_TRANSITION(pick_central_buillon);
23                         break;
24                 case EV_TIMER:
25                         FSM_TIMER(1000);
26                         start_timer();
27                         break;
28                 case EV_EXIT:
29                         start_exit();
30                         break;
31                 case EV_SWITCH_STRATEGY:
32                         //FSM_TRANSITION(ignore_central_buillon);
33                         break;
34                 default:;
35         }
36 }
37 #undef FSM_STATE_VISIBILITY
38 #define FSM_STATE_VISIBILITY static
39
40 FSM_STATE_DECL(bottle_bw);
41
42 FSM_STATE(pick_central_buillon)
43 {
44         switch (FSM_EVENT) {
45                 case EV_ENTRY:
46                         SUBFSM_TRANSITION(approach_central_buillon,NULL);
47                         break;
48                 case EV_RETURN:
49                         FSM_TRANSITION(bottle_bw);
50                         break;
51                 default:;
52         }
53 }
54
55 FSM_STATE(bottle_bw)
56 {
57         switch (FSM_EVENT) {
58                 case EV_ENTRY:
59                         SUBFSM_TRANSITION(push_bottle_bw,NULL);
60                         break;
61                 case EV_RETURN:
62                         //FSM_TRANSITION(approach_totem_dowm)
63                 default:;
64         }
65 }