final push
[des2015.git] / dsl / runtime / specs / wander.tdsl
index 1dc70fd..f7e3697 100644 (file)
@@ -39,19 +39,19 @@ Behaviour StayInFieldB
                wait 1000 ms
                
 Behaviour GreenLake
-       take control: (&& Color is Green not flag set GreenMeasured)
+       take control: (&& (|| Color is Green Color is Yellow) not flag set GreenLake)
        action:
                measure Lake
                set flag GreenLake
                
 Behaviour BlueLake
-       take control: (&& Color is Blue not flag set BlueMeasured)
+       take control: (&& Color is Blue not flag set BlueLake)
        action:
                measure Lake
                set flag BlueLake
                
 Behaviour RedLake
-       take control: (&& Color is Red not flag set RedMeasured)
+       take control: (&& Color is Red not flag set RedLake)
        action:
                measure Lake
                set flag RedLake
@@ -61,18 +61,30 @@ Behaviour MeasureRock
        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
                                
 Behaviour PushL
        take control: Touched on left
        action:
                right motor forward
-               left motor backward
+               left motor forward with speed 50 acceleration 1000
                
 Behaviour PushR
        take control: Touched on right
        action:
                left motor forward
-               right motor backward
+               right motor forward with speed 50 acceleration 1000
 
 Behaviour PushB
        take control: (&& Touched on left Touched on right)
@@ -85,23 +97,33 @@ Behaviour PushB
 Behaviour StopPushing
        take control: (&& not Touched on left not Touched on right flag set Pushing)
        action:
+               left motor backward
+               right motor backward
+               wait 1000ms
+               turn left exactly 180 degrees
                set flag Pushed
                
 Behaviour FoundLineL
-       take control: Light on left
+       take control: (&& (|| not flag set LeftLine not flag set RightLine) Light on left not Light on right Color is Black)
        action:
+               left motor backward with speed 75 acceleration 1000
+               right motor backward with speed 75 acceleration 1000
+               wait 1000 ms
                set flag LeftLine
 
 Behaviour FoundLineR
-       take control: Light on right
+       take control: (&& (|| not flag set LeftLine not flag set RightLine) Light on right not Light on left Color is Black)
        action:
+               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:
                left motor forward with speed 75 acceleration 1000
-               right motor backward with speed 50 acceleration 1000
+               right motor backward with speed 60 acceleration 1000
 
 Behaviour FollowLBad
        take control: (&& flag set LeftLine not Light on left)
@@ -113,7 +135,7 @@ Behaviour FollowRGood
        take control: (&& flag set RightLine Light on right)
        action:
                right motor forward with speed 75 acceleration 1000
-               left motor backward with speed 50 acceleration 1000
+               left motor backward with speed 60 acceleration 1000
 
 Behaviour FollowRBad
        take control: (&& flag set RightLine not Light on right)
@@ -122,20 +144,19 @@ Behaviour FollowRBad
                left motor forward with speed 100 acceleration 1000
                
 Behaviour FoundParkingSpace
-       take control: (&& (|| flag set LeftLine flag set RightLine) Color is White)// (|| Light on left Light on right))
+       take control: (&& (|| flag set LeftLine flag set RightLine) Color is White)
        action:
                set flag Parked
                
-               /*
-Mission FindAndMeasureLakes
-       using Wander StayInFieldR StayInFieldL StayInFieldB GreenLake RedLake BlueLake 
-       and stops when (&& flag set GreenLake flag set RedLake flag set BlueLake)
 Mission FindAndMeasureRocks
-       using Wander StayInFieldR StayInFieldL StayInFieldB MeasureRock
+       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 Wander PushL PushR PushB StopPushing StayInFieldR StayInFieldL StayInFieldB
-       and stops when flag set Pushed*/
+       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 FoundParkingSpace
+       using Drive FoundLineL FoundLineR FollowLBad FollowLGood FollowRBad FollowRGood StayInFieldB FoundParkingSpace
        and stops when flag set Parked
\ No newline at end of file