Drift surface gps.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/Engineering/drift_surface_gps.xml:170:5
     | 
 166 | 
 167 |     syslog important "\n\t    HFRCMVSD.loadAtStartup: "
 168 |          + customUri "HFRCMVirtualSurfaceDrifter.loadAtStartup" ~ bool
 169 | 
 170 |     Estimation:ReinitializeHFRCMVirtualSurfaceDrifter #! xml2tethysl note: A non-behavior Tethys definition used by itself.
     |     ^^^^^^^^^^
 171 | 
 172 | 
 173 |     syslog important "Reinitialized virtual drifter location to current vehicle location."
 174 |   }
     | 
Unexpected: `Estimation`
One of the following is possible (total 12):
  aggregate
  assign
  behavior
  call
  insert
  readData
  readDatum
  sendData
  syslog
  touch
  macro
  }
  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
# -   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 drift {
  """
  Vehicle drifts at the surface, continuously recording GPS signals. If
  enabled, it also estimates the evolving location of a surface drifter
  using the HFRCM components.
  """

  arguments {
    MinAltitude = 10.0 meter
      """
      Minimum height above the sea floor for the entire mission.
      """

    MaxDepth = 5.0 meter
      """
      Maximum depth for the entire mission.
      """

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

    NeedCommsTime = 12 minute
      """
      Elapsed time after previous surface communications when vehicle will
      begin to attempt additional surface communications.
      """

    Timeout = 6 hour
      """
      Maximum length of mission
      """

    BuoyancyMax = Control:VerticalControl.buoyancyLimitHiCC
      """
      Buoyancy bladder position for drifting at the surface. This defaults to
      buoyancyLimitHiCC setting in the Config/Control.cfg file.
      """

    MassDefault = Control:VerticalControl.massDefault
      """
      Static setting for mass during the mission. This defaults to massDefault
      setting in the Config/Confrol.cfg file.
      """
  }

  # massPositionLimitFwd setting in the Config/Confrol.cfg file.
  #     </Description><Control:VerticalControl.massPositionLimitFwd/></DefineArg>

  timeout duration=Timeout

  aggregate AltEnvWrapper {
    run when (
      MinAltitude > 0 meter
    )

    behavior Guidance:AltitudeEnvelope {
      """
      Safety behavior that keeps vehicle off sea floor
      """
      run in parallel
      set Guidance:AltitudeEnvelope.minAltitude = MinAltitude
    }
  }

  behavior Guidance:DepthEnvelope {
    """
    Safety behavior that keeps vehicle from going too deep
    """
    run in parallel
    set Guidance:DepthEnvelope.maxDepth = MaxDepth
  }

  aggregate OffshoreWrapper {
    run when (
      MinOffshore > 0 meter
    )

    behavior Guidance:OffshoreEnvelope {
      """
      Safety behavior that keeps vehicle away from the shore
      """
      run in parallel
      set Guidance:OffshoreEnvelope.minOffshore = MinOffshore
    }
  }

  behavior Guidance:Pitch {
    run in parallel
    set Guidance:Pitch.massPosition = MassDefault
  }

  # Communication update: Don't go too long without calling home.

  aggregate NeedComms {
    """
    Initiate communications with shore. (Don't use Insert/NeedComms.tl
    here since that operates based on Universal:time_fix, which is
    continuously updated in this drift mission.) Note that there is a
    two-minute timeout on platform_communications, after which the
    mission will exit this aggregate. If communications are not
    completed, it will re-enter this aggregate immediately, take one GPS
    fix, and then try to communicate again.
    """

    run when (
      elapsed ( Universal:platform_communications ) > NeedCommsTime
    )

    readDatum {
      Universal:time_fix
    }

    readDatum {
      timeout duration=P2M
      Universal:platform_communications
    }
  }

  insert Insert/Science.tl {
    """
    Record standard science data at the surface during the drift.
    """
  }



  behavior Guidance:Buoyancy {
    run in parallel
    set Guidance:Buoyancy.position = BuoyancyMax
  }

  aggregate ClearCommsBuffer {
    """
    Clean up any existing communications before starting to drift.
    """

    run in sequence

    readDatum {
      Universal:platform_communications
    }
  }

  # (re)initialize the virtual surface drifter

  aggregate ReinitializeHFRCMVirtualSurfaceDrifter {
    run in sequence

    # TODO: Would really prefer an "if" conditional here. Only want to do it once.

    # <When>
    #     <CustomUri Uri="HFRCMVirtualSurfaceDrifter.loadAtStartup"/>
    # </When>

    syslog important "\n\t    HFRCMVSD.loadAtStartup: "
         + customUri "HFRCMVirtualSurfaceDrifter.loadAtStartup" ~ bool

    Estimation:ReinitializeHFRCMVirtualSurfaceDrifter #! xml2tethysl note: A non-behavior Tethys definition used by itself.


    syslog important "Reinitialized virtual drifter location to current vehicle location."
  }

  # Continuously record GPS signals.

  aggregate ContinuousGPS {
    """
    Continuously query for GPS data.
    """

    run in parallel

    readData strategy="MinError" {
      Universal:time_fix
    }
  }

  behavior Guidance:Wait {
    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
<?xml version="1.0" encoding="UTF-8"?>
<!--
-   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 xmlns="Tethys"
       xmlns:Control="Tethys/Control"
       xmlns:Estimation="Tethys/Estimation"
       xmlns:Guidance="Tethys/Guidance" 
       xmlns:Units="Tethys/Units"
       xmlns:Universal="Tethys/Universal"
       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/Estimation http://okeanids.mbari.org/tethys/Xml/Estimation.xsd
                           Tethys/Guidance http://okeanids.mbari.org/tethys/Xml/Guidance.xsd
                           Tethys/Units http://okeanids.mbari.org/tethys/Xml/Units.xsd
                           Tethys/Universal http://okeanids.mbari.org/tethys/Xml/Universal.xsd"
       Id="drift">

    <Description>
        Vehicle drifts at the surface, continuously recording GPS signals. If
        enabled, it also estimates the evolving location of a surface drifter
        using the HFRCM components.
    </Description>

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

    <DefineArg Name="MaxDepth"><Description>
        Maximum depth for the entire mission.
    </Description><Units:meter/><Value>5.0</Value></DefineArg>

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

    <DefineArg Name="NeedCommsTime"><Description>
        Elapsed time after previous surface communications when vehicle will
        begin to attempt additional surface communications.
    </Description><Units:minute/><Value>12</Value></DefineArg>

    <DefineArg Name="Timeout"><Description>
        Maximum length of mission
    </Description><Units:hour/><Value>6</Value></DefineArg>

    <DefineArg Name="BuoyancyMax"><Description>
        Buoyancy bladder position for drifting at the surface. This defaults to
        buoyancyLimitHiCC setting in the Config/Control.cfg file.
    </Description><Control:VerticalControl.buoyancyLimitHiCC/></DefineArg>

    <DefineArg Name="MassDefault"><Description>
        Static setting for mass during the mission. This defaults to massDefault
        setting in the Config/Confrol.cfg file.
    </Description><Control:VerticalControl.massDefault/></DefineArg>

<!--
    massPositionLimitFwd setting in the Config/Confrol.cfg file.
    </Description><Control:VerticalControl.massPositionLimitFwd/></DefineArg>
-->

    <Timeout Duration="Timeout"/>

    <Aggregate Id="AltEnvWrapper">

        <When>
            <Arg Name="MinAltitude"/>
            <Gt><Units:meter/><Value>0</Value></Gt>
        </When>

        <Guidance:AltitudeEnvelope>
            <Description>
                Safety behavior that keeps vehicle off sea floor
            </Description>
            <Parallel/>
            <Setting><Guidance:AltitudeEnvelope.minAltitude/><Arg Name="MinAltitude"/></Setting>
        </Guidance:AltitudeEnvelope>

    </Aggregate>

    <Guidance:DepthEnvelope>
        <Description>
            Safety behavior that keeps vehicle from going too deep
        </Description>
        <Parallel/>
        <Setting><Guidance:DepthEnvelope.maxDepth/><Arg Name="MaxDepth"/></Setting>
    </Guidance:DepthEnvelope>

    <Aggregate Id="OffshoreWrapper">

        <When>
            <Arg Name="MinOffshore"/>
            <Gt><Units:meter/><Value>0</Value></Gt>
        </When>

        <Guidance:OffshoreEnvelope>
            <Description>
                Safety behavior that keeps vehicle away from the shore
            </Description>
            <Parallel/>
            <Setting><Guidance:OffshoreEnvelope.minOffshore/><Arg Name="MinOffshore"/></Setting>
        </Guidance:OffshoreEnvelope>

    </Aggregate>

    <Guidance:Pitch>
        <Parallel/>
        <Setting><Guidance:Pitch.massPosition/><Arg Name="MassDefault"/></Setting>
    </Guidance:Pitch>

<!-- Communication update: Don't go too long without calling home. -->

    <Aggregate Id="NeedComms">

        <Description>
            Initiate communications with shore. (Don't use Insert/NeedComms.tl
            here since that operates based on Universal:time_fix, which is
            continuously updated in this drift mission.) Note that there is a
            two-minute timeout on platform_communications, after which the
            mission will exit this aggregate. If communications are not
            completed, it will re-enter this aggregate immediately, take one GPS
            fix, and then try to communicate again.
        </Description>

        <When>
            <Elapsed><Universal:platform_communications/></Elapsed>
            <Gt><Arg Name="NeedCommsTime"/></Gt>
        </When>

        <ReadDatum>
            <Universal:time_fix/>
        </ReadDatum>

        <ReadDatum>
            <Timeout Duration="P2M"/>
            <Universal:platform_communications/>
        </ReadDatum>

    </Aggregate>

    <Insert Filename="Insert/Science.tl">
        <Description>
            Record standard science data at the surface during the drift.
        </Description>
    </Insert>

    <Guidance:Buoyancy>
        <Parallel/>
        <Setting><Guidance:Buoyancy.position/><Arg Name="BuoyancyMax"/></Setting>
    </Guidance:Buoyancy>

    <Aggregate Id="ClearCommsBuffer">

        <Description>
            Clean up any existing communications before starting to drift.
        </Description>

        <Sequence/>

        <ReadDatum>
            <Universal:platform_communications/>
        </ReadDatum>

    </Aggregate>

<!-- (re)initialize the virtual surface drifter -->

    <Aggregate Id="ReinitializeHFRCMVirtualSurfaceDrifter">

        <Sequence/>

<!-- TODO: Would really prefer an "if" conditional here. Only want to do it once. -->

<!--
        <When>
            <CustomUri Uri="HFRCMVirtualSurfaceDrifter.loadAtStartup"/>
        </When>
-->

        <Syslog Severity="Important">
        HFRCMVSD.loadAtStartup: <CustomUri Uri="HFRCMVirtualSurfaceDrifter.loadAtStartup"/><Units:bool/></Syslog>

        <Estimation:ReinitializeHFRCMVirtualSurfaceDrifter>
            <Sequence/>
            <Setting><Estimation:ReinitializeHFRCMVirtualSurfaceDrifter.initial_latitude_setting/><Universal:latitude/></Setting>
            <Setting><Estimation:ReinitializeHFRCMVirtualSurfaceDrifter.initial_longitude_setting/><Universal:longitude/></Setting>
        </Estimation:ReinitializeHFRCMVirtualSurfaceDrifter>

        <Syslog Severity="Important">Reinitialized virtual drifter location to current vehicle location.</Syslog>

    </Aggregate>

<!-- Continuously record GPS signals. -->

    <Aggregate Id="ContinuousGPS">

        <Description>
            Continuously query for GPS data.
        </Description>

        <Parallel/>

        <ReadData Strategy="MinError">
            <Universal:time_fix/>
        </ReadData>

    </Aggregate>

    <Guidance:Wait>
        <Sequence/>
    </Guidance:Wait>

</Mission>