-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault-plan.ple
More file actions
87 lines (72 loc) · 2.52 KB
/
default-plan.ple
File metadata and controls
87 lines (72 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Date Lookup time;
Command pprint (...);
Integer Lookup StartRequested;
Integer Lookup AbortRequested;
Command TurnFrontWheels(Integer);
Command TurnRearWheels(Integer);
Command MoveForward(Integer);
Command MoveBackward(Integer);
Command Stop();
CountIteration:
{
Integer stepsCount=0;
Boolean continue = true;
Boolean tickCont = true;
Boolean abortedPlan=false;
Boolean succeedPlan=false;
Duration delay = Duration ("PT1S");
Duration tolerance = Duration ("PT0.1S");
Concurrence{
AbortedPlanHandler:{
Start Lookup(AbortRequested)==1;
pprint ("Plan abortion requested.");
Stop();
abortedPlan=true;
}
PlanSuccessHandler:{
Start MainPlan.state==FINISHED && MainPlan.outcome==SUCCESS;
Stop();
pprint ("Plan success!.");
succeedPlan=true;
}
MainPlan:
{
Concurrence{
planSequence:
{
Sequence{
StepOne:{
pprint ("Blinking for 20 seconds.");
TurnFrontWheels(30);
WaitABit:{
Wait (delay*20),tolerance;
}
}
StepTwo:{
pprint ("Stopping for 10 seconds.");
MoveForward(20);
WaitABit:{
Wait (delay*10),tolerance;
}
}
StepThree:{
pprint ("Blinking again for 30 seconds.");
TurnFrontWheels(30);
WaitABit:{
Wait (delay*30),tolerance;
}
}
StepFour:{
pprint ("Turning off for last time.");
MoveForward(20);
}
LastStep:{
pprint ("Stop.");
Stop();
}
}
}
}
}
}
}