Skip to content

Science/spiral_cast.tl

  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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
#   Copyright (c) 2024 MBARI
#   MBARI Proprietary Information. Confidential. All Rights Reserved
#   Unauthorized copying or distribution of this file via any medium is strictly
#   prohibited.
#
#   WARNING - This file contains information whose export is restricted by the
#   Export Administration Act of 1979 (Title 50, U.S.C., App. 2401 et seq.), as
#   amended. Violations of these export laws are subject to severe civil and/or
#   criminal penalties.

mission spiral_cast {
  """
  Vehicle spirals downward, then spirals upward, stopping at specified
  depths to collect samples.
  """

  arguments {
    # Almost every mission should start with an overall timeout and a NeedCommsTime.

    MissionTimeout = 3 hour
      """
      Maximum duration of mission
      """

    Depth01 = 200 meter
      """
      Depth of sample 1.
      """

    Depth02 = 150 meter
      """
      Depth of sample 2.
      """

    Depth03 = 80 meter
      """
      Depth of sample 3.
      """

    Depth04 = 60 meter
      """
      Depth of sample 4.
      """

    Depth05 = 60 meter
      """
      Depth of sample 5.
      """

    Depth06 = 40 meter
      """
      Depth of sample 6.
      """

    Depth07 = 40 meter
      """
      Depth of sample 7.
      """

    Depth08 = 30 meter
      """
      Depth of sample 8.
      """

    Depth09 = 30 meter
      """
      Depth of sample 9.
      """

    Depth10 = 20 meter
      """
      Depth of sample 10.
      """

    Depth11 = 20 meter
      """
      Depth of sample 11.
      """

    Depth12 = 10 meter
      """
      Depth of sample 12.
      """

    Depth13 = 10 meter
      """
      Depth of sample 13.
      """

    Depth14 = 2 meter
      """
      Depth of sample 14.
      """

    Depth15 = 2 meter
      """
      Depth of sample 15.
      """

    # You probably do not need to change these.

    SettleTime = 0 second
      """
      How long to wait after reaching target depth before triggering sample.
      """

    RudderAngle = 13 degree
      """
      Rudder angle to use while performing the spiral cast.
      """

    Speed = 1 meter_per_second
      """
      Speed while performing the spiral cast.
      """

    # You are even less likely to need to change these.

    MinAltitude = 5 meter
      """
      Minimum altitude for the entire mission.
      """

    MaxDepth = 210 meter
      """
      Maximum depth for the entire mission.
      """
  }

  # Missions should almost always start with a timeout.

  timeout duration=MissionTimeout

  # Most missions will run the science sensors.

  insert Insert/Science.tl {
    redefineArg PeakDetectChlActive = true
  }

  # Most missions will use the NeedComms aggregate. In this case, we use NeedComms for the start of the mission and for the upcast, but set the dive interval to be the same as the mission timeout.

  insert id="NeedComms" Insert/NeedComms.tl

  assign in sequence NeedComms:DiveInterval = MissionTimeout

  assign in sequence NeedComms:SurfaceSpeed = Speed

  # Missions should almost always start with standard safety envelopes; most missions should not expose the parameters of these envelopes.

  insert Insert/StandardEnvelopes.tl

  assign in sequence StandardEnvelopes:MinAltitude = MinAltitude

  assign in sequence StandardEnvelopes:MaxDepth = MaxDepth

  # Check for additional instructions first.

  call id="StartingMission" refId="NeedComms"

  # Many missions will keep mass position and buoyancy volume fixed at defaults.

  behavior Guidance:Pitch {
    run in parallel

    set massPosition = Control:VerticalControl.massDefault
  }

  behavior Guidance:Buoyancy {
    run in parallel

    set position = Control:VerticalControl.buoyancyNeutral
  }

  behavior Guidance:Point {
    run in parallel

    set rudderAngle = RudderAngle
  }

  behavior Guidance:SetSpeed {
    run in parallel

    set speed = Speed
  }

  insert Insert/SampleAtDepth.tl

  assign in sequence SampleAtDepth:SettleTime = SettleTime

  aggregate SampleWithinEnvelopesWrapper {
    """
    Avoid bouncing in and out of safety envelopes. If your specified
    sample depth is too deep or too close to the seafloor, skip it.
    """

    arguments {
      TargetDepth = 1 meter
        """
        Depth to sample at.
        """
    }

    run when ( called )

    break if (
      Universal:depth >= MaxDepth
      and ( TargetDepth >= MaxDepth )
    )

    assign in sequence SampleAtDepth:TargetDepth = TargetDepth

    call id="SampleWithinEnvelopes" refId="SampleAtDepth"
  }

  aggregate Cast {
    run in sequence

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth01

    call id="Depth01" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth02

    call id="Depth02" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth03

    call id="Depth03" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth04

    call id="Depth04" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth05

    call id="Depth05" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth06

    call id="Depth06" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth07

    call id="Depth07" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth08

    call id="Depth08" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth09

    call id="Depth09" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth10

    call id="Depth10" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth11

    call id="Depth11" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth12

    call id="Depth12" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth13

    call id="Depth13" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth14

    call id="Depth14" refId="SampleWithinEnvelopesWrapper"

    assign in sequence SampleWithinEnvelopesWrapper:TargetDepth = Depth15

    call id="Depth15" refId="SampleWithinEnvelopesWrapper"
  }

  call id="CastComplete" refId="NeedComms"
}