<?xml version="1.0" encoding="UTF-8"?>
<Stack 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://aosn.mbari.org/tethys/Xml/Tethys.xsd
                           Tethys/Control http://aosn.mbari.org/tethys/Xml/Control.xsd
                           Tethys/Guidance http://aosn.mbari.org/tethys/Xml/Guidance.xsd
                           Tethys/Units http://aosn.mbari.org/tethys/Xml/Units.xsd
                           Tethys/Universal http://aosn.mbari.org/tethys/Xml/Universal.xsd"
       Id="TestMission">

<!--
TEST_CODE_START
depthTarget = 20
depthDelta = 0.75
reachedDepth = False
passed = False
data = slate.read("depth")[0]
for i in range(len(data)):
  if( i < len(data)/5 or i > len(data)*4/5 ):
    continue

  depth = abs(float(data[i].data)) 
  
  if( reachedDepth == False or passed == True ):
    passed = utils.withinDelta(depth, depthTarget, depthDelta)
    reachedDepth = True
  
  if not passed:
    print( 'depth = %f out of range.' % depth )
    break
TEST_CODE_END
-->

    <Timeout Duration="P1H"/>

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

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

    <Stack Id="TestStack">

        <Guidance:SetSpeed RunIn="Parallel">
            <Set><Guidance:SetSpeed.speed/><Units:meter_per_second/><Value>1</Value></Set>
        </Guidance:SetSpeed>

        <Guidance:Point RunIn="Parallel">
            <Set><Guidance:Point.heading/><Units:degree/><Value>-135</Value></Set>
        </Guidance:Point>

        <Guidance:Pitch RunIn="Parallel">
            <Set><Guidance:Pitch.depth/><Units:meter/><Value>20</Value></Set>
        </Guidance:Pitch>

        <Guidance:Waypoint RunIn="Sequence">
            <Set><Guidance:Waypoint.latitudeDelta/><Units:degree/><Value>-0.01</Value></Set>
        </Guidance:Waypoint>

    </Stack>

</Stack>
