X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=dsl%2Fruntime%2Fspecs%2Fwander.tdsl;h=30081c8f8258f0df19c180cd0b1d1296278893b9;hb=ac44621696b120a5aec35edff6b7181a4aafa383;hp=0f764d38ec67c293c95ba31d2b8faa1b32d73790;hpb=73fb2a427446b80fb7325ff2f02f86ea38502ef4;p=des2015.git diff --git a/dsl/runtime/specs/wander.tdsl b/dsl/runtime/specs/wander.tdsl index 0f764d3..30081c8 100644 --- a/dsl/runtime/specs/wander.tdsl +++ b/dsl/runtime/specs/wander.tdsl @@ -7,6 +7,7 @@ Behaviour Drive left motor forward right motor forward wait forever + Behaviour Wander take control: action: @@ -37,106 +38,70 @@ Behaviour StayInFieldB right motor forward wait 1000 ms -Behaviour MeasureGreenLake +Behaviour GreenLake take control: (&& Color is Green not flag set GreenMeasured) action: measure Lake - set flag GreenMeasured -Behaviour MeasureBlueLake + set flag GreenLake + +Behaviour BlueLake take control: (&& Color is Blue not flag set BlueMeasured) action: measure Lake - set flag BlueMeasured -Behaviour MeasureRedLake + set flag BlueLake + +Behaviour RedLake take control: (&& Color is Red not flag set RedMeasured) 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 PushL take control: Touched on left action: right motor forward left motor backward - wait 500 ms + /*wait 500 ms right motor forward left motor forward - wait 1000 ms + wait 500ms*/ -Behaviour LocateR +Behaviour PushR take control: Touched on right action: left motor forward right motor backward - wait 500 ms + /*wait 500 ms right motor forward left motor forward - wait 1000 ms + wait 1000 ms*/ -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 - 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 + wait 10000 ms -Behaviour MeasureRock - take control: (&& Distance dangerous at front not flag set RockMeasured) +Behaviour StopPushing + take control: (&& not Touched on left not Touched on right flag set Pushing) 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 + 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 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 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