X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=dsl%2Fruntime%2Fspecs%2Fwander.tdsl;h=30081c8f8258f0df19c180cd0b1d1296278893b9;hb=ac44621696b120a5aec35edff6b7181a4aafa383;hp=5100e52dab7a780058291b526f0e3787bc75c5ce;hpb=08b6c73b2092b16b5dc1c0f2884d2e9c49c445af;p=des2015.git diff --git a/dsl/runtime/specs/wander.tdsl b/dsl/runtime/specs/wander.tdsl index 5100e52..30081c8 100644 --- a/dsl/runtime/specs/wander.tdsl +++ b/dsl/runtime/specs/wander.tdsl @@ -1,33 +1,107 @@ Acceleration 1000 -Speed 250 -Behaviour Wander +Speed 150 + +Behaviour Drive take control: action: left motor forward right motor forward wait forever - -Behaviour StayInFieldBoth - take control: (&& Light on left Light on right) + +Behaviour Wander + take control: action: - left motor backward with speed 1000 acceleration 10000 - right motor backward with speed 250 acceleration 10000 - wait 1000 ms + left motor forward + right motor forward + wait 2000 ms + turn randomly 0 to 45 degrees + left motor forward + right motor forward + wait 2000 ms + Behaviour StayInFieldL take control: Light on left action: - right motor backward with speed 250 acceleration 10000 - left motor forward with speed 250 acceleration 10000 - wait 750 ms + turn right exactly 60 degrees + wait 500 ms + Behaviour StayInFieldR take control: Light on right action: - right motor forward with speed 250 acceleration 10000 - left motor backward with speed 250 acceleration 10000 - wait 750 ms + turn left exactly 60 degrees + wait 500 ms + Behaviour StayInFieldB take control: Distance dangerous at back action: - wait 750 ms - -Mission stayinfield using Wander StayInFieldL StayInFieldR StayInFieldB StayInFieldBoth and stops when Color is Cyan \ No newline at end of file + left motor forward + right motor forward + wait 1000 ms + +Behaviour GreenLake + take control: (&& Color is Green not flag set GreenMeasured) + action: + measure Lake + set flag GreenLake + +Behaviour BlueLake + take control: (&& Color is Blue not flag set BlueMeasured) + action: + measure Lake + set flag BlueLake + +Behaviour RedLake + take control: (&& Color is Red not flag set RedMeasured) + action: + measure Lake + set flag RedLake + +Behaviour MeasureRock + take control: (&& Distance dangerous at front not flag set Measured) + action: + measure Rock + set flag Measured + +Behaviour PushL + take control: Touched on left + action: + right motor forward + left motor backward + /*wait 500 ms + right motor forward + left motor forward + wait 500ms*/ + +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*/ + +Behaviour PushB + take control: (&& Touched on left Touched on right) + action: + set flag Pushing + left motor forward + right motor forward + wait 10000 ms + +Behaviour StopPushing + take control: (&& not Touched on left not Touched on right flag set Pushing) + action: + set flag Pushed + +/*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 + 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