added parking
authorMart Lubbers <mart@martlubbers.net>
Tue, 12 Jan 2016 11:15:51 +0000 (12:15 +0100)
committerMart Lubbers <mart@martlubbers.net>
Tue, 12 Jan 2016 11:15:51 +0000 (12:15 +0100)
dsl/runtime/specs/wander.tdsl

index bcf2f3b..1dc70fd 100644 (file)
@@ -87,6 +87,46 @@ Behaviour StopPushing
        action:
                set flag Pushed
                
        action:
                set flag Pushed
                
+Behaviour FoundLineL
+       take control: Light on left
+       action:
+               set flag LeftLine
+
+Behaviour FoundLineR
+       take control: Light on right
+       action:
+               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
+
+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:
+               right motor forward with speed 75 acceleration 1000
+               left motor backward with speed 50 acceleration 1000
+
+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)// (|| Light on left Light on right))
+       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 FindAndMeasureLakes
        using Wander StayInFieldR StayInFieldL StayInFieldB GreenLake RedLake BlueLake 
        and stops when (&& flag set GreenLake flag set RedLake flag set BlueLake)
@@ -95,4 +135,7 @@ Mission FindAndMeasureRocks
        and stops when flag set Measured
 Mission PushRocks
        using Wander PushL PushR PushB StopPushing StayInFieldR StayInFieldL StayInFieldB
        and stops when flag set Measured
 Mission PushRocks
        using Wander PushL PushR PushB StopPushing StayInFieldR StayInFieldL StayInFieldB
-       and stops when flag set Pushed
\ No newline at end of file
+       and stops when flag set Pushed*/
+Mission Park
+       using Drive FoundLineL FoundLineR FollowLBad FollowLGood FollowRBad FollowRGood FoundParkingSpace
+       and stops when flag set Parked
\ No newline at end of file