HFRadarModelTest.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/HFRadarModelTest.xml:127:5
     | 
 123 | 
 124 |   }
 125 |   aggregate Test {
 126 |     run when ( true )
 127 |     Derivation:HFRadarModel
     |     ^^^^^^^^^^
 128 |     sendData service=express  (
 129 |       eastwardSurfaceCurrent,
 130 |       northwardSurfaceCurrent
 131 |     )
     | 
Unexpected: `Derivation`
Possible items include (total 15):
  aggregate
  assign
  behavior
  call
  [...7 more...]
  preemptive
  }
  break
  timeout
  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
mission HFRadarModelTest {
  # The following arguments are input arguments

  arguments {
    WpLat = 0 degree


    WpLon = 0 degree


    WpApproachDepth = 20.0 meter


    WpSpeed = 1 meter_per_second


    NeedCommsTime = 60 minute


    Timeout = 2 hour


    Depth = 40 meter


    DepthDeadband = 2.0 meter


    SciencePeriod = 10.0 minute


    BuoyPeriod = 5.0 second


  }

  output {
    eastwardSurfaceCurrent = NaN centimeter_per_second


    northwardSurfaceCurrent = NaN centimeter_per_second


  }

  # The timeout

  timeout duration=Timeout
  # And now the mission

  behavior Guidance:AltitudeEnvelope  {

    run in parallel


    set Guidance:AltitudeEnvelope.minAltitude = 7 meter

  }


  behavior Guidance:DepthEnvelope  {

    run in parallel


    set Guidance:DepthEnvelope.maxDepth = 70 meter

  }


  behavior Guidance:OffshoreEnvelope  {

    run in parallel


    set Guidance:OffshoreEnvelope.minOffshore = 2.0 kilometer

    set Guidance:OffshoreEnvelope.maxOffshore = 30.0 kilometer

  }


  insert Insert/Surface.xml id="SurfaceComms" {

    redefineArg SurfaceSpeed = 0 meter_per_second

  }


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

  aggregate NeedComms {
    run when ( elapsed ( Universal:time_fix ) > NeedCommsTime )
    call refId="SurfaceComms"
  }

  behavior Guidance:SetSpeed  {

    run while ( Universal:platform_propeller_rotation_rate  == 0 radian_per_second
  )


    set Guidance:SetSpeed.period = BuoyPeriod

  }


  # If we're executing here or below, lets' get science data!

  readData  {

    period ( SciencePeriod )

    Universal:mole_concentration_of_nitrate_in_sea_water

    Universal:sea_water_temperature

    Universal:sea_water_salinity

    Universal:mass_concentration_of_chlorophyll_in_sea_water

    Universal:mass_concentration_of_oxygen_in_sea_water

  }
  aggregate Test {
    run when ( true )
    Derivation:HFRadarModel
    sendData service=express  (
      eastwardSurfaceCurrent,
      northwardSurfaceCurrent
    )

    syslog eastwardSurfaceCurrent~centimeter_per_second + northwardSurfaceCurrent~centimeter_per_second
    behavior Guidance:Wait  {

      run in sequence


      set Guidance:Wait.duration = SciencePeriod

    }


  }

  aggregate Waypoint {
    run in sequence
    break if ( (WpLat == 0 degree) or WpLon == 0 degree )
    behavior Guidance:Pitch  {

      run in parallel


      set Guidance:Pitch.depth = WpApproachDepth

    }


    behavior Guidance:SetSpeed  {

      run in parallel


      set Guidance:SetSpeed.speed = WpSpeed

    }


    behavior Guidance:Waypoint id="WaypointW1"  {

      run in sequence


      set Guidance:Waypoint.latitude = WpLat

      set Guidance:Waypoint.longitude = WpLon

    }


    call refId="SurfaceComms"
  }

  aggregate hold {
    run in sequence
    behavior Guidance:SetSpeed  {

      run in parallel


      set Guidance:SetSpeed.speed = 0 meter_per_second

    }


    assign in parallel Control:VerticalControl.depthDeadband = DepthDeadband
    behavior Guidance:Pitch  {

      run in parallel


      set Guidance:Pitch.depth = Depth

    }


  }

}
  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
<?xml version="1.0" encoding="UTF-8"?>
<Mission xmlns="Tethys"
       xmlns:Control="Tethys/Control"
       xmlns:Derivation="Tethys/Derivation"
       xmlns:Guidance="Tethys/Guidance" 
       xmlns:Trigger="Tethys/Trigger" 
       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/Derivation http://okeanids.mbari.org/tethys/Xml/Derivation.xsd
                           Tethys/Guidance http://okeanids.mbari.org/tethys/Xml/Guidance.xsd
                           Tethys/Trigger http://okeanids.mbari.org/tethys/Xml/Trigger.xsd
                           Tethys/Units http://okeanids.mbari.org/tethys/Xml/Units.xsd
                           Tethys/Universal http://okeanids.mbari.org/tethys/Xml/Universal.xsd"
       Id="HFRadarModelTest">

<!-- The following arguments are input arguments -->

    <DefineArg Name="WpLat"><Units:degree/><Value>0</Value></DefineArg>

    <DefineArg Name="WpLon"><Units:degree/><Value>0</Value></DefineArg>

    <DefineArg Name="WpApproachDepth"><Units:meter/><Value>20.0</Value></DefineArg>

    <DefineArg Name="WpSpeed"><Units:meter_per_second/><Value>1</Value></DefineArg>

    <DefineArg Name="NeedCommsTime"><Units:minute/><Value>60</Value></DefineArg>

    <DefineArg Name="Timeout"><Units:hour/><Value>2</Value></DefineArg>

    <DefineArg Name="Depth"><Units:meter/><Value>40</Value></DefineArg>

    <DefineArg Name="DepthDeadband"><Units:meter/><Value>2.0</Value></DefineArg>

    <DefineArg Name="SciencePeriod"><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="BuoyPeriod"><Units:second/><Value>5.0</Value></DefineArg>

    <DefineOutput Name="eastwardSurfaceCurrent"><Units:centimeter_per_second/><Value>NaN</Value></DefineOutput>

    <DefineOutput Name="northwardSurfaceCurrent"><Units:centimeter_per_second/><Value>NaN</Value></DefineOutput>

<!-- The timeout -->

    <Timeout Duration="Timeout"/>

<!-- And now the mission -->

    <Guidance:AltitudeEnvelope>
        <Parallel/>
        <Setting><Guidance:AltitudeEnvelope.minAltitude/><Units:meter/><Value>7</Value></Setting>
    </Guidance:AltitudeEnvelope>

    <Guidance:DepthEnvelope>
        <Parallel/>
        <Setting><Guidance:DepthEnvelope.maxDepth/><Units:meter/><Value>70</Value></Setting>
    </Guidance:DepthEnvelope>

    <Guidance:OffshoreEnvelope>
        <Parallel/>
        <Setting><Guidance:OffshoreEnvelope.minOffshore/><Units:kilometer/><Value>2.0</Value></Setting>
        <Setting><Guidance:OffshoreEnvelope.maxOffshore/><Units:kilometer/><Value>30.0</Value></Setting>
    </Guidance:OffshoreEnvelope>

    <Insert Filename="Insert/Surface.xml" Id="SurfaceComms">
        <RedefineArg Name="SurfaceSpeed"><Units:meter_per_second/><Value>0</Value></RedefineArg>
    </Insert>

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

    <Aggregate Id="NeedComms">

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

        <Call RefId="SurfaceComms"/>

    </Aggregate>

    <Guidance:SetSpeed>
        <While>
            <Universal:platform_propeller_rotation_rate/>
            <Eq><Units:radian_per_second/><Value>0</Value></Eq>
        </While>
        <Setting><Guidance:SetSpeed.period/><Arg Name="BuoyPeriod"/></Setting>
    </Guidance:SetSpeed>

<!-- If we're executing here or below, lets' get science data! -->

    <ReadData>
        <Period><Arg Name="SciencePeriod"/></Period>
        <Universal:mole_concentration_of_nitrate_in_sea_water/>
        <Universal:sea_water_temperature/>
        <Universal:sea_water_salinity/>
        <Universal:mass_concentration_of_chlorophyll_in_sea_water/>
        <Universal:mass_concentration_of_oxygen_in_sea_water/>
    </ReadData>

    <Aggregate Id="Test">

        <When>
            <True/>
        </When>

        <Derivation:HFRadarModel>
            <Sequence/>
            <OutputArg Name="eastwardSurfaceCurrent"><Derivation:HFRadarModel.eastwardSurfaceCurrent/></OutputArg>
            <OutputArg Name="northwardSurfaceCurrent"><Derivation:HFRadarModel.northwardSurfaceCurrent/></OutputArg>
        </Derivation:HFRadarModel>

        <SendData Service="Express"><Arg Name="eastwardSurfaceCurrent"/><Arg Name="northwardSurfaceCurrent"/>
        </SendData>

        <Syslog><Arg Name="eastwardSurfaceCurrent"/><Units:centimeter_per_second/><Arg Name="northwardSurfaceCurrent"/><Units:centimeter_per_second/></Syslog>

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

    </Aggregate>

    <Aggregate Id="Waypoint">

        <Sequence/>

        <Break><Arg Name="WpLat" />
            <Eq><Units:degree/><Value>0</Value></Eq>
            <Or><Arg Name="WpLon" /><Eq><Units:degree/><Value>0</Value></Eq></Or>
        </Break>

        <Guidance:Pitch>
            <Parallel/>
            <Setting><Guidance:Pitch.depth /><Arg Name="WpApproachDepth" /></Setting>
        </Guidance:Pitch>

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

        <Guidance:Waypoint Id="WaypointW1">
            <Sequence/>
            <Setting><Guidance:Waypoint.latitude /><Arg Name="WpLat" /></Setting>
            <Setting><Guidance:Waypoint.longitude /><Arg Name="WpLon" /></Setting>
        </Guidance:Waypoint>

        <Call RefId="SurfaceComms" />

    </Aggregate>

    <Aggregate Id="hold">

        <Sequence/>

        <Guidance:SetSpeed>
            <Parallel/>
            <Setting><Guidance:SetSpeed.speed/><Units:meter_per_second/><Value>0</Value></Setting>
        </Guidance:SetSpeed>

        <Assign><Parallel/><Control:VerticalControl.depthDeadband/><Arg Name="DepthDeadband"/></Assign>

        <Guidance:Pitch>
            <Parallel/>
            <Setting><Guidance:Pitch.depth/><Arg Name="Depth"/></Setting>
        </Guidance:Pitch>

    </Aggregate>

</Mission>