30081c8f8258f0df19c180cd0b1d1296278893b9
[des2015.git] / dsl / runtime / specs / wander.tdsl
1 Acceleration 1000
2 Speed 150
3
4 Behaviour Drive
5 take control:
6 action:
7 left motor forward
8 right motor forward
9 wait forever
10
11 Behaviour Wander
12 take control:
13 action:
14 left motor forward
15 right motor forward
16 wait 2000 ms
17 turn randomly 0 to 45 degrees
18 left motor forward
19 right motor forward
20 wait 2000 ms
21
22 Behaviour StayInFieldL
23 take control: Light on left
24 action:
25 turn right exactly 60 degrees
26 wait 500 ms
27
28 Behaviour StayInFieldR
29 take control: Light on right
30 action:
31 turn left exactly 60 degrees
32 wait 500 ms
33
34 Behaviour StayInFieldB
35 take control: Distance dangerous at back
36 action:
37 left motor forward
38 right motor forward
39 wait 1000 ms
40
41 Behaviour GreenLake
42 take control: (&& Color is Green not flag set GreenMeasured)
43 action:
44 measure Lake
45 set flag GreenLake
46
47 Behaviour BlueLake
48 take control: (&& Color is Blue not flag set BlueMeasured)
49 action:
50 measure Lake
51 set flag BlueLake
52
53 Behaviour RedLake
54 take control: (&& Color is Red not flag set RedMeasured)
55 action:
56 measure Lake
57 set flag RedLake
58
59 Behaviour MeasureRock
60 take control: (&& Distance dangerous at front not flag set Measured)
61 action:
62 measure Rock
63 set flag Measured
64
65 Behaviour PushL
66 take control: Touched on left
67 action:
68 right motor forward
69 left motor backward
70 /*wait 500 ms
71 right motor forward
72 left motor forward
73 wait 500ms*/
74
75 Behaviour PushR
76 take control: Touched on right
77 action:
78 left motor forward
79 right motor backward
80 /*wait 500 ms
81 right motor forward
82 left motor forward
83 wait 1000 ms*/
84
85 Behaviour PushB
86 take control: (&& Touched on left Touched on right)
87 action:
88 set flag Pushing
89 left motor forward
90 right motor forward
91 wait 10000 ms
92
93 Behaviour StopPushing
94 take control: (&& not Touched on left not Touched on right flag set Pushing)
95 action:
96 set flag Pushed
97
98 /*Mission FindAndMeasureLakes
99 using Wander StayInFieldR StayInFieldL StayInFieldB GreenLake RedLake BlueLake
100 and stops when (&& flag set GreenLake flag set RedLake flag set BlueLake)
101
102 Mission FindAndMeasureRocks
103 using Wander StayInFieldR StayInFieldL StayInFieldB MeasureRock
104 and stops when flag set Measured */
105 Mission PushRocks
106 using Wander PushL PushR PushB StopPushing StayInFieldR StayInFieldL StayInFieldB
107 and stops when flag set Pushed