left motor forward
right motor forward
wait forever
+
Behaviour Wander
take control:
action:
right motor forward
wait 1000 ms
-Behaviour MeasureGreenLake
- take control: (&& Color is Green not flag set GreenMeasured)
+Behaviour GreenLake
+ take control: (&& (|| Color is Green Color is Yellow) not flag set GreenLake)
action:
measure Lake
- set flag GreenMeasured
-Behaviour MeasureBlueLake
- take control: (&& Color is Blue not flag set BlueMeasured)
+ set flag GreenLake
+
+Behaviour BlueLake
+ take control: (&& Color is Blue not flag set BlueLake)
action:
measure Lake
- set flag BlueMeasured
-Behaviour MeasureRedLake
- take control: (&& Color is Red not flag set RedMeasured)
+ set flag BlueLake
+
+Behaviour RedLake
+ take control: (&& Color is Red not flag set RedLake)
action:
measure Lake
- set flag RedMeasured
+ set flag RedLake
-Behaviour LocateL
+Behaviour MeasureRock
+ take control: (&& Distance dangerous at front not flag set Measured)
+ action:
+ measure Rock
+ set flag Measured
+
+Behaviour AvoidL
take control: Touched on left
+ action:
+ left motor forward
+ right motor backward
+
+Behaviour AvoidR
+ take control: Touched on right
action:
right motor forward
left motor backward
- wait 500 ms
+
+Behaviour PushL
+ take control: Touched on left
+ action:
right motor forward
- left motor forward
- wait 1000 ms
+ left motor forward with speed 50 acceleration 1000
-Behaviour LocateR
+Behaviour PushR
take control: Touched on right
action:
left motor forward
- right motor backward
- wait 500 ms
- right motor forward
- left motor forward
- wait 1000 ms
+ right motor forward with speed 50 acceleration 1000
-Behaviour Push
+Behaviour PushB
take control: (&& Touched on left Touched on right)
action:
+ set flag Pushing
left motor forward
right motor forward
- wait 1000 ms
-
-Behaviour BumpL
- take control: Touched on left
+ wait forever
+
+Behaviour StopPushing
+ take control: (&& not Touched on left not Touched on right flag set Pushing)
action:
- left motor backward with speed 50 acceleration 1000
+ left motor backward
right motor backward
- wait 2000 ms
+ wait 1000ms
+ turn left exactly 180 degrees
+ set flag Pushed
-Behaviour BumpR
- take control: Touched on right
+Behaviour FoundLineL
+ take control: (&& (|| not flag set LeftLine not flag set RightLine) Light on left not Light on right Color is Black)
action:
- right motor backward with speed 50 acceleration 1000
- left motor backward
- wait 2000 ms
-
-Behaviour AvoidHigh
- take control: Distance dangerous at front
- action:
- turn randomly 10 to 11 degrees
+ left motor backward with speed 75 acceleration 1000
+ right motor backward with speed 75 acceleration 1000
+ wait 1000 ms
+ set flag LeftLine
-Behaviour MeasureRock
- take control: (&& Distance dangerous at front not flag set RockMeasured)
+Behaviour FoundLineR
+ take control: (&& (|| not flag set LeftLine not flag set RightLine) Light on right not Light on left Color is Black)
action:
- measure Rock
- set flag RockMeasured
-
-Behaviour FindParkingL
- take control: Light on left
+ left motor backward with speed 75 acceleration 1000
+ right motor backward with speed 75 acceleration 1000
+ wait 1000 ms
+ set flag RightLine
+
+Behaviour FollowLGood
+ take control: (&& flag set LeftLine Light on left)
action:
- turn left exactly 10 degrees with speed 20 acceleration 1000
+ left motor forward with speed 75 acceleration 1000
+ right motor backward with speed 60 acceleration 1000
-Behaviour FindParkingR
- take control: Light on right
+Behaviour FollowLBad
+ take control: (&& flag set LeftLine not Light on left)
+ action:
+ left motor forward with speed 75 acceleration 1000
+ right motor forward with speed 100 acceleration 1000
+
+Behaviour FollowRGood
+ take control: (&& flag set RightLine Light on right)
action:
- turn right exactly 10 degrees with speed 20 acceleration 1000
+ right motor forward with speed 75 acceleration 1000
+ left motor backward with speed 60 acceleration 1000
-Behaviour FindParkingSpace
- take control: (&& Light on right Light on left)
+Behaviour FollowRBad
+ take control: (&& flag set RightLine not Light on right)
+ action:
+ right motor forward with speed 75 acceleration 1000
+ left motor forward with speed 100 acceleration 1000
+
+Behaviour FoundParkingSpace
+ take control: (&& (|| flag set LeftLine flag set RightLine) Color is White)
action:
- right motor backward with speed 80 acceleration 1000
- left motor backward with speed 80 acceleration 1000
- wait 1000 ms
- turn right exactly 180 degrees
set flag Parked
-
-//Mission pushRock
-// using Drive LocateR LocateL Push StayInFieldB StayInFieldL StayInFieldR and stops when Never
-//Mission avoidHighRocks
-// using Drive AvoidHigh BumpR BumpL StayInFieldB StayInFieldL StayInFieldR and stops when Never
-Mission MeasureRocks
- using Drive StayInFieldB StayInFieldL StayInFieldR MeasureRock and stops when flag set RockMeasured
-Mission FindParkingSpaceInTheCorner
- using Wander StayInFieldB FindParkingL FindParkingR FindParkingSpace and stops when flag set Parked
-//Mission measureLakes
-// using Drive MeasureRedLake MeasureGreenLake MeasureBlueLake and stops when (&& flag set GreenMeasured flag set BlueMeasured flag set RedMeasured)
-//Mission findBlueLakeWhileAvoidingRocks
-// using Wander BumpR BumpL StayInFieldB StayInFieldL StayInFieldR and stops when Color is Blue
-//Mission findAllLakesAndMeasureThem
-// using Wander MeasureLake StayInFieldB StayInFieldL StayInFieldR and stops when Collected at least Green Blue Red
-//Mission justWander
-// using Wander Wander StayInFieldB StayInFieldL StayInFieldR and stops when Color is Cyan
\ No newline at end of file
+
+Mission FindAndMeasureRocks
+ using Drive StayInFieldR StayInFieldL StayInFieldB AvoidL AvoidR MeasureRock
+ and stops when flag set Measured
+Mission FindAndMeasureLakes
+ using Drive StayInFieldR StayInFieldL StayInFieldB AvoidL AvoidR GreenLake RedLake BlueLake
+ and stops when (&& flag set GreenLake flag set RedLake flag set BlueLake)
+Mission PushRocks
+ using Drive PushL PushR PushB StayInFieldR StayInFieldL StayInFieldB StopPushing
+ and stops when flag set Pushed
+Mission Park
+ using Drive FoundLineL FoundLineR FollowLBad FollowLGood FollowRBad FollowRGood StayInFieldB FoundParkingSpace
+ and stops when flag set Parked
\ No newline at end of file