Note

  • Section in preliminary form—please use the editor itself to see actual scripts
  • Concrete syntax is still subject to change. Suggestions welcome.

Hello World

XML translation
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================
     Generated by TethysL
     ==================== -->
<Mission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="Tethys"
         xsi:schemaLocation="Tethys http://okeanids.mbari.org/tethys/Xml/Tethys.xsd"
       Id="Hello">

    <Description>
        This mission just writes out "Hello world" to the system log.
    </Description>

    <!--
    #### this is a comment
    -->
    <Syslog>Hello world</Syslog>
</Mission>

Note that TethysL only generates the XML namespace designations actually used.

From this simple example we can note the following:

  • Descriptions: Some components in the language can be described. Use triple double quotes (""") or triple single quotes (''') to capture these descriptions. Leading and trailing empty lines in the quoted text are not translated to XML. Common leading spaces are removed for consistent indentation in XML.

  • Comments: Comments are line oriented and delimited by the first # character occurring in the line (not in quoted strings) and the end of the line. Comments are not translated to XML.

"NeedComms" aggregate

As a more complete example, the "NeedComms" aggregate looks like so:

XML translation
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================
     Generated by TethysL
     ==================== -->
<Aggregate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns="Tethys"
           xmlns:Units="Tethys/Units"
           xmlns:Universal="Tethys/Universal"
           xmlns:Guidance="Tethys/Guidance"
           xsi:schemaLocation="Tethys http://okeanids.mbari.org/tethys/Xml/Tethys.xsd
                               Tethys/Units http://okeanids.mbari.org/tethys/Xml/Units.xsd
                               Tethys/Universal http://okeanids.mbari.org/tethys/Xml/Universal.xsd
                               Tethys/Guidance http://okeanids.mbari.org/tethys/Xml/Guidance.xsd"
       Id="NeedComms">

    <DefineArg Name="DiveInterval"><Description>
        Elapsed time after most recent surfacing when vehicle will begin to
        ascend to the surface again. The timing is actually based on the
        variable Universal:time_fix instead of the variable
        Universal:platform_communications because the latter is not toggled
        until the message queue is clear. As a result, there are situations
        where the vehicle might dive for the first half of a yo, then return to
        the surface to continue communications, rendering the communications
        timeout useless. When adjusting this parameter, do not use "set", use
        Assign in a mission, or set NeedComms:DiveInterval from the command line.
    </Description><Units:hour/><Value>3</Value></DefineArg>

    <DefineArg Name="AcousticTimeout"><Description>
        Maximum amount of time to wait after the most recent acoustic signal
        _or_ GPS fix before ascending to the surface again.
    </Description><Units:hour/><Value>96</Value></DefineArg>

    <DefineArg Name="WaitForPitchUp"><Description>
        Extra time to wait for the vehicle to pitch up (avoid truncating a yo).
    </Description><Units:minute/><Value>10</Value></DefineArg>

    <DefineArg Name="SurfacePitch"><Units:degree/><Value>20</Value></DefineArg>

    <DefineArg Name="SurfaceSpeed"><Description>
        Standard speed during surfacing. Don't reduce this too much below 1 m/s
        -- the elevators can stall. (At 0.5 m/s, we have observed evidence of
        stall in the past.)
    </Description><Units:meter_per_second/><Value>1</Value></DefineArg>

    <DefineArg Name="GPSTimeout"><Description>
        Maximum amount of time to spend trying to get each GPS fix.
    </Description><Units:minute/><Value>7</Value></DefineArg>

    <DefineArg Name="CommsTimeout"><Description>
        Maximum amount of time to spend on the surface trying to communicate
        before giving up, getting another GPS fix, and diving again.
    </Description><Units:minute/><Value>30</Value></DefineArg>

    <When>
        <Called/>
        <Or>
            <Elapsed><Universal:time_fix/></Elapsed>
            <Gt>
                <Arg Name="DiveInterval"/>
                <Add>
                    <Arg Name="WaitForPitchUp"/>
                </Add>
            </Gt>
        </Or>

        <Or>
            <Elapsed><Universal:time_fix/></Elapsed>
            <Gt>
                <Arg Name="DiveInterval"/>
            </Gt>

            <And>
                <Universal:platform_pitch_angle/>
                <Gt>
                    <Units:degree/><Value>0</Value>
                </Gt>
            </And>
        </Or>

        <Or>
            <Elapsed><Universal:time_fix/></Elapsed>
            <Gt>
                <Arg Name="AcousticTimeout"/>
            </Gt>

            <And>
                <Elapsed><Universal:acoustic_receive_time/></Elapsed>
                <Gt>
                    <Arg Name="AcousticTimeout"/>
                </Gt>
            </And>
        </Or>
    </When>

    <Syslog Severity="Info">last time_fix was: <Universal:time_fix/><Units:epoch_second/></Syslog>

    <Guidance:GoToSurface>
        <Progression/>
        <Setting><Guidance:GoToSurface.pitch/><Arg Name="SurfacePitch"/></Setting>
        <Setting><Guidance:GoToSurface.speed/><Arg Name="SurfaceSpeed"/></Setting>
    </Guidance:GoToSurface>

    <ReadDatum>
        <Timeout Duration="GPSTimeout">
            <Syslog Severity="Important">first GPS update timeout</Syslog>
        </Timeout>
        <Universal:time_fix/>
    </ReadDatum>

    <ReadDatum>
        <Timeout Duration="CommsTimeout"/>
        <Universal:platform_communications/>
    </ReadDatum>

    <ReadDatum>
        <Timeout Duration="GPSTimeout">
            <Syslog Severity="Important">second GPS update timeout</Syslog>
        </Timeout>
        <Universal:time_fix/>
    </ReadDatum>
</Aggregate>

"sci2" mission

A simplified version of the "sci2" mission: