added parking
[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
71 Behaviour PushR
72 take control: Touched on right
73 action:
74 left motor forward
75 right motor backward
76
77 Behaviour PushB
78 take control: (&& Touched on left Touched on right)
79 action:
80 set flag Pushing
81 left motor forward
82 right motor forward
83 wait forever
84
85 Behaviour StopPushing
86 take control: (&& not Touched on left not Touched on right flag set Pushing)
87 action:
88 set flag Pushed
89
90 Behaviour FoundLineL
91 take control: Light on left
92 action:
93 set flag LeftLine
94
95 Behaviour FoundLineR
96 take control: Light on right
97 action:
98 set flag RightLine
99
100 Behaviour FollowLGood
101 take control: (&& flag set LeftLine Light on left)
102 action:
103 left motor forward with speed 75 acceleration 1000
104 right motor backward with speed 50 acceleration 1000
105
106 Behaviour FollowLBad
107 take control: (&& flag set LeftLine not Light on left)
108 action:
109 left motor forward with speed 75 acceleration 1000
110 right motor forward with speed 100 acceleration 1000
111
112 Behaviour FollowRGood
113 take control: (&& flag set RightLine Light on right)
114 action:
115 right motor forward with speed 75 acceleration 1000
116 left motor backward with speed 50 acceleration 1000
117
118 Behaviour FollowRBad
119 take control: (&& flag set RightLine not Light on right)
120 action:
121 right motor forward with speed 75 acceleration 1000
122 left motor forward with speed 100 acceleration 1000
123
124 Behaviour FoundParkingSpace
125 take control: (&& (|| flag set LeftLine flag set RightLine) Color is White)// (|| Light on left Light on right))
126 action:
127 set flag Parked
128
129 /*
130 Mission FindAndMeasureLakes
131 using Wander StayInFieldR StayInFieldL StayInFieldB GreenLake RedLake BlueLake
132 and stops when (&& flag set GreenLake flag set RedLake flag set BlueLake)
133 Mission FindAndMeasureRocks
134 using Wander StayInFieldR StayInFieldL StayInFieldB MeasureRock
135 and stops when flag set Measured
136 Mission PushRocks
137 using Wander PushL PushR PushB StopPushing StayInFieldR StayInFieldL StayInFieldB
138 and stops when flag set Pushed*/
139 Mission Park
140 using Drive FoundLineL FoundLineR FollowLBad FollowLGood FollowRBad FollowRGood FoundParkingSpace
141 and stops when flag set Parked