final push
[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 Color is Yellow) not flag set GreenLake)
43 action:
44 measure Lake
45 set flag GreenLake
46
47 Behaviour BlueLake
48 take control: (&& Color is Blue not flag set BlueLake)
49 action:
50 measure Lake
51 set flag BlueLake
52
53 Behaviour RedLake
54 take control: (&& Color is Red not flag set RedLake)
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 AvoidL
66 take control: Touched on left
67 action:
68 left motor forward
69 right motor backward
70
71 Behaviour AvoidR
72 take control: Touched on right
73 action:
74 right motor forward
75 left motor backward
76
77 Behaviour PushL
78 take control: Touched on left
79 action:
80 right motor forward
81 left motor forward with speed 50 acceleration 1000
82
83 Behaviour PushR
84 take control: Touched on right
85 action:
86 left motor forward
87 right motor forward with speed 50 acceleration 1000
88
89 Behaviour PushB
90 take control: (&& Touched on left Touched on right)
91 action:
92 set flag Pushing
93 left motor forward
94 right motor forward
95 wait forever
96
97 Behaviour StopPushing
98 take control: (&& not Touched on left not Touched on right flag set Pushing)
99 action:
100 left motor backward
101 right motor backward
102 wait 1000ms
103 turn left exactly 180 degrees
104 set flag Pushed
105
106 Behaviour FoundLineL
107 take control: (&& (|| not flag set LeftLine not flag set RightLine) Light on left not Light on right Color is Black)
108 action:
109 left motor backward with speed 75 acceleration 1000
110 right motor backward with speed 75 acceleration 1000
111 wait 1000 ms
112 set flag LeftLine
113
114 Behaviour FoundLineR
115 take control: (&& (|| not flag set LeftLine not flag set RightLine) Light on right not Light on left Color is Black)
116 action:
117 left motor backward with speed 75 acceleration 1000
118 right motor backward with speed 75 acceleration 1000
119 wait 1000 ms
120 set flag RightLine
121
122 Behaviour FollowLGood
123 take control: (&& flag set LeftLine Light on left)
124 action:
125 left motor forward with speed 75 acceleration 1000
126 right motor backward with speed 60 acceleration 1000
127
128 Behaviour FollowLBad
129 take control: (&& flag set LeftLine not Light on left)
130 action:
131 left motor forward with speed 75 acceleration 1000
132 right motor forward with speed 100 acceleration 1000
133
134 Behaviour FollowRGood
135 take control: (&& flag set RightLine Light on right)
136 action:
137 right motor forward with speed 75 acceleration 1000
138 left motor backward with speed 60 acceleration 1000
139
140 Behaviour FollowRBad
141 take control: (&& flag set RightLine not Light on right)
142 action:
143 right motor forward with speed 75 acceleration 1000
144 left motor forward with speed 100 acceleration 1000
145
146 Behaviour FoundParkingSpace
147 take control: (&& (|| flag set LeftLine flag set RightLine) Color is White)
148 action:
149 set flag Parked
150
151 Mission FindAndMeasureRocks
152 using Drive StayInFieldR StayInFieldL StayInFieldB AvoidL AvoidR MeasureRock
153 and stops when flag set Measured
154 Mission FindAndMeasureLakes
155 using Drive StayInFieldR StayInFieldL StayInFieldB AvoidL AvoidR GreenLake RedLake BlueLake
156 and stops when (&& flag set GreenLake flag set RedLake flag set BlueLake)
157 Mission PushRocks
158 using Drive PushL PushR PushB StayInFieldR StayInFieldL StayInFieldB StopPushing
159 and stops when flag set Pushed
160 Mission Park
161 using Drive FoundLineL FoundLineR FollowLBad FollowLGood FollowRBad FollowRGood StayInFieldB FoundParkingSpace
162 and stops when flag set Parked