Merge pull request #10352 from daijoubu/patch-1
[inav.git] / docs / development / wp_mission_schema / mw-mission.xsd
blob3d8b3ee8ae7e0a89cfb946a793ef3ceb53830115
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- XSchema for MW / INAV missions
3 This file is part of INAV
4 usage e.g. xmllint -​-noout -​-schema mw-mission.xsd example.mission
5 Updated 2021-11-12 for 'meta' substitution.
6 -->
7 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
8 <xs:element name="mission">
9 <xs:complexType>
10 <xs:sequence>
11 <xs:element ref="version"/>
12 <xs:choice minOccurs="0" maxOccurs="unbounded">
13 <xs:element ref="missionitem"/>
14 <xs:element ref="mwp"/>
15 <xs:element ref="fwapproach"/>
16 </xs:choice>
17 </xs:sequence>
18 </xs:complexType>
19 </xs:element>
20 <xs:element name="version">
21 <xs:complexType>
22 <xs:attribute name="value" use="required"/>
23 </xs:complexType>
24 </xs:element>
25 <xs:element name="fwapproach">
26 <xs:complexType>
27 <xs:attribute name="no" use="required" type="xs:integer"/>
28 <xs:attribute name="index" use="required" type="xs:integer"/>
29 <xs:attribute name="approachalt" use="required" type="xs:integer"/>
30 <xs:attribute name="landalt" use="required" type="xs:integer"/>
31 <xs:attribute name="landheading1" use="required" type="xs:integer"/>
32 <xs:attribute name="landheading2" use="required" type="xs:integer"/>
33 <xs:attribute name="approachdirection" use="required">
34 <xs:simpleType>
35 <xs:restriction base="xs:token">
36 <xs:enumeration value="left"/>
37 <xs:enumeration value="right"/>
38 </xs:restriction>
39 </xs:simpleType>
40 </xs:attribute>
41 <xs:attribute name="sealevelref" use="required" type="xs:boolean"/>
42 </xs:complexType>
43 </xs:element>
44 <xs:element name="missionitem">
45 <xs:complexType>
46 <xs:attribute name="action" use="required">
47 <xs:simpleType>
48 <xs:restriction base="xs:token">
49 <xs:enumeration value="UNASSIGNED"/>
50 <xs:enumeration value="WAYPOINT"/>
51 <xs:enumeration value="POSHOLD_UNLIM"/>
52 <xs:enumeration value="POSHOLD_TIME"/>
53 <xs:enumeration value="RTH"/>
54 <xs:enumeration value="SET_POI"/>
55 <xs:enumeration value="JUMP"/>
56 <xs:enumeration value="SET_HEAD"/>
57 <xs:enumeration value="LAND"/>
58 </xs:restriction>
59 </xs:simpleType>
60 </xs:attribute>
61 <!-- no min,max as may be AMSL -->
62 <xs:attribute name="alt" use="required" type="xs:integer"/>
63 <!--
64 flag is not strictly required unless the WP is "Flyby Home"
65 or the are multiple mission segments 'multi-mission', INAV 4.0
66 -->
67 <xs:attribute name="flag" use="optional" type="xs:integer"/>
68 <!--
69 Locations are decimal degrees, WGS84 (EPSG:4326)
70 -->
71 <xs:attribute name="lat" use="required">
72 <xs:simpleType>
73 <xs:restriction base="xs:decimal">
74 <xs:minInclusive value="-90"/>
75 <xs:maxInclusive value="90"/>
76 </xs:restriction>
77 </xs:simpleType>
78 </xs:attribute>
79 <xs:attribute name="lon" use="required">
80 <xs:simpleType>
81 <xs:restriction base="xs:decimal">
82 <xs:minInclusive value="-180"/>
83 <xs:maxInclusive value="180"/>
84 </xs:restriction>
85 </xs:simpleType>
86 </xs:attribute>
87 <!-- not really needed, but for historic compatibility ... -->
88 <xs:attribute name="no" use="required" type="xs:integer"/>
89 <xs:attribute name="parameter1" use="required" type="xs:integer"/>
90 <xs:attribute name="parameter2" use="required" type="xs:integer"/>
91 <xs:attribute name="parameter3" use="required" type="xs:integer"/>
92 </xs:complexType>
93 </xs:element>
94 <xs:element name="mwp">
95 <xs:complexType>
96 <xs:sequence>
97 <xs:element ref="details" minOccurs="0"/>
98 </xs:sequence>
99 <xs:attribute name="cx" type="xs:decimal"/>
100 <xs:attribute name="cy" type="xs:decimal"/>
101 <xs:attribute name="generator"/>
102 <xs:attribute name="home-x" type="xs:decimal"/>
103 <xs:attribute name="home-y" type="xs:decimal"/>
104 <xs:attribute name="save-date"/>
105 <xs:attribute name="zoom">
106 <xs:simpleType>
107 <xs:restriction base="xs:integer">
108 <xs:minInclusive value="0"/>
109 <xs:maxInclusive value="20"/>
110 </xs:restriction>
111 </xs:simpleType>
112 </xs:attribute>
113 </xs:complexType>
114 </xs:element>
115 <xs:element name="details">
116 <xs:complexType>
117 <xs:sequence>
118 <xs:element ref="distance"/>
119 <xs:sequence minOccurs="0">
120 <xs:element ref="nav-speed"/>
121 <xs:element ref="fly-time"/>
122 <xs:element ref="loiter-time"/>
123 </xs:sequence>
124 </xs:sequence>
125 </xs:complexType>
126 </xs:element>
127 <xs:element name="distance">
128 <xs:complexType>
129 <xs:attribute name="units" use="required" type="xs:NCName"/>
130 <xs:attribute name="value" use="required" type="xs:integer"/>
131 </xs:complexType>
132 </xs:element>
133 <xs:element name="nav-speed">
134 <xs:complexType>
135 <xs:attribute name="units" use="required"/>
136 <xs:attribute name="value" use="required" type="xs:integer"/>
137 </xs:complexType>
138 </xs:element>
139 <xs:element name="fly-time">
140 <xs:complexType>
141 <xs:attribute name="units" use="required" type="xs:NCName"/>
142 <xs:attribute name="value" use="required" type="xs:integer"/>
143 </xs:complexType>
144 </xs:element>
145 <xs:element name="loiter-time">
146 <xs:complexType>
147 <xs:attribute name="units" use="required" type="xs:NCName"/>
148 <xs:attribute name="value" use="required" type="xs:integer"/>
149 </xs:complexType>
150 </xs:element>
151 <xs:element name="meta" substitutionGroup="mwp"/>
152 <xs:element name="MISSION" substitutionGroup="mission"/>
153 <xs:element name="MISSIONITEM" substitutionGroup="missionitem"/>
154 <xs:element name="VERSION" substitutionGroup="version"/>
155 </xs:schema>