<?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
depthTarget = 50
depthDeltaExit = 1 

reachedDepth = False
data = slate.read("depth")[0]
for i in range(len(data)):
  depth = abs(float(data[i].data)) 
  # simpy test to see if the pitch
  # angle makes us reach the right depth
  if reachedDepth == False and depth >= depthTarget:
    reachedDepth = True
    passed = True

  # do we quit somewhere near our depthTarget?
  # if not, then we have a problem
  if reachedDepth == True and (not utils.withinDelta(depth, depthTarget, depthDeltaExit)):
    passed = False
TEST_CODE_END
-->

    <Timeout Duration="P1H"/>

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

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

    <Aggregate Id="TestAggregate">

        <Sequence/>

        <Break>
            <Universal:depth/>
            <Gt><Units:meter/><Value>50</Value></Gt>
        </Break>

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

        <Guidance:Pitch>
            <Parallel/>
            <Setting><Guidance:Pitch.pitch/><Units:degree/><Value>-26</Value></Setting>
        </Guidance:Pitch>

        <Guidance:Waypoint Id="Waypoint">
            <Sequence/>
            <Setting><Guidance:Waypoint.latitude/><Units:degree/><Value>36.815</Value></Setting>
            <Setting><Guidance:Waypoint.longitude/><Units:degree/><Value>-121.95</Value></Setting>
        </Guidance:Waypoint>

    </Aggregate>

</Mission>
