Circle virtual drifter.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/Deprecated/Engineering/circle_virtual_drifter.xml:197:3
     | 
 193 |   }
 194 | 
 195 |   # (re)initialize the virtual surface drifter
 196 | 
 197 |   Estimation:ReinitializeHFRCMVirtualSurfaceDrifter #! xml2tethysl note: A non-behavior Tethys definition used by itself.
     |   ^^^^^^^^^^
 198 | 
 199 | 
 200 |   syslog important "Reinitialized virtual drifter location."
 201 | 
     | 
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
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
mission circle_virtual_drifter {
  """
  Vehicle yo-yo's to the specified waypoint, with science turned on.
  """

  arguments {
    InitialLatitude = 36.78 degree
      """
      Latitude to initialize virtual drifter at.
      """

    InitialLongitude = -121.85 degree
      """
      Longitude to initialize virtual drifter at.
      """

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

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

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

    YoYoMinDepth = 3.0 meter
      """
      Minimum depth while performing the YoYo behavior.
      """

    YoYoMaxDepth = 50.0 meter
      """
      Maximum depth while performing the YoYo behavior.
      """

    YoYoUpPitch = 20.0 degree
      """
      Vehicle up pitch while performing the YoYo behavior.
      """

    YoYoDownPitch = -20.0 degree
      """
      Vehicle down pitch while performing the YoYo behavior.
      """

    CircleMaxError = 50 meter

    CircleRadius = 250 meter

    CircleTurnToPort = true

    KwpHeading = 0.010 radian_per_meter
      """
      Used to relax waypoint cross-track error constant that is adjusted for
      docking. (You can override this setting by passing an argument.)
      """

    NeedCommsTime = 60 minute
      """
      Elapsed time after previous surface communications when vehicle will
      begin to ascend for additional surface communications, if the vehicle
      has a positive pitch. If the vehicle has a negative pitch, it will wait
      up to 10 minutes more to begin ascent.
      """

    Speed = 1 meter_per_second
      """
      Speed while performing the YoYo behavior.
      """

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

    BuoyancyNeutral = Control:VerticalControl.buoyancyNeutral
      """
      Buoyancy bladder position while performing the YoYo behavior. Defaults
      to buoyancyNeutral setting in the Config/Control.cfg file. Set to NaN cc
      for active buoyancy
      """

    MassDefault = Control:VerticalControl.massDefault
      """
      Static setting for mass during the mission. Set to NaN mm for active
      mass position
      """
  }

  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
  }

  # GPS Update.  Don't go too long w/o a GPS fix.

  insert Insert/NeedComms.tl id="NeedComms"


  # NOTE: The <Assign> clauses below will not take effect until you actually run the mission. RedefineArg will not work in this case if you use a "set" after loading the mission.

  assign in sequence NeedComms:DiveInterval = NeedCommsTime

  assign in sequence NeedComms:SurfaceSpeed = Speed

  syslog debug "NeedComms:DiveInterval is "
       + NeedComms:DiveInterval ~ minute
       + ", should be "
       + NeedCommsTime ~ minute
       + "."

  syslog debug "NeedComms:SurfaceSpeed is "
       + NeedComms:SurfaceSpeed ~ meter_per_second
       + ", should be "
       + Speed ~ meter_per_second
       + "."

  insert Insert/Science.tl {
    """
    If we're executing here or below, lets' get science data!
    """
    redefineArg PeakDetectChlActive = true
  }



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

  behavior Guidance:SetSpeed {
    run in parallel
    set Guidance:SetSpeed.speed = Speed
  }

  behavior Guidance:DepthEnvelope {
    run in parallel
    set Guidance:DepthEnvelope.minDepth = YoYoMinDepth
    set Guidance:DepthEnvelope.maxDepth = YoYoMaxDepth
    set Guidance:DepthEnvelope.upPitch = YoYoUpPitch
    set Guidance:DepthEnvelope.downPitch = YoYoDownPitch
  }

  behavior Guidance:YoYo {
    run in parallel
    set Guidance:YoYo.upPitch = YoYoUpPitch
    set Guidance:YoYo.downPitch = YoYoDownPitch
  }

  # (re)initialize the virtual surface drifter

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


  syslog important "Reinitialized virtual drifter location."

  # go circle the virtual drifter

  aggregate CircleDrifter {
    """
    Circle virtual drifter.
    """

    run in parallel

    assign in parallel Control:HorizontalControl.kwpHeading = KwpHeading

    behavior Guidance:Circle {
      run in sequence
      set Guidance:Circle.latitude = customUri "HFRCMVirtualSurfaceDrifter.latitude"
      set Guidance:Circle.longitude = customUri "HFRCMVirtualSurfaceDrifter.longitude"
      set Guidance:Circle.radius = CircleRadius
      set Guidance:Circle.maxError = CircleMaxError
      set Guidance:Circle.turnToPort = CircleTurnToPort
    }
  }

  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
223
224
225
<?xml version="1.0" encoding="UTF-8"?>
<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="circle_virtual_drifter">

    <Description>
        Vehicle yo-yo's to the specified waypoint, with science turned on.
    </Description>

    <DefineArg Name="InitialLatitude"><Description>
        Latitude to initialize virtual drifter at.
    </Description><Units:degree/><Value>36.78</Value></DefineArg>

    <DefineArg Name="InitialLongitude"><Description>
        Longitude to initialize virtual drifter at.
    </Description><Units:degree/><Value>-121.85</Value></DefineArg>

    <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>55.0</Value></DefineArg>

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

    <DefineArg Name="YoYoMinDepth"><Description>
        Minimum depth while performing the YoYo behavior.
    </Description><Units:meter/><Value>3.0</Value></DefineArg>

    <DefineArg Name="YoYoMaxDepth"><Description>
        Maximum depth while performing the YoYo behavior.
    </Description><Units:meter/><Value>50.0</Value></DefineArg>

    <DefineArg Name="YoYoUpPitch"><Description>
        Vehicle up pitch while performing the YoYo behavior.
    </Description><Units:degree/><Value>20.0</Value></DefineArg>

    <DefineArg Name="YoYoDownPitch"><Description>
        Vehicle down pitch while performing the YoYo behavior.
    </Description><Units:degree/><Value>-20.0</Value></DefineArg>

    <DefineArg Name="CircleMaxError"><Units:meter/><Value>50</Value></DefineArg>

    <DefineArg Name="CircleRadius"><Units:meter/><Value>250</Value></DefineArg>

    <DefineArg Name="CircleTurnToPort"><True/></DefineArg>

    <DefineArg Name="KwpHeading"><Description>
        Used to relax waypoint cross-track error constant that is adjusted for
        docking. (You can override this setting by passing an argument.)
    </Description><Units:radian_per_meter/><Value>0.010</Value></DefineArg>

    <DefineArg Name="NeedCommsTime"><Description>
        Elapsed time after previous surface communications when vehicle will
        begin to ascend for additional surface communications, if the vehicle
        has a positive pitch. If the vehicle has a negative pitch, it will wait
        up to 10 minutes more to begin ascent.
    </Description><Units:minute/><Value>60</Value></DefineArg>

    <DefineArg Name="Speed"><Description>
        Speed while performing the YoYo behavior.
    </Description><Units:meter_per_second/><Value>1</Value></DefineArg>

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

    <DefineArg Name="BuoyancyNeutral"><Description>
        Buoyancy bladder position while performing the YoYo behavior. Defaults
        to buoyancyNeutral setting in the Config/Control.cfg file. Set to NaN cc
        for active buoyancy
    </Description><Control:VerticalControl.buoyancyNeutral/></DefineArg>

    <DefineArg Name="MassDefault"><Description>
        Static setting for mass during the mission. Set to NaN mm for active
        mass position
    </Description><Control:VerticalControl.massDefault/></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>

<!-- GPS Update.  Don't go too long w/o a GPS fix. -->

    <Insert Filename="Insert/NeedComms.tl" Id="NeedComms"/>

<!-- NOTE: The <Assign> clauses below will not take effect until you actually run the mission. RedefineArg will not work in this case if you use a "set" after loading the mission. -->

    <Assign><Sequence/><Arg Name="NeedComms:DiveInterval"/><Arg Name="NeedCommsTime"/></Assign>

    <Assign><Sequence/><Arg Name="NeedComms:SurfaceSpeed"/><Arg Name="Speed"/></Assign>

    <Syslog Severity="Debug">NeedComms:DiveInterval is <Arg Name="NeedComms:DiveInterval"/><Units:minute/>, should be <Arg Name="NeedCommsTime"/><Units:minute/>.</Syslog>

    <Syslog Severity="Debug">NeedComms:SurfaceSpeed is <Arg Name="NeedComms:SurfaceSpeed"/><Units:meter_per_second/>, should be <Arg Name="Speed"/><Units:meter_per_second/>.</Syslog>

    <Insert Filename="Insert/Science.tl">
        <Description>
            If we're executing here or below, lets' get science data!
        </Description>
        <RedefineArg Name="PeakDetectChlActive"><True/></RedefineArg>
    </Insert>

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

    <Guidance:SetSpeed>
        <Parallel/>
        <Setting><Guidance:SetSpeed.speed/><Arg Name="Speed"/></Setting>
    </Guidance:SetSpeed>

    <Guidance:DepthEnvelope>
        <Parallel/>
        <Setting><Guidance:DepthEnvelope.minDepth/><Arg Name="YoYoMinDepth"/></Setting>
        <Setting><Guidance:DepthEnvelope.maxDepth/><Arg Name="YoYoMaxDepth"/></Setting>
        <Setting><Guidance:DepthEnvelope.upPitch/><Arg Name="YoYoUpPitch"/></Setting>
        <Setting><Guidance:DepthEnvelope.downPitch/><Arg Name="YoYoDownPitch"/></Setting>
    </Guidance:DepthEnvelope>

    <Guidance:YoYo>
        <Parallel/>
        <Setting><Guidance:YoYo.upPitch/><Arg Name="YoYoUpPitch"/></Setting>
        <Setting><Guidance:YoYo.downPitch/><Arg Name="YoYoDownPitch"/></Setting>
    </Guidance:YoYo>

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

    <Estimation:ReinitializeHFRCMVirtualSurfaceDrifter>
        <Sequence/>
        <Setting><Estimation:ReinitializeHFRCMVirtualSurfaceDrifter.initial_latitude_setting/><Arg Name="InitialLatitude"/></Setting>
        <Setting><Estimation:ReinitializeHFRCMVirtualSurfaceDrifter.initial_longitude_setting/><Arg Name="InitialLongitude"/></Setting>
    </Estimation:ReinitializeHFRCMVirtualSurfaceDrifter>

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

<!-- go circle the virtual drifter -->

    <Aggregate Id="CircleDrifter">

        <Description>
            Circle virtual drifter.
        </Description>

        <Parallel/>

        <Assign><Parallel/><Control:HorizontalControl.kwpHeading/><Arg Name="KwpHeading"/></Assign>

        <Guidance:Circle>
            <Sequence/>
            <Setting><Guidance:Circle.latitude/><CustomUri Uri="HFRCMVirtualSurfaceDrifter.latitude"/></Setting>
            <Setting><Guidance:Circle.longitude/><CustomUri Uri="HFRCMVirtualSurfaceDrifter.longitude"/></Setting>
            <Setting><Guidance:Circle.radius/><Arg Name="CircleRadius"/></Setting>
            <Setting><Guidance:Circle.maxError/><Arg Name="CircleMaxError"/></Setting>
            <Setting><Guidance:Circle.turnToPort/><Arg Name="CircleTurnToPort"/></Setting>
        </Guidance:Circle>

    </Aggregate>

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

</Mission>