DockingTankLineCaptureTest.xml

Page auto-generated from XML file.

Failure

The generated TethysL source could not be parsed, likely due to source XML not being well-formed.

Below is the compile error at the TethysL level, as well as the source XML.

The TethysL file name shown below does not necessarily indicate the file exists, but hints about the actual corresponding .xml file.

Syntax error:
    --> lrauv-application/Missions/Demo/DockingTankLineCaptureTest.xml:251:5
     | 
 247 | 
 248 |   # Start mission sequence.
 249 | 
 250 |   aggregate Lap {
 251 |     aggregate Wait_for_loading {
     |     ^^^^^^^^^
 252 |       syslog info "Waiting to load for "
 253 |            + WaitForLoadTimeout ~ second
 254 | 
 255 |       behavior Guidance:Buoyancy {
     | 
Unexpected: `aggregate`
One of the following is possible:
  """
  arguments
  output
  run
  test_code
  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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
mission DockingTankLineCaptureTest {
  """
  First make the following adjustment to Insert/LineCapture
  -

          +

          Add the specific configs to dock.cfg and then the mission will:
          1.) Wait timeout for loading in launcher.
          2.) Turn on prop and arm for docking if the range is low enough.
          4.) Cable present == latch for timeout then release, float up, and end mission.
  """

  arguments {
    MissionTimeout = 7 minute
      """
      Maximum length of mission
      """

    WaitForLoadTimeout = 9 second
      """
      Time to wait prior to turning on the prop.
      """

    ElevatorDefault = -4.0 degree
      """
      Static setting for elevator.
      """

    RudderDefault = 3.0 degree
      """
      Static setting for rudder.
      """

    WaitOnDockTimeout = 5 minute
      """
      Time duration to wait on the dock after a successful line capture.
      """

    TransponderCode = Dock:Dock.transponderCode
      """
      Transponder Address.
      """

    TrackingUpdatePeriodMidcourse = 60 second
      """
      How long to wait between acoustic queries.
      """

    TrackingUpdatePeriodTerminal = 2.5 second
      """
      How long to wait between acoustic queries.
      """

    NumberOfPings = 1 count
      """
      Number of pings requested each time.
      """

    NumPingsUSBL = 5 count
      """
      Number of pings requested while in USBL mode range.
      """

    RangeUSBL = 40 meter
      """
      USBL mode range.
      """

    MinAltitude = 0.1 meter
      """
      Minimum height above the sea floor for the entire mission.
      """

    MinOffshore = 0.0001 meter
      """
      Minimum offshore distance for the entire mission.
      """

    TrackingPeriod = 60 second
      """
      Mission variable (don't change). The mission sets this variable to
      update the how long to wait between acoustic queries.
      """
  }

  output {
    DockingDepth = 1.22 meter
      """
      How deep in the tank do you want to swim?
      """

    # Mission Variables (don't change)

    Mode = -1 count
      """
      Mission variable (don't change). The mission sets this variable to
      reflect the termination status of the LineCapture insert.
      """

    NumPings = 1 count
      """
      Mission variable (don't change). The mission sets this variable to
      update the requested ping number and enter usbl mode.
      """
  }

  timeout duration=MissionTimeout

  # set up the vertical control
  behavior Guidance:Pitch {
    run in parallel
    set Guidance:Pitch.depth = DockingDepth
    set Guidance:Pitch.elevatorAngle = ElevatorDefault
    set Guidance:Pitch.massPosition = Control:VerticalControl.massDefault
  }

  # set up the horizontal control
  behavior Guidance:Point {
    run in parallel
    set Guidance:Point.rudderAngle = RudderDefault
  }

  insert Insert/LineCapture.tl


  assign in sequence LineCapture:MinOffshore = MinOffshore

  assign in sequence LineCapture:MinAltitude = MinAltitude

  # Add SetNav directives.

  insert Insert/SetNavAcoustic.tl


  # Add track acoustic contact directive.

  assign in sequence NumPings = NumberOfPings

  behavior Estimation:TrackAcousticContact id="TrackAC" {
    run in parallel
    set Estimation:TrackAcousticContact.contactLabelSetting = TransponderCode
    set Estimation:TrackAcousticContact.numberOfSamplesSetting = NumPings
    set Estimation:TrackAcousticContact.updatePeriodSetting = TrackingPeriod
  }

  aggregate UpdateNumPings_NotTerminal {
    run while (
      not ( LineCapture:GuidanceMode == LineCapture:Terminal )
      and ( not ( NumPings == NumberOfPings ) )
    )

    syslog info "No longer in Terminal. Resuming normal ranging with "
         + NumberOfPings ~ count
         + "pings."

    assign in sequence NumPings = NumberOfPings
  }

  aggregate UpdateNumPings_Terminal {
    run while ( LineCapture:GuidanceMode == LineCapture:Terminal )

    aggregate UpdateNumPingsUSBL {
      run when (
        not ( NumPings == NumPingsUSBL )
        and (
          LineCapture:Range < RangeUSBL
          and ( not ( Dock:LineCapture.guidanceMode == 5 count ) )
          # don't enter USBL mode during rollout
        )
      )

      syslog info "Entering USBL mode with "
           + NumPingsUSBL ~ count
           + "pings at "
           + LineCapture:Range ~ meter
           + "(mode "
           + Dock:LineCapture.guidanceMode ~ count
           + ")."

      assign in sequence NumPings = NumPingsUSBL
    }

    aggregate UpdateNumPingsATR {
      run when (
        not ( NumPings == NumberOfPings )
        and (
          LineCapture:Range >= RangeUSBL
          or ( Dock:LineCapture.guidanceMode == 5 count )
          # do ATR mode during rollout
        )
      )

      syslog info "Resuming normal ranging with "
           + NumberOfPings ~ count
           + "pings "
           + LineCapture:Range ~ meter
           + "(mode "
           + Dock:LineCapture.guidanceMode ~ count
           + ")."

      assign in sequence NumPings = NumberOfPings
    }
  }

  aggregate UpdatePingUpdateRate_Midcourse {
    run when (
      not ( TrackingPeriod == TrackingUpdatePeriodMidcourse )
      and (
        LineCapture:Range > LineCapture:TerminalRange
        or ( Dock:LineCapture.guidanceMode == 5 count )
        # do slow ping mode during rollout
      )
    )

    syslog info "Entering Midcourse tracking update period "
         + TrackingUpdatePeriodMidcourse ~ second
         + "sec at"
         + LineCapture:Range ~ meter
         + "(mode "
         + Dock:LineCapture.guidanceMode ~ count
         + ")."

    assign in sequence TrackingPeriod = TrackingUpdatePeriodMidcourse
  }

  aggregate UpdatePingUpdateRate_Terminal {
    run when (
      not ( TrackingPeriod == TrackingUpdatePeriodTerminal )
      and (
        LineCapture:Range <= LineCapture:TerminalRange
        and ( not ( Dock:LineCapture.guidanceMode == 5 count ) )
        # don't enter fast ping mode during rollout
      )
    )

    syslog info "Entering Terminal tracking update period "
         + TrackingUpdatePeriodTerminal ~ second
         + "sec at"
         + LineCapture:Range ~ meter
         + "(mode "
         + Dock:LineCapture.guidanceMode ~ count
         + ")."

    assign in sequence TrackingPeriod = TrackingUpdatePeriodTerminal
  }

  # Start mission sequence.

  aggregate Lap {
    aggregate Wait_for_loading {
      syslog info "Waiting to load for "
           + WaitForLoadTimeout ~ second

      behavior Guidance:Buoyancy {
        run in parallel
        set Guidance:Buoyancy.position = Control:VerticalControl.buoyancyNeutral
      }

      behavior Guidance:Wait {
        run in sequence
        set Guidance:Wait.duration = WaitForLoadTimeout
      }
    }

    assign in sequence Mode = -99 count

    # Execute the LineCapture sequence.

    call refId="LineCapture"

    assign in sequence Mode = LineCapture:GuidanceMode

    syslog info "Mode"
         + Mode ~ count

    aggregate Docked {
      run in sequence

      break if (
        Mode < 0 count
      )

      syslog info "Waiting on dock for "
           + WaitOnDockTimeout ~ minute

      behavior Dock:Docked id="Docked" {
        run in sequence
        timeout duration=WaitOnDockTimeout
      }

      aggregate Detach {
        run in sequence

        syslog important "Breaking off. Range: "
             + Estimation:TrackAcousticContact.range_to_contact ~ meter
             + "."

        behavior Dock:Undock id="Undock" {
          run in sequence
        }
      }
    }
  }
}
  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
281
282
283
284
285
286
287
288
<?xml version="1.0" encoding="UTF-8"?>
<Mission xmlns="Tethys"
       xmlns:Sensor="Tethys/Sensor" 
       xmlns:Units="Tethys/Units"
       xmlns:Estimation="Tethys/Estimation"
       xmlns:Dock="Tethys/Dock"       
       xmlns:Guidance="Tethys/Guidance"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="Tethys http://okeanids.mbari.org/tethys/Xml/Tethys.xsd
                           Tethys/Control http://okeanids.mbari.org/tethys/Xml/Control.xsd
                           Tethys/Dock http://okeanids.mbari.org/tethys/Xml/Dock.xsd
                           Tethys/Guidance http://okeanids.mbari.org/tethys/Xml/Guidance.xsd
                           Tethys/Sensor http://okeanids.mbari.org/tethys/Xml/Sensor.xsd
                           Tethys/Units http://okeanids.mbari.org/tethys/Xml/Units.xsd
                           Tethys/Universal http://okeanids.mbari.org/tethys/Xml/Universal.xsd"
       Id="DockingTankLineCaptureTest">

   <Description>
        First make the following adjustment to Insert/LineCapture
        -    <Assign><Sequence/><Arg Name="GuidanceMode"/><Arg Name="DetachFromDock"/></Assign>
        +    <Assign><Sequence/><Arg Name="GuidanceMode"/><Arg Name="Midcourse"/></Assign>
        Add the specific configs to dock.cfg and then the mission will:
        1.) Wait timeout for loading in launcher.
        2.) Turn on prop and arm for docking if the range is low enough.
        4.) Cable present == latch for timeout then release, float up, and end mission.
    </Description>

    <DefineArg Name="MissionTimeout"><Description>
        Maximum length of mission
    </Description><Units:minute/><Value>7</Value></DefineArg>

    <DefineOutput Name="DockingDepth"><Description>
        How deep in the tank do you want to swim?
    </Description><Units:meter/><Value>1.22</Value></DefineOutput>    

    <DefineArg Name="WaitForLoadTimeout"><Description>
        Time to wait prior to turning on the prop.
    </Description><Units:second/><Value>9</Value></DefineArg>    

    <DefineArg Name="ElevatorDefault"><Description>
        Static setting for elevator.
    </Description><Units:degree/><Value>-4.0</Value></DefineArg>

    <DefineArg Name="RudderDefault"><Description>
        Static setting for rudder.
    </Description><Units:degree/><Value>3.0</Value></DefineArg>

    <DefineArg Name="WaitOnDockTimeout"><Description>
        Time duration to wait on the dock after a successful line capture.
    </Description><Units:minute/><Value>5</Value></DefineArg>

    <DefineArg Name="TransponderCode"><Description>
        Transponder Address.
    </Description><Dock:Dock.transponderCode/></DefineArg>

    <DefineArg Name="TrackingUpdatePeriodMidcourse"><Description>
        How long to wait between acoustic queries.
    </Description><Units:second/><Value>60</Value></DefineArg>

    <DefineArg Name="TrackingUpdatePeriodTerminal"><Description>
        How long to wait between acoustic queries.
    </Description><Units:second/><Value>2.5</Value></DefineArg>

    <DefineArg Name="NumberOfPings"><Description>
        Number of pings requested each time.
    </Description><Units:count/><Value>1</Value></DefineArg>

    <DefineArg Name="NumPingsUSBL"><Description>
        Number of pings requested while in USBL mode range.
    </Description><Units:count/><Value>5</Value></DefineArg>

    <DefineArg Name="RangeUSBL"><Description>
        USBL mode range.
    </Description><Units:meter/><Value>40</Value></DefineArg>

    <DefineArg Name="MinAltitude"><Description>
        Minimum height above the sea floor for the entire mission.
    </Description><Units:meter/><Value>0.1</Value></DefineArg>

    <DefineArg Name="MinOffshore"><Description>
        Minimum offshore distance for the entire mission.
    </Description><Units:meter/><Value>0.0001</Value></DefineArg>


<!-- Mission Variables (don't change) -->

    <DefineOutput Name="Mode"><Description>
        Mission variable (don't change). The mission sets this variable to
        reflect the termination status of the LineCapture insert.
    </Description><Units:count/><Value>-1</Value></DefineOutput>

    <DefineOutput Name="NumPings"><Description>
        Mission variable (don't change). The mission sets this variable to
        update the requested ping number and enter usbl mode.
    </Description><Units:count/><Value>1</Value></DefineOutput>

    <DefineArg Name="TrackingPeriod"><Description>
        Mission variable (don't change). The mission sets this variable to
        update the how long to wait between acoustic queries.
    </Description><Units:second/><Value>60</Value></DefineArg>


    <Timeout Duration="MissionTimeout"/>

        <!-- set up the vertical control -->
        <Guidance:Pitch>
            <Parallel/>
            <Setting><Guidance:Pitch.depth/><Arg Name="DockingDepth"/></Setting>
            <Setting><Guidance:Pitch.elevatorAngle/><Arg Name="ElevatorDefault"/></Setting>
            <Setting><Guidance:Pitch.massPosition/><Control:VerticalControl.massDefault/></Setting>
        </Guidance:Pitch>

        <!-- set up the horizontal control -->           
        <Guidance:Point>
            <Parallel/>
            <Setting><Guidance:Point.rudderAngle/><Arg Name="RudderDefault"/></Setting>
        </Guidance:Point>



    <Insert Filename="Insert/LineCapture.tl"/>
    <Assign><Sequence/><Arg Name="LineCapture:MinOffshore"/><Arg Name="MinOffshore"/></Assign>
    <Assign><Sequence/><Arg Name="LineCapture:MinAltitude"/><Arg Name="MinAltitude"/></Assign>

<!-- Add SetNav directives. -->

    <Insert Filename="Insert/SetNavAcoustic.tl"/>

<!-- Add track acoustic contact directive. -->

    <Assign><Sequence/><Arg Name="NumPings"/><Arg Name="NumberOfPings"/></Assign>

    <Estimation:TrackAcousticContact Id="TrackAC">
        <Parallel/>
        <Setting><Estimation:TrackAcousticContact.contactLabelSetting/><Arg Name="TransponderCode"/></Setting>
        <Setting><Estimation:TrackAcousticContact.numberOfSamplesSetting/><Arg Name="NumPings"/></Setting>
        <Setting><Estimation:TrackAcousticContact.updatePeriodSetting/><Arg Name="TrackingPeriod"/></Setting>
    </Estimation:TrackAcousticContact>




    <Aggregate Id="UpdateNumPings_NotTerminal">

        <While>
            <Not><Arg Name="LineCapture:GuidanceMode"/><Eq><Arg Name="LineCapture:Terminal"/></Eq></Not>
            <And><Not><Arg Name="NumPings"/><Eq><Arg Name="NumberOfPings"/></Eq></Not></And>
        </While>

        <Syslog Severity="Info">No longer in Terminal. Resuming normal ranging with <Arg Name="NumberOfPings"/><Units:count/>pings.</Syslog>

        <Assign><Sequence/><Arg Name="NumPings"/><Arg Name="NumberOfPings"/></Assign>

    </Aggregate>


    <Aggregate Id="UpdateNumPings_Terminal">

        <While>
            <Arg Name="LineCapture:GuidanceMode"/><Eq><Arg Name="LineCapture:Terminal"/></Eq>
        </While>

        <Aggregate Id="UpdateNumPingsUSBL">

            <When>
                <Not><Arg Name="NumPings"/><Eq><Arg Name="NumPingsUSBL"/></Eq></Not>
                <And>
                    <Arg Name="LineCapture:Range"/><Lt><Arg Name="RangeUSBL"/></Lt>
                    <And><Not><Dock:LineCapture.guidanceMode/><Eq><Units:count/><Value>5</Value></Eq></Not></And> <!-- don't enter USBL mode during rollout -->
                </And>
            </When>

            <Syslog Severity="Info">Entering USBL mode with <Arg Name="NumPingsUSBL"/><Units:count/>pings at <Arg Name="LineCapture:Range"/><Units:meter/>(mode <Dock:LineCapture.guidanceMode/><Units:count/>).</Syslog>

            <Assign><Sequence/><Arg Name="NumPings"/><Arg Name="NumPingsUSBL"/></Assign>

        </Aggregate>

        <Aggregate Id="UpdateNumPingsATR">

            <When>
                <Not><Arg Name="NumPings"/><Eq><Arg Name="NumberOfPings"/></Eq></Not>
                 <And>
                     <Arg Name="LineCapture:Range"/><Ge><Arg Name="RangeUSBL"/></Ge>
                     <Or><Dock:LineCapture.guidanceMode/><Eq><Units:count/><Value>5</Value></Eq></Or> <!-- do ATR mode during rollout -->
                </And>
            </When>

            <Syslog Severity="Info">Resuming normal ranging with <Arg Name="NumberOfPings"/><Units:count/>pings <Arg Name="LineCapture:Range"/><Units:meter/>(mode <Dock:LineCapture.guidanceMode/><Units:count/>).</Syslog>

            <Assign><Sequence/><Arg Name="NumPings"/><Arg Name="NumberOfPings"/></Assign>

        </Aggregate>
    </Aggregate>


    <Aggregate Id="UpdatePingUpdateRate_Midcourse">

        <When>
            <Not><Arg Name="TrackingPeriod"/><Eq><Arg Name="TrackingUpdatePeriodMidcourse"/></Eq></Not>
            <And>
                <Arg Name="LineCapture:Range"/><Gt><Arg Name="LineCapture:TerminalRange"/></Gt>
                <Or><Dock:LineCapture.guidanceMode/><Eq><Units:count/><Value>5</Value></Eq></Or> <!-- do slow ping mode during rollout -->
            </And>
        </When>

        <Syslog Severity="Info">Entering Midcourse tracking update period <Arg Name="TrackingUpdatePeriodMidcourse"/><Units:second/>sec at<Arg Name="LineCapture:Range"/><Units:meter/>(mode <Dock:LineCapture.guidanceMode/><Units:count/>).</Syslog>

        <Assign><Sequence/><Arg Name="TrackingPeriod"/><Arg Name="TrackingUpdatePeriodMidcourse"/></Assign>

    </Aggregate>

    <Aggregate Id="UpdatePingUpdateRate_Terminal">

        <When>
            <Not><Arg Name="TrackingPeriod"/><Eq><Arg Name="TrackingUpdatePeriodTerminal"/></Eq></Not>
            <And>
                <Arg Name="LineCapture:Range"/><Le><Arg Name="LineCapture:TerminalRange"/></Le>
                <And><Not><Dock:LineCapture.guidanceMode/><Eq><Units:count/><Value>5</Value></Eq></Not></And> <!-- don't enter fast ping mode during rollout -->
            </And>
        </When>

        <Syslog Severity="Info">Entering Terminal tracking update period <Arg Name="TrackingUpdatePeriodTerminal"/><Units:second/>sec at<Arg Name="LineCapture:Range"/><Units:meter/>(mode <Dock:LineCapture.guidanceMode/><Units:count/>).</Syslog>

        <Assign><Sequence/><Arg Name="TrackingPeriod"/><Arg Name="TrackingUpdatePeriodTerminal"/></Assign>

    </Aggregate>

<!-- Start mission sequence. -->

    <Aggregate Id="Lap">

        <Aggregate Id="Wait for loading">
              <Syslog Severity="Info">Waiting to load for <Arg Name="WaitForLoadTimeout"/><Units:second/></Syslog>

            <Guidance:Buoyancy>
                <Parallel/>
                <Setting><Guidance:Buoyancy.position/><Control:VerticalControl.buoyancyNeutral/></Setting>
            </Guidance:Buoyancy>

            <Guidance:Wait>
                <Sequence/>
                <Setting><Guidance:Wait.duration/><Arg Name="WaitForLoadTimeout"/></Setting>
            </Guidance:Wait>             
        </Aggregate>

        <Assign><Sequence/><Arg Name="Mode"/><Units:count/><Value>-99</Value></Assign>

<!-- Execute the LineCapture sequence. -->

        <Call RefId="LineCapture"/>

        <Assign><Sequence/><Arg Name="Mode"/><Arg Name="LineCapture:GuidanceMode"/></Assign>

        <Syslog Severity="Info">Mode<Arg Name="Mode"/><Units:count/></Syslog>

        <Aggregate Id="Docked">

            <Sequence/>

            <Break><Arg Name="Mode"/>
                <Lt><Units:count/><Value>0</Value></Lt>
            </Break>

            <Syslog Severity="Info">Waiting on dock for <Arg Name="WaitOnDockTimeout"/><Units:minute/></Syslog>

            <Dock:Docked Id="Docked">
                <Sequence/>
                <Timeout Duration="WaitOnDockTimeout"/>
            </Dock:Docked>

            <Aggregate Id="Detach">

                <Sequence/>

                <Syslog Severity="Important">Breaking off. Range: <Estimation:TrackAcousticContact.range_to_contact/><Units:meter/>.</Syslog>

                <Dock:Undock Id="Undock">
                    <Sequence/>
                </Dock:Undock>

            </Aggregate>

        </Aggregate>

    </Aggregate>   

</Mission>