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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248 | mission transect {
"""
Transect mission for Triton LRAUV.
Companion frontseat mission for the adaptive backseat running the `transect`
strategy. While searching, the vehicle yo-yos within the backseat-supplied
depth band and transits the waypoint list. When the backseat detects a target
it HOCKEY-STOPS and runs a TRANSECT leg: the strategy COLLAPSES the yoyo band
to the detection depth (publishes _.YoYoMinDepth == _.YoYoMaxDepth) and drives
_.speed_command (negative during the hockey stop, positive during the leg).
This mission uses that collapsed band as the "hold depth / run the leg" signal:
the DepthEnvelope+YoYo hold the detection depth, and Guidance:Point applies a
transect rudder to sweep the hotspot. It resumes yoyo/transit when the backseat
re-opens the band. The rudder magnitude lives HERE (frontseat), so no backseat
variable beyond the ones circle_hotspot already uses is required.
"""
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.
Collapses to the detection depth (== MaxDepth) during the transect leg.
"""
MaxDepth = 60 meter
"""
Maximum depth of the yoyo envelope. Updated by backseat via _.YoYoMaxDepth.
Collapses to the detection depth (== MinDepth) during the transect leg.
"""
Speed = 1 meter_per_second
"""
Vehicle speed. Updated by backseat via _.speed_command (negative during the
hockey stop, positive during the transect leg).
"""
YoYoDownPitch = -15 degree
"""
Vehicle pitch while diving (negative = nose down).
"""
YoYoUpPitch = 15 degree
"""
Vehicle pitch while climbing (positive = nose up).
"""
TransectRudder = 15 degree
"""
Rudder angle applied during the transect leg (and hockey stop). The turn
magnitude is decided here on the frontseat, not by the backseat.
"""
TransectBandThreshold = 1 meter
"""
The yoyo band is treated as "collapsed" (transect / depth-hold mode) when
MaxDepth - MinDepth is below this. The backseat collapses the band to the
detection depth to request the leg.
"""
TransectCheckInterval = 15 second
"""
How often, while running the leg, to re-check whether the backseat still
wants it (i.e. whether the band is still collapsed). The leg breaks out as
soon as the backseat re-opens the band.
"""
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.
"""
}
# --- 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 ---
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 (mirrors sci2_peak_layer_yoyo / adaptive_yoyo) ---
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
}
behavior Guidance:DepthEnvelope {
run in parallel
set minDepth = MinDepth
set maxDepth = MaxDepth
set downPitch = YoYoDownPitch
set upPitch = YoYoUpPitch
}
behavior Guidance:AltitudeEnvelope {
run in parallel
set minAltitude = MinAltitude
}
# The yo-yo runs throughout. During the leg the backseat collapses the band
# (MinDepth == MaxDepth), so this holds the detection depth instead of yo-yoing.
behavior Guidance:YoYo {
run in parallel
set downPitch = YoYoDownPitch
set upPitch = YoYoUpPitch
}
# --- 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
# --- Transit the waypoint list; run a transect leg when the backseat
# collapses the yoyo band (detection -> hockey stop -> transect) ---
aggregate Lap {
run in sequence repeat = Repeat
macro $i = 1..7 {
aggregate Wpt$i {
run in sequence
# Band collapsed by the backseat -> leave waypoint transit for the leg.
break if ( ( MaxDepth - MinDepth ) < TransectBandThreshold )
behavior Guidance:Waypoint {
run in sequence
set latitude = Lat[$i]
set longitude = Lon[$i]
}
}
}
aggregate TransectLeg {
run in sequence
# Backseat re-opened the band (no detection / timeout) -> resume transit.
break if ( ( MaxDepth - MinDepth ) >= TransectBandThreshold )
# DepthEnvelope + YoYo (above) hold the collapsed-band depth; add the
# transect rudder here. Speed comes from _.speed_command via UpdateSpeed
# (negative = hockey stop, positive = leg), so the vehicle decelerates
# then sweeps at the detection depth.
behavior Guidance:Point {
run in parallel
set rudderAngle = TransectRudder
}
behavior Guidance:Wait {
run in sequence
set duration = TransectCheckInterval
}
}
}
}
|