X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=dsl%2Fruntime%2Fspecs%2Fwander.tdsl;h=0f764d38ec67c293c95ba31d2b8faa1b32d73790;hb=8880a95aedaf51c028818910b64f85472d96c14e;hp=a51a0649f44c5593432bf709007f0976a894efa2;hpb=16aef029cf49685c60c422d36b54d459355e832c;p=des2015.git diff --git a/dsl/runtime/specs/wander.tdsl b/dsl/runtime/specs/wander.tdsl index a51a064..0f764d3 100644 --- a/dsl/runtime/specs/wander.tdsl +++ b/dsl/runtime/specs/wander.tdsl @@ -1,29 +1,142 @@ 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: - turn right 90 with speed 100 acceleration 10000 + turn right exactly 60 degrees + wait 500 ms + Behaviour StayInFieldR take control: Light on right action: - turn left 90 with speed 100 acceleration 10000 + 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 MeasureGreenLake + take control: (&& Color is Green not flag set GreenMeasured) + action: + measure Lake + set flag GreenMeasured +Behaviour MeasureBlueLake + take control: (&& Color is Blue not flag set BlueMeasured) + action: + measure Lake + set flag BlueMeasured +Behaviour MeasureRedLake + take control: (&& Color is Red not flag set RedMeasured) + action: + measure Lake + set flag RedMeasured + +Behaviour LocateL + take control: Touched on left + action: + right motor forward + left motor backward + wait 500 ms + right motor forward + left motor forward + wait 1000 ms + +Behaviour LocateR + 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 Push + take control: (&& Touched on left Touched on right) + action: + left motor forward + right motor forward + wait 1000 ms + +Behaviour BumpL + take control: Touched on left + action: + left motor backward with speed 50 acceleration 1000 + right motor backward + wait 2000 ms + +Behaviour BumpR + take control: Touched on right + 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 + +Behaviour MeasureRock + take control: (&& Distance dangerous at front not flag set RockMeasured) + action: + measure Rock + set flag RockMeasured + +Behaviour FindParkingL + take control: Light on left + action: + turn left exactly 10 degrees with speed 20 acceleration 1000 + +Behaviour FindParkingR + take control: Light on right + action: + turn right exactly 10 degrees with speed 20 acceleration 1000 + +Behaviour FindParkingSpace + take control: (&& Light on right Light on left) + 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