<?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 = 20
depthDelta = 1.25
reachedDepth = False
passed = False
data = slate.read("depth")[0]
for i in range(len(data)):

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

    <Timeout Duration="P1H"/>

    <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:Point>
            <Parallel/>
            <Setting><Guidance:Point.heading/><Units:degree/><Value>-135</Value></Setting>
        </Guidance:Point>

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

        <Guidance:Waypoint>
            <Sequence/>
            <Setting><Guidance:Waypoint.latitudeDelta/><Units:degree/><Value>-0.01</Value></Setting>
            <Setting><Guidance:Waypoint.captureRadius/><Units:meter/><Value>1</Value></Setting>
        </Guidance:Waypoint>

    </Aggregate>

</Mission>
