-
Notifications
You must be signed in to change notification settings - Fork 10
/
ReferenceMission1.plp
126 lines (114 loc) · 5.15 KB
/
ReferenceMission1.plp
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// The Notices and Disclaimers for Ocean Worlds Autonomy Testbed for Exploration
// Research and Simulation can be found in README.md in the root directory of
// this repository.
// Simplified version of the Europa Lander reference mission, Sol 0. A portion
// of the landing site is imaged; a sampling site is determined, along with
// trenching parameters; a trench is dug; tailings are removed; the sample is
// deposited into the receptacle; a (abstracted) sample analysis is performed.
#include "ow-interface.h"
LibraryAction MonitorPower (In Boolean continue,
InOut Boolean battery_temp_ok,
InOut Boolean battery_life_ok,
InOut Boolean battery_charge_ok,
InOut Boolean all_ok);
LibraryAction ImageLandingSite(In String InstanceName,
In Boolean IgnoreCrash);
LibraryAction IdentifySampleTarget (InOut Real X,
InOut Real Y,
InOut Boolean Parallel,
InOut Real GroundPos,
In String FilterType);
LibraryAction DigTrench (In Real X,
In Real Y,
In Real GroundPos,
In Real Length,
In Real BiteDepth,
In Integer NumPasses,
In Boolean Parallel);
LibraryAction RemoveTailings (In Real X,
In Real Y,
In Real GroundPos,
In Boolean Parallel);
LibraryAction CollectSample (In Real X,
In Real Y,
In Real GroundPos,
In Real Depth,
In Real Length,
In Boolean Parallel);
LibraryAction StartSampleAnalysis;
ReferenceMission1: Concurrence
{
Boolean MissionInProgress = true;
// Not effectively used, but added for backwards-compatibility. See
// ReferenceMission2.plp for example usage.
Boolean BatteryOK = true;
// Power monitoring
Boolean BatteryTempOK = true;
Boolean BatteryLifeOK = true;
Boolean BatteryChargeOK = true;
// NOTE: The return status BatteryOK is not used in this plan, but is used in
// ReferenceMission2.plp.
LibraryCall MonitorPower (continue = MissionInProgress,
battery_temp_ok = BatteryTempOK,
battery_life_ok = BatteryLifeOK,
battery_charge_ok = BatteryChargeOK,
all_ok = BatteryOK);
// As of Release 13, goal errors are not automatically cleared by
// the simulator. Add this call to any plan where this may be
// important, running it concurrently with the other nodes.
LibraryCall GoalErrorMonitor (continue = MissionInProgress);
Mission:
{
// These 4 variables are assigned in the call to IdentifySampleTarget.
Real trench_x, trench_y, ground_pos;
Boolean parallel;
// Max length possible is twice the radius of the arm/scoop (.48), i.e. .96.
// However, the max value is generally not appropriate because the scoop
// should not be inserted so deep into the ground. Here, estimating a
// reasonable value given the other trenching parameters used.
Real trench_length = 0.6;
log_info ("Starting Reference Mission 1, Sol 0 ...");
LibraryCall ImageLandingSite (InstanceName = "ReferenceMission1",
IgnoreCrash = true);
LibraryCall IdentifySampleTarget (X = trench_x,
Y = trench_y,
GroundPos = ground_pos,
Parallel = parallel,
FilterType = "Brown");
if (! isKnown(ground_pos)) {
log_warning ("Sampling location could not be found visually. ",
"Using default dig location.");
ground_pos = -0.18;
trench_x = 1.77;
trench_y = -0.08;
parallel = true;
}
endif;
LibraryCall ArmUnstow();
LibraryCall DigTrench (X = trench_x,
Y = trench_y,
GroundPos = ground_pos,
Length = trench_length,
BiteDepth = 0.03,
NumPasses = 2,
Parallel = parallel);
LibraryCall RemoveTailings (X = trench_x,
Y = trench_y,
GroundPos = ground_pos,
Parallel = parallel);
LibraryCall CollectSample (X = trench_x,
Y = trench_y,
GroundPos = ground_pos,
Depth = 0.08,
Length = trench_length,
Parallel = parallel);
Finish: Concurrence
{
LibraryCall StartSampleAnalysis;
LibraryCall SafeStow();
}
LibraryCall DockIngestSample();
MissionInProgress = false;
log_info ("Reference Mission 1, Sol 0 complete.");
}
}