<?xml version="1.0" encoding="UTF-8"?>
<Mission xmlns="Tethys"
       xmlns:Control="Tethys/Control"
       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/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="TestMission">

<!--
TEST_CODE_START
(lats, lons) = slate.read("latitude", "longitude")
# get starting lat, lon
start = Location()
for i in range(len(lats)):
  if lats[i].data != "nan" and lons[i].data != "nan" and math.fabs(float(lats[i].data)) > 1e-4 and math.fabs(float(lons[i].data)) > 1e-4:
    start = Location(float(lats[i].data), float(lons[i].data), "degree")
    break

waypoints = [ start,
              Location(36.737845, -121.88200, "degree"), \
              Location(36.73900, -121.88200, "degree"), \
              Location(36.73900, -121.88350, "degree") ]

# see if we reach those waypoints
j = 1 
for i in range(len(lats)):
  loc = Location(float(lats[i].data), float(lons[i].data), "degree")
  if loc.hasXPerpLine(waypoints[j - 1], waypoints[j]):
    j = j + 1
    if j >= len(waypoints):
      passed = True
      break 
TEST_CODE_END
-->

    <Timeout Duration="P1H"/>

<!-- some high priority behaviors -->

    <Insert Filename="RegressionTests/InsertHighPriority.xml"/>

    <Insert Filename="RegressionTests/InsertSurfaceOps.xml"/>

    <Aggregate Id="TestAggregate">

        <Sequence/>

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

        <Guidance:Pitch>
            <Parallel/>
            <Setting><Guidance:Pitch.depth/><Units:meter/><Value>20</Value></Setting>
        </Guidance:Pitch>

<!-- head west -->

        <Guidance:Waypoint>
            <Sequence/>
            <Setting><Guidance:Waypoint.latitude/><Units:degree/><Value>36.737845</Value></Setting>
            <Setting><Guidance:Waypoint.longitude/><Units:degree/><Value>-121.88200</Value></Setting>
        </Guidance:Waypoint>

<!-- head north -->

        <Guidance:Waypoint>
            <Sequence/>
            <Setting><Guidance:Waypoint.latitude/><Units:degree/><Value>36.73900</Value></Setting>
            <Setting><Guidance:Waypoint.longitude/><Units:degree/><Value>-121.88200</Value></Setting>
        </Guidance:Waypoint>

<!-- head west -->

        <Guidance:Waypoint>
            <Sequence/>
            <Setting><Guidance:Waypoint.latitude/><Units:degree/><Value>36.73900</Value></Setting>
            <Setting><Guidance:Waypoint.longitude/><Units:degree/><Value>-121.88350</Value></Setting>
        </Guidance:Waypoint>

    </Aggregate>

</Mission>
