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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201 | mission adaptive_yoyo {
"""
Adaptive YoYo mission for Triton LRAUV.
"""
arguments {
MissionTimeout = 500 hour
"""
Maximum duration of mission
"""
NeedCommsTime = 100 hour
"""
How often to surface for communications
"""
# Parameters updated by the backseat via customUri (the '_.' slate namespace)
MinDepth = 10 meter
"""
Minimum depth of the yoyo envelope. Updated by backseat via _.YoYoMinDepth.
"""
MaxDepth = 60 meter
"""
Maximum depth of the yoyo envelope. Updated by backseat via _.YoYoMaxDepth.
"""
Speed = 1 meter_per_second
"""
Vehicle speed. Updated by backseat via _.speed_command.
"""
YoYoDownPitch = -15 degree
"""
Vehicle pitch while diving (negative = nose down).
"""
YoYoUpPitch = 15 degree
"""
Vehicle pitch while climbing (positive = nose up).
"""
StateUpdateDelay = 1 second
"""
Minimum time delay between state updates to avoid rapid changes.
"""
MinAltitude = 5 meter
MaxSafeDepth = 100 meter
MinOffshore = 1.5 kilometer
Repeat = 10 count
"""
Number of times to cycle through the waypoint list.
"""
Lat[1..7] = NaN degree
"""
Latitude of waypoint {$}. NaN entries are skipped. The vehicle yo-yos
while transiting to each waypoint, so at least one is required.
"""
Lon[1..7] = NaN degree
"""
Longitude of waypoint {$}. NaN entries are skipped.
"""
MassHold = true
"""
Set to True to hold mass at default position.
"""
BuoyancyHold = true
"""
Set to True to hold buoyancy at neutral position.
"""
}
# --- Mission Start ---
timeout duration=MissionTimeout
insert id="NeedComms" Insert/NeedComms.tl
assign in sequence NeedComms:DiveInterval = NeedCommsTime
insert Insert/StandardEnvelopes.tl
assign in sequence StandardEnvelopes:MinAltitude = MinAltitude
assign in sequence StandardEnvelopes:MaxDepth = MaxSafeDepth
assign in sequence StandardEnvelopes:MinOffshore = MinOffshore
# --- Backseat Parameter Updates ---
aggregate UpdateYoYoMin {
run when (
elapsed ( customUri "_.YoYoMinDepth" ) < ( elapsed ( MinDepth ) )
and ( elapsed ( MinDepth ) > StateUpdateDelay )
)
assign in sequence MinDepth = customUri "_.YoYoMinDepth"
syslog info "Backseat updated YoYo MinDepth: " + MinDepth~meter
}
aggregate UpdateYoYoMax {
run when (
elapsed ( customUri "_.YoYoMaxDepth" ) < ( elapsed ( MaxDepth ) )
and ( elapsed ( MaxDepth ) > StateUpdateDelay )
)
assign in sequence MaxDepth = customUri "_.YoYoMaxDepth"
syslog info "Backseat updated YoYo MaxDepth: " + MaxDepth~meter
}
aggregate UpdateSpeed {
run when (
elapsed ( customUri "_.speed_command" ) < ( elapsed ( Speed ) )
and (elapsed ( Speed ) > StateUpdateDelay)
)
assign in sequence Speed = customUri "_.speed_command"
}
# --- Science & Backseat Payload ---
# Science is for logging only — keep frontseat edge-detection OFF (it defaults off); the backseat owns the adaptive flip via _.GoDown.
insert id="Science" Insert/Science.tl
insert Insert/BackseatDriver.tl
assign in sequence BackseatDriver:EnableBackseat = true
insert Insert/PowerOnly.tl
behavior Guidance:BackseatDriver {
run in parallel
}
# --- Check for comms before diving ---
call id="StartingMission" priorityHere=false refId="NeedComms"
# --- Vehicle Control ---
behavior Guidance:Buoyancy {
run in parallel
set position = Control:VerticalControl.buoyancyNeutral
}
behavior Guidance:Pitch {
run while ( MassHold )
set massPosition = Control:VerticalControl.massDefault
}
behavior Guidance:SetSpeed {
run in parallel
set speed = Speed
}
# Top-level yoyo pitch + altitude limits
behavior Guidance:DepthEnvelope {
run in parallel
set downPitch = YoYoDownPitch
set upPitch = YoYoUpPitch
}
behavior Guidance:AltitudeEnvelope {
run in parallel
set minAltitude = MinAltitude
}
# --- Test waypoints: short triangle near the deploy site ---
# assign in sequence Lat[1] = 36.812 degree
# assign in sequence Lon[1] = -121.808 degree
# assign in sequence Lat[2] = 36.807 degree
# assign in sequence Lon[2] = -121.814 degree
# assign in sequence Lat[3] = 36.802 degree
# assign in sequence Lon[3] = -121.808 degree
# --- YoYo while transiting waypoints ---
aggregate Lap {
run in sequence repeat = Repeat
macro $i = 1..7 {
aggregate Wpt$i {
run in sequence
behavior Guidance:DepthEnvelope {
run in parallel
set minDepth = MinDepth
set maxDepth = MaxDepth
}
behavior Guidance:Pitch {
run while ( customUri "_.GoDown" >= 1 count )
set pitch = YoYoDownPitch
}
behavior Guidance:Pitch {
run while ( customUri "_.GoDown" < 1 count )
set pitch = YoYoUpPitch
}
behavior Guidance:Waypoint {
run in sequence
set latitude = Lat[$i]
set longitude = Lon[$i]
}
}
}
}
}
|