<?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 = None
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

if start != None:
  loc = Location(float(lats[-1].data), float(lons[-1].data), "degree")
  dist = loc.getDistance(start)
  if dist < 400:
    passed = True
  else:
    print("Start and end points differ by %f meters" % dist)
TEST_CODE_END
-->

    <Timeout Duration="P3H"/>

    <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>

        <Aggregate>

            <Sequence/>

            <Timeout Duration="P30M"/>

            <Guidance:Point>
                <Parallel/>
                <Setting><Guidance:Point.heading/><Units:degree/><Value>270</Value></Setting>
            </Guidance:Point>

        </Aggregate>

        <Aggregate>

            <Sequence/>

            <Timeout Duration="P30M"/>

            <Guidance:Point>
                <Parallel/>
                <Setting><Guidance:Point.heading/><Units:degree/><Value>180</Value></Setting>
            </Guidance:Point>

        </Aggregate>

        <Aggregate>

            <Sequence/>

            <Timeout Duration="P30M"/>

            <Guidance:Point>
                <Parallel/>
                <Setting><Guidance:Point.heading/><Units:degree/><Value>90</Value></Setting>
            </Guidance:Point>

        </Aggregate>

        <Aggregate>

            <Sequence/>

            <Timeout Duration="P30M"/>

            <Guidance:Point>
                <Parallel/>
                <Setting><Guidance:Point.heading/><Units:degree/><Value>0</Value></Setting>
            </Guidance:Point>

        </Aggregate>

    </Aggregate>

</Mission>
