mavschema.xsd 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <?xml version="1.0" encoding="ISO-8859-1" ?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3. <!-- definition of simple elements -->
  4. <xs:element name="include" type="xs:anyURI"/>
  5. <xs:element name="version" type="xs:unsignedByte"/>
  6. <xs:element name="dialect" type="xs:unsignedByte"/>
  7. <xs:element name="description" type="xs:string"/>
  8. <!-- definition of attributes -->
  9. <xs:attribute name="name"> <!-- used in enum,entry,message,field elements -->
  10. </xs:attribute>
  11. <xs:attribute name="id" type="xs:unsignedShort"/> <!-- used in message elements -->
  12. <xs:attribute name="print_format" type="xs:string"/> <!-- used in field elements -->
  13. <xs:attribute name="enum" type="xs:string"/> <!-- used in field,param elements -->
  14. <xs:attribute name="display" type="xs:string"/> <!-- used in field elements -->
  15. <xs:attribute name="units" type="SI_Unit"/> <!-- this will get changed on the fly to xs:string if no strict-units command line option is used -->
  16. <xs:attribute name="value"> <!-- used in entry elements -->
  17. <xs:simpleType>
  18. <xs:restriction base="xs:string">
  19. <xs:pattern value="\d{1,10}"/> <!-- base 10 int -->
  20. <xs:pattern value="0[xX][0-9a-fA-F]{1,8}"/> <!-- base 16 -->
  21. <xs:pattern value="0[bB][0-1]{1,32}"/> <!-- base 1 -->
  22. </xs:restriction>
  23. </xs:simpleType>
  24. </xs:attribute>
  25. <xs:attribute name="default"> <!-- used in field elements -->
  26. <xs:simpleType>
  27. <xs:restriction base="xs:string">
  28. <xs:pattern value="\d{1,10}"/> <!-- base 10 int -->
  29. <xs:pattern value="0[xX][0-9a-fA-F]{1,8}"/> <!-- base 16 -->
  30. <xs:pattern value="0[bB][0-1]{1,32}"/> <!-- base 1 -->
  31. <xs:pattern value="NaN"/> <!-- Allow not-a-number as a default (for params) -->
  32. </xs:restriction>
  33. </xs:simpleType>
  34. </xs:attribute>
  35. <xs:attribute name="type"> <!-- used in field elements -->
  36. <xs:simpleType>
  37. <xs:restriction base="xs:string">
  38. <xs:pattern value="float(\[([0-9])+\])?"/>
  39. <xs:pattern value="double(\[([0-9])+\])?"/>
  40. <xs:pattern value="char(\[([0-9])+\])?"/>
  41. <xs:pattern value="int8_t(\[([0-9])+\])?"/>
  42. <xs:pattern value="uint8_t(\[([0-9])+\])?"/>
  43. <xs:pattern value="uint8_t_mavlink_version"/>
  44. <xs:pattern value="int16_t(\[([0-9])+\])?"/>
  45. <xs:pattern value="uint16_t(\[([0-9])+\])?"/>
  46. <xs:pattern value="int32_t(\[([0-9])+\])?"/>
  47. <xs:pattern value="uint32_t(\[([0-9])+\])?"/>
  48. <xs:pattern value="int64_t(\[([0-9])+\])?"/>
  49. <xs:pattern value="uint64_t(\[([0-9])+\])?"/>
  50. <xs:pattern value="array\[[0-9]+\]"/> <!-- 0.9 compatibility -->
  51. </xs:restriction>
  52. </xs:simpleType>
  53. </xs:attribute>
  54. <xs:attribute name="since"> <!-- used in deprecated elements -->
  55. <xs:simpleType>
  56. <xs:restriction base="xs:string">
  57. <xs:pattern value="(20)\d{2}-(0[1-9]|1[012])"/> <!-- restrict dates to 20YY-MM format -->
  58. </xs:restriction>
  59. </xs:simpleType>
  60. </xs:attribute>
  61. <xs:attribute name="replaced_by" type="xs:string"/> <!-- used in deprecated elements -->
  62. <xs:simpleType name="SI_Unit">
  63. <xs:restriction base="xs:string">
  64. <!-- time -->
  65. <xs:enumeration value="s"/> <!-- seconds -->
  66. <xs:enumeration value="ds"/> <!-- deciseconds -->
  67. <xs:enumeration value="cs"/> <!-- centiseconds -->
  68. <xs:enumeration value="ms"/> <!-- milliseconds -->
  69. <xs:enumeration value="us"/> <!-- microseconds -->
  70. <xs:enumeration value="Hz"/> <!-- Herz -->
  71. <xs:enumeration value="MHz"/> <!-- Mega-Herz -->
  72. <!-- distance -->
  73. <xs:enumeration value="km"/> <!-- kilometres -->
  74. <xs:enumeration value="dam"/> <!-- decametres -->
  75. <xs:enumeration value="m"/> <!-- metres -->
  76. <xs:enumeration value="m/s"/> <!-- metres per second -->
  77. <xs:enumeration value="m/s/s"/> <!-- metres per second per second -->
  78. <xs:enumeration value="m/s*5"/> <!-- metres per second * 5 required from dagar for HIGH_LATENCY2 message -->
  79. <xs:enumeration value="dm"/> <!-- decimetres -->
  80. <xs:enumeration value="dm/s"/> <!-- decimetres per second -->
  81. <xs:enumeration value="cm"/> <!-- centimetres -->
  82. <xs:enumeration value="cm^2"/> <!-- centimetres squared (typically used in variance) -->
  83. <xs:enumeration value="cm/s"/> <!-- centimetres per second -->
  84. <xs:enumeration value="mm"/> <!-- millimetres -->
  85. <xs:enumeration value="mm/s"/> <!-- millimetres per second -->
  86. <xs:enumeration value="mm/h"/> <!-- millimetres per hour -->
  87. <!-- temperature -->
  88. <xs:enumeration value="K"/> <!-- Kelvin -->
  89. <xs:enumeration value="degC"/> <!-- degrees Celsius -->
  90. <xs:enumeration value="cdegC"/> <!-- centi degrees Celsius -->
  91. <!-- angle -->
  92. <xs:enumeration value="rad"/> <!-- radians -->
  93. <xs:enumeration value="rad/s"/> <!-- radians per second -->
  94. <xs:enumeration value="mrad/s"/> <!-- milli-radians per second -->
  95. <xs:enumeration value="deg"/> <!-- degrees -->
  96. <xs:enumeration value="deg/2"/> <!-- degrees/2 required from dagar for HIGH_LATENCY2 message-->
  97. <xs:enumeration value="deg/s"/> <!-- degrees per second -->
  98. <xs:enumeration value="cdeg"/> <!-- centidegrees -->
  99. <xs:enumeration value="degE5"/> <!-- degrees * 10E5 -->
  100. <xs:enumeration value="degE7"/> <!-- degrees * 10E7 -->
  101. <xs:enumeration value="rpm"/> <!-- rotations per second -->
  102. <!-- electricity -->
  103. <xs:enumeration value="V"/> <!-- Volt -->
  104. <xs:enumeration value="cV"/> <!-- centi-Volt -->
  105. <xs:enumeration value="mV"/> <!-- milli-Volt -->
  106. <xs:enumeration value="A"/> <!-- Ampere -->
  107. <xs:enumeration value="cA"/> <!-- centi-Ampere -->
  108. <xs:enumeration value="mA"/> <!-- milli-Ampere -->
  109. <xs:enumeration value="mAh"/> <!-- milli-Ampere hour -->
  110. <!-- magnetism -->
  111. <xs:enumeration value="mT"/> <!-- milli-Tesla -->
  112. <xs:enumeration value="gauss"/> <!-- Gauss -->
  113. <xs:enumeration value="mgauss"/> <!-- milli-Gauss -->
  114. <!-- energy -->
  115. <xs:enumeration value="hJ"/> <!-- hecto-Joule -->
  116. <!-- force -->
  117. <xs:enumeration value="mG"/> <!-- milli-G -->
  118. <!-- mass -->
  119. <xs:enumeration value="g"/> <!-- grams -->
  120. <!-- pressure -->
  121. <xs:enumeration value="Pa"/> <!-- Pascal -->
  122. <xs:enumeration value="hPa"/> <!-- hecto-Pascal -->
  123. <xs:enumeration value="mbar"/> <!-- millibar -->
  124. <!-- ratio -->
  125. <xs:enumeration value="%"/> <!-- percent -->
  126. <xs:enumeration value="d%"/> <!-- decipercent -->
  127. <xs:enumeration value="c%"/> <!-- centipercent -->
  128. <xs:enumeration value="dB"/> <!-- Deci-Bell -->
  129. <xs:enumeration value="dBm"/> <!-- Deci-Bell-milliwatts-->
  130. <!-- digital -->
  131. <xs:enumeration value="KiB"/> <!-- Kibibyte (1024 bytes) -->
  132. <xs:enumeration value="KiB/s"/> <!-- Kibibyte (1024 bytes) per second -->
  133. <xs:enumeration value="MiB"/> <!-- Mebibyte (1024*1024 bytes) -->
  134. <xs:enumeration value="MiB/s"/> <!-- Mebibyte (1024*1024 bytes) per second -->
  135. <xs:enumeration value="bytes"/> <!-- bytes -->
  136. <xs:enumeration value="bytes/s"/> <!-- bytes per second-->
  137. <xs:enumeration value="bits/s"/> <!-- bits per second -->
  138. <xs:enumeration value="pix"/> <!-- pixels -->
  139. <xs:enumeration value="dpix"/> <!-- decipixels -->
  140. </xs:restriction>
  141. </xs:simpleType>
  142. <!-- definition param elements attributes (like the ones used on MAV_CMD for example) -->
  143. <xs:attribute name="index" type="xs:unsignedByte"/> <!-- parameter index -->
  144. <xs:attribute name="label" type="xs:string"/> <!-- parameter label (name) -->
  145. <xs:attribute name="decimalPlaces" type="xs:unsignedByte"/> <!-- parameter number of decimal places to be displayed in the GUI -->
  146. <xs:attribute name="increment" type="xs:float"/> <!-- parameter increment -->
  147. <xs:attribute name="minValue" type="xs:float"/> <!-- parameter minimum value -->
  148. <xs:attribute name="maxValue" type="xs:float"/> <!-- parameter maximum value -->
  149. <xs:attribute name="reserved" type="xs:boolean" default="false"/> <!-- parameter is reserved -->
  150. <!-- definition entry elements attributes (like the ones used on MAV_CMD for example) -->
  151. <xs:attribute name="hasLocation" type="xs:boolean" default="true"/> <!-- entry has lat/lon/alt location -->
  152. <xs:attribute name="isDestination" type="xs:boolean" default="true"/> <!-- entry is a destination -->
  153. <!-- definition of complex elements -->
  154. <xs:element name="param">
  155. <xs:complexType mixed="true">
  156. <xs:attribute ref="index" use="required"/>
  157. <xs:attribute ref="label"/>
  158. <xs:attribute ref="units"/>
  159. <xs:attribute ref="enum" />
  160. <xs:attribute ref="decimalPlaces"/>
  161. <xs:attribute ref="increment"/>
  162. <xs:attribute ref="minValue"/>
  163. <xs:attribute ref="maxValue"/>
  164. <xs:attribute ref="reserved"/>
  165. <xs:attribute ref="default"/>
  166. </xs:complexType>
  167. </xs:element>
  168. <xs:element name="deprecated">
  169. <xs:complexType mixed="true">
  170. <xs:sequence>
  171. <xs:element ref="description" minOccurs="0"/>
  172. </xs:sequence>
  173. <xs:attribute ref="since" use="required"/>
  174. <xs:attribute ref="replaced_by" use="required"/>
  175. </xs:complexType>
  176. </xs:element>
  177. <xs:element name="wip">
  178. <xs:complexType mixed="true">
  179. <xs:sequence>
  180. <xs:element ref="description" minOccurs="0"/>
  181. </xs:sequence>
  182. </xs:complexType>
  183. </xs:element>
  184. <xs:element name="field">
  185. <xs:complexType mixed="true">
  186. <xs:sequence>
  187. <xs:element ref="description" minOccurs="0"/>
  188. </xs:sequence>
  189. <xs:attribute ref="type" use="required"/>
  190. <xs:attribute ref="name" use="required"/>
  191. <xs:attribute ref="print_format" />
  192. <xs:attribute ref="enum" />
  193. <xs:attribute ref="display" />
  194. <xs:attribute ref="units" />
  195. <xs:attribute ref="default" />
  196. </xs:complexType>
  197. </xs:element>
  198. <xs:element name="extensions">
  199. </xs:element>
  200. <xs:element name="entry">
  201. <xs:complexType>
  202. <xs:sequence>
  203. <xs:choice minOccurs="0" maxOccurs="1">
  204. <xs:element ref="deprecated"/>
  205. <xs:element ref="wip"/>
  206. </xs:choice>
  207. <xs:element ref="description" minOccurs="0"/>
  208. <xs:element ref="param" minOccurs="0" maxOccurs="unbounded" />
  209. </xs:sequence>
  210. <xs:attribute ref="value" />
  211. <xs:attribute ref="name" use="required"/>
  212. <xs:attribute ref="hasLocation"/>
  213. <xs:attribute ref="isDestination"/>
  214. </xs:complexType>
  215. </xs:element>
  216. <xs:element name="enum">
  217. <xs:complexType>
  218. <xs:sequence>
  219. <xs:element ref="deprecated" minOccurs="0" maxOccurs="1"/>
  220. <xs:element ref="description" minOccurs="0"/>
  221. <xs:element ref="entry" maxOccurs="unbounded"/>
  222. </xs:sequence>
  223. <xs:attribute ref="name" use="required"/>
  224. </xs:complexType>
  225. </xs:element>
  226. <xs:element name="message">
  227. <xs:complexType>
  228. <xs:sequence>
  229. <xs:sequence minOccurs="1" maxOccurs="1">
  230. <xs:choice minOccurs="0" maxOccurs="1">
  231. <xs:element ref="deprecated"/>
  232. <xs:element ref="wip"/>
  233. </xs:choice>
  234. <xs:element ref="description" minOccurs="1" maxOccurs="1"/>
  235. <xs:element ref="field" minOccurs="0" maxOccurs="unbounded"/>
  236. </xs:sequence>
  237. <!-- MavLink 2.0 extensions are optional hence minOccurs="0" -->
  238. <xs:sequence minOccurs="0" maxOccurs="1">
  239. <xs:element ref="extensions" minOccurs="1" maxOccurs="1"/>
  240. <xs:element ref="field" minOccurs="1" maxOccurs="unbounded"/>
  241. </xs:sequence>
  242. </xs:sequence>
  243. <xs:attribute ref="id" use="required"/>
  244. <xs:attribute ref="name" use="required"/>
  245. </xs:complexType>
  246. </xs:element>
  247. <xs:element name="enums">
  248. <xs:complexType>
  249. <xs:sequence>
  250. <xs:element ref="enum" maxOccurs="unbounded" minOccurs="0"/>
  251. </xs:sequence>
  252. </xs:complexType>
  253. </xs:element>
  254. <xs:element name="messages">
  255. <xs:complexType>
  256. <xs:sequence>
  257. <xs:element ref="message" maxOccurs="unbounded" minOccurs="0"/>
  258. </xs:sequence>
  259. </xs:complexType>
  260. </xs:element>
  261. <xs:element name="mavlink">
  262. <xs:complexType>
  263. <xs:sequence>
  264. <xs:element ref="include" minOccurs="0" maxOccurs="unbounded"/>
  265. <xs:element ref="version" minOccurs="0"/>
  266. <xs:element ref="dialect" minOccurs="0"/>
  267. <xs:element ref="enums" minOccurs="0"/>
  268. <xs:element ref="messages"/>
  269. </xs:sequence>
  270. <xs:attribute name="file" type="xs:anyURI"/>
  271. </xs:complexType>
  272. </xs:element>
  273. </xs:schema>