<?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="tank_endurance_test">

    <DefineArg Name="speed"><Units:meter_per_second/><Value>0.65</Value></DefineArg>

    <Timeout Duration="P125H"/>

    <Guidance:AltitudeEnvelope>
        <Parallel/>
        <Setting><Guidance:AltitudeEnvelope.minAltitude/><Units:meter/><Value>0</Value></Setting>
    </Guidance:AltitudeEnvelope>

    <Guidance:DepthEnvelope>
        <Parallel/>
        <Setting><Guidance:DepthEnvelope.maxDepth/><Units:meter/><Value>8</Value></Setting>
    </Guidance:DepthEnvelope>

    <Insert Filename="Insert/Surface.xml" Id="SURFACECOMMS" />

    <Aggregate Id="Loop">

        <Sequence Repeat="999"/>

<!--    Get to 5 meters -->

        <Guidance:Pitch  Id="Dive">
            <Progression/>
            <Setting><Guidance:Pitch.depth/><Units:meter/><Value>5</Value></Setting>
        </Guidance:Pitch>

        <Aggregate Id="Motion">

            <Sequence/>

            <Insert Filename="Insert/Science.xml"/>

            <Guidance:SetSpeed>
                <Parallel/>
                <Setting><Guidance:SetSpeed.speed/><Arg Name="speed"/></Setting>
            </Guidance:SetSpeed>

            <Aggregate Id="hdg000">

                <Sequence/>

                <Timeout Duration="P11M"/>

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

            </Aggregate>

            <Aggregate Id="hdg090">

                <Sequence/>

                <Timeout Duration="P11M"/>

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

            </Aggregate>

            <Aggregate Id="hdg180">

                <Sequence/>

                <Timeout Duration="P11M"/>

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

            </Aggregate>

            <Aggregate Id="hdg270">

                <Sequence/>

                <Timeout Duration="P11M"/>

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

            </Aggregate>

        </Aggregate>

        <Call RefId="SURFACECOMMS"/>

    </Aggregate>

</Mission>
