mavlink.py 266 KB
Newer Older
Lorenz Meier's avatar
Lorenz Meier committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930
'''
MAVLink protocol implementation (auto-generated by mavgen.py)

Generated from: ardupilotmega.xml,common.xml

Note: this file has been auto-generated. DO NOT EDIT
'''

import struct, array, mavutil, time

WIRE_PROTOCOL_VERSION = "0.9"

class MAVLink_header(object):
    '''MAVLink message header'''
    def __init__(self, msgId, mlen=0, seq=0, srcSystem=0, srcComponent=0):
        self.mlen = mlen
        self.seq = seq
        self.srcSystem = srcSystem
        self.srcComponent = srcComponent
        self.msgId = msgId

    def pack(self):
        return struct.pack('BBBBBB', 85, self.mlen, self.seq,
                          self.srcSystem, self.srcComponent, self.msgId)

class MAVLink_message(object):
    '''base MAVLink message class'''
    def __init__(self, msgId, name):
        self._header     = MAVLink_header(msgId)
        self._payload    = None
        self._msgbuf     = None
        self._crc        = None
        self._fieldnames = []
        self._type       = name

    def get_msgbuf(self):
        return self._msgbuf

    def get_header(self):
        return self._header

    def get_payload(self):
        return self._payload

    def get_crc(self):
        return self._crc

    def get_fieldnames(self):
        return self._fieldnames

    def get_type(self):
        return self._type

    def get_msgId(self):
        return self._header.msgId

    def get_srcSystem(self):
        return self._header.srcSystem

    def get_srcComponent(self):
        return self._header.srcComponent

    def get_seq(self):
        return self._header.seq

    def __str__(self):
        ret = '%s {' % self._type
        for a in self._fieldnames:
            v = getattr(self, a)
            ret += '%s : %s, ' % (a, v)
        ret = ret[0:-2] + '}'
        return ret            

    def pack(self, mav, crc_extra, payload):
        self._payload = payload
        self._header  = MAVLink_header(self._header.msgId, len(payload), mav.seq,
                                       mav.srcSystem, mav.srcComponent)
        self._msgbuf = self._header.pack() + payload
        crc = mavutil.x25crc(self._msgbuf[1:])
        if False: # using CRC extra
            crc.accumulate(chr(crc_extra))
        self._crc = crc.crc
        self._msgbuf += struct.pack('<H', self._crc)
        return self._msgbuf


# enums

# MAV_MOUNT_MODE
MAV_MOUNT_MODE_RETRACT = 0 # Load and keep safe position (Roll,Pitch,Yaw) from EEPROM and stop
                        # stabilization
MAV_MOUNT_MODE_NEUTRAL = 1 # Load and keep neutral position (Roll,Pitch,Yaw) from EEPROM.
MAV_MOUNT_MODE_MAVLINK_TARGETING = 2 # Load neutral position and start MAVLink Roll,Pitch,Yaw control with
                        # stabilization
MAV_MOUNT_MODE_RC_TARGETING = 3 # Load neutral position and start RC Roll,Pitch,Yaw control with
                        # stabilization
MAV_MOUNT_MODE_GPS_POINT = 4 # Load neutral position and start to point to Lat,Lon,Alt
MAV_MOUNT_MODE_ENUM_END = 5 # 

# MAV_CMD
MAV_CMD_NAV_WAYPOINT = 16 # Navigate to waypoint.
MAV_CMD_NAV_LOITER_UNLIM = 17 # Loiter around this waypoint an unlimited amount of time
MAV_CMD_NAV_LOITER_TURNS = 18 # Loiter around this waypoint for X turns
MAV_CMD_NAV_LOITER_TIME = 19 # Loiter around this waypoint for X seconds
MAV_CMD_NAV_RETURN_TO_LAUNCH = 20 # Return to launch location
MAV_CMD_NAV_LAND = 21 # Land at location
MAV_CMD_NAV_TAKEOFF = 22 # Takeoff from ground / hand
MAV_CMD_NAV_ROI = 80 # Sets the region of interest (ROI) for a sensor set or the
                        # vehicle itself. This can then be used by the
                        # vehicles control             system to
                        # control the vehicle attitude and the
                        # attitude of various             sensors such
                        # as cameras.
MAV_CMD_NAV_PATHPLANNING = 81 # Control autonomous path planning on the MAV.
MAV_CMD_NAV_LAST = 95 # NOP - This command is only used to mark the upper limit of the
                        # NAV/ACTION commands in the enumeration
MAV_CMD_CONDITION_DELAY = 112 # Delay mission state machine.
MAV_CMD_CONDITION_CHANGE_ALT = 113 # Ascend/descend at rate.  Delay mission state machine until desired
                        # altitude reached.
MAV_CMD_CONDITION_DISTANCE = 114 # Delay mission state machine until within desired distance of next NAV
                        # point.
MAV_CMD_CONDITION_YAW = 115 # Reach a certain target angle.
MAV_CMD_CONDITION_LAST = 159 # NOP - This command is only used to mark the upper limit of the
                        # CONDITION commands in the enumeration
MAV_CMD_DO_SET_MODE = 176 # Set system mode.
MAV_CMD_DO_JUMP = 177 # Jump to the desired command in the mission list.  Repeat this action
                        # only the specified number of times
MAV_CMD_DO_CHANGE_SPEED = 178 # Change speed and/or throttle set points.
MAV_CMD_DO_SET_HOME = 179 # Changes the home location either to the current location or a
                        # specified location.
MAV_CMD_DO_SET_PARAMETER = 180 # Set a system parameter.  Caution!  Use of this command requires
                        # knowledge of the numeric enumeration value
                        # of the parameter.
MAV_CMD_DO_SET_RELAY = 181 # Set a relay to a condition.
MAV_CMD_DO_REPEAT_RELAY = 182 # Cycle a relay on and off for a desired number of cyles with a desired
                        # period.
MAV_CMD_DO_SET_SERVO = 183 # Set a servo to a desired PWM value.
MAV_CMD_DO_REPEAT_SERVO = 184 # Cycle a between its nominal setting and a desired PWM for a desired
                        # number of cycles with a desired period.
MAV_CMD_DO_CONTROL_VIDEO = 200 # Control onboard camera capturing.
MAV_CMD_DO_SET_ROI = 201 # Sets the region of interest (ROI) for a sensor set or the
                        # vehicle itself. This can then be used by the
                        # vehicles control                     system
                        # to control the vehicle attitude and the
                        # attitude of various
                        # devices such as cameras.
MAV_CMD_DO_DIGICAM_CONFIGURE = 202 # Mission command to configure an on-board camera controller system.
MAV_CMD_DO_DIGICAM_CONTROL = 203 # Mission command to control an on-board camera controller system.
MAV_CMD_DO_MOUNT_CONFIGURE = 204 # Mission command to configure a camera or antenna mount
MAV_CMD_DO_MOUNT_CONTROL = 205 # Mission command to control a camera or antenna mount
MAV_CMD_DO_LAST = 240 # NOP - This command is only used to mark the upper limit of the DO
                        # commands in the enumeration
MAV_CMD_PREFLIGHT_CALIBRATION = 241 # Trigger calibration. This command will be only accepted if in pre-
                        # flight mode.
MAV_CMD_PREFLIGHT_STORAGE = 245 # Request storage of different parameter values and logs. This command
                        # will be only accepted if in pre-flight mode.
MAV_CMD_ENUM_END = 246 # 

# FENCE_ACTION
FENCE_ACTION_NONE = 0 # Disable fenced mode
FENCE_ACTION_GUIDED = 1 # Switched to guided mode to return point (fence point 0)
FENCE_ACTION_ENUM_END = 2 # 

# FENCE_BREACH
FENCE_BREACH_NONE = 0 # No last fence breach
FENCE_BREACH_MINALT = 1 # Breached minimum altitude
FENCE_BREACH_MAXALT = 2 # Breached minimum altitude
FENCE_BREACH_BOUNDARY = 3 # Breached fence boundary
FENCE_BREACH_ENUM_END = 4 # 

# MAV_DATA_STREAM
MAV_DATA_STREAM_ALL = 0 # Enable all data streams
MAV_DATA_STREAM_RAW_SENSORS = 1 # Enable IMU_RAW, GPS_RAW, GPS_STATUS packets.
MAV_DATA_STREAM_EXTENDED_STATUS = 2 # Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS
MAV_DATA_STREAM_RC_CHANNELS = 3 # Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW
MAV_DATA_STREAM_RAW_CONTROLLER = 4 # Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT,
                        # NAV_CONTROLLER_OUTPUT.
MAV_DATA_STREAM_POSITION = 6 # Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages.
MAV_DATA_STREAM_EXTRA1 = 10 # Dependent on the autopilot
MAV_DATA_STREAM_EXTRA2 = 11 # Dependent on the autopilot
MAV_DATA_STREAM_EXTRA3 = 12 # Dependent on the autopilot
MAV_DATA_STREAM_ENUM_END = 13 # 

# MAV_ROI
MAV_ROI_NONE = 0 # No region of interest.
MAV_ROI_WPNEXT = 1 # Point toward next waypoint.
MAV_ROI_WPINDEX = 2 # Point toward given waypoint.
MAV_ROI_LOCATION = 3 # Point toward fixed location.
MAV_ROI_TARGET = 4 # Point toward of given id.
MAV_ROI_ENUM_END = 5 # 

# message IDs
MAVLINK_MSG_ID_BAD_DATA = -1
MAVLINK_MSG_ID_SENSOR_OFFSETS = 150
MAVLINK_MSG_ID_SET_MAG_OFFSETS = 151
MAVLINK_MSG_ID_MEMINFO = 152
MAVLINK_MSG_ID_AP_ADC = 153
MAVLINK_MSG_ID_DIGICAM_CONFIGURE = 154
MAVLINK_MSG_ID_DIGICAM_CONTROL = 155
MAVLINK_MSG_ID_MOUNT_CONFIGURE = 156
MAVLINK_MSG_ID_MOUNT_CONTROL = 157
MAVLINK_MSG_ID_MOUNT_STATUS = 158
MAVLINK_MSG_ID_FENCE_POINT = 160
MAVLINK_MSG_ID_FENCE_FETCH_POINT = 161
MAVLINK_MSG_ID_FENCE_STATUS = 162
MAVLINK_MSG_ID_AHRS = 163
MAVLINK_MSG_ID_SIMSTATE = 164
MAVLINK_MSG_ID_HWSTATUS = 165
MAVLINK_MSG_ID_RADIO = 166
MAVLINK_MSG_ID_HEARTBEAT = 0
MAVLINK_MSG_ID_BOOT = 1
MAVLINK_MSG_ID_SYSTEM_TIME = 2
MAVLINK_MSG_ID_PING = 3
MAVLINK_MSG_ID_SYSTEM_TIME_UTC = 4
MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL = 5
MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK = 6
MAVLINK_MSG_ID_AUTH_KEY = 7
MAVLINK_MSG_ID_ACTION_ACK = 9
MAVLINK_MSG_ID_ACTION = 10
MAVLINK_MSG_ID_SET_MODE = 11
MAVLINK_MSG_ID_SET_NAV_MODE = 12
MAVLINK_MSG_ID_PARAM_REQUEST_READ = 20
MAVLINK_MSG_ID_PARAM_REQUEST_LIST = 21
MAVLINK_MSG_ID_PARAM_VALUE = 22
MAVLINK_MSG_ID_PARAM_SET = 23
MAVLINK_MSG_ID_GPS_RAW_INT = 25
MAVLINK_MSG_ID_SCALED_IMU = 26
MAVLINK_MSG_ID_GPS_STATUS = 27
MAVLINK_MSG_ID_RAW_IMU = 28
MAVLINK_MSG_ID_RAW_PRESSURE = 29
MAVLINK_MSG_ID_SCALED_PRESSURE = 38
MAVLINK_MSG_ID_ATTITUDE = 30
MAVLINK_MSG_ID_LOCAL_POSITION = 31
MAVLINK_MSG_ID_GLOBAL_POSITION = 33
MAVLINK_MSG_ID_GPS_RAW = 32
MAVLINK_MSG_ID_SYS_STATUS = 34
MAVLINK_MSG_ID_RC_CHANNELS_RAW = 35
MAVLINK_MSG_ID_RC_CHANNELS_SCALED = 36
MAVLINK_MSG_ID_SERVO_OUTPUT_RAW = 37
MAVLINK_MSG_ID_WAYPOINT = 39
MAVLINK_MSG_ID_WAYPOINT_REQUEST = 40
MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT = 41
MAVLINK_MSG_ID_WAYPOINT_CURRENT = 42
MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST = 43
MAVLINK_MSG_ID_WAYPOINT_COUNT = 44
MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL = 45
MAVLINK_MSG_ID_WAYPOINT_REACHED = 46
MAVLINK_MSG_ID_WAYPOINT_ACK = 47
MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN = 48
MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET = 49
MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET = 50
MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT = 51
MAVLINK_MSG_ID_CONTROL_STATUS = 52
MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA = 53
MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA = 54
MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST = 55
MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST = 56
MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT = 57
MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT = 58
MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT = 62
MAVLINK_MSG_ID_POSITION_TARGET = 63
MAVLINK_MSG_ID_STATE_CORRECTION = 64
MAVLINK_MSG_ID_SET_ALTITUDE = 65
MAVLINK_MSG_ID_REQUEST_DATA_STREAM = 66
MAVLINK_MSG_ID_HIL_STATE = 67
MAVLINK_MSG_ID_HIL_CONTROLS = 68
MAVLINK_MSG_ID_MANUAL_CONTROL = 69
MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE = 70
MAVLINK_MSG_ID_GLOBAL_POSITION_INT = 73
MAVLINK_MSG_ID_VFR_HUD = 74
MAVLINK_MSG_ID_COMMAND = 75
MAVLINK_MSG_ID_COMMAND_ACK = 76
MAVLINK_MSG_ID_OPTICAL_FLOW = 100
MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT = 140
MAVLINK_MSG_ID_DEBUG_VECT = 251
MAVLINK_MSG_ID_NAMED_VALUE_FLOAT = 252
MAVLINK_MSG_ID_NAMED_VALUE_INT = 253
MAVLINK_MSG_ID_STATUSTEXT = 254
MAVLINK_MSG_ID_DEBUG = 255

class MAVLink_sensor_offsets_message(MAVLink_message):
        '''
        Offsets and calibrations values for hardware         sensors.
        This makes it easier to debug the calibration process.
        '''
        def __init__(self, mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SENSOR_OFFSETS, 'SENSOR_OFFSETS')
                self._fieldnames = ['mag_ofs_x', 'mag_ofs_y', 'mag_ofs_z', 'mag_declination', 'raw_press', 'raw_temp', 'gyro_cal_x', 'gyro_cal_y', 'gyro_cal_z', 'accel_cal_x', 'accel_cal_y', 'accel_cal_z']
                self.mag_ofs_x = mag_ofs_x
                self.mag_ofs_y = mag_ofs_y
                self.mag_ofs_z = mag_ofs_z
                self.mag_declination = mag_declination
                self.raw_press = raw_press
                self.raw_temp = raw_temp
                self.gyro_cal_x = gyro_cal_x
                self.gyro_cal_y = gyro_cal_y
                self.gyro_cal_z = gyro_cal_z
                self.accel_cal_x = accel_cal_x
                self.accel_cal_y = accel_cal_y
                self.accel_cal_z = accel_cal_z

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 143, struct.pack('>hhhfiiffffff', self.mag_ofs_x, self.mag_ofs_y, self.mag_ofs_z, self.mag_declination, self.raw_press, self.raw_temp, self.gyro_cal_x, self.gyro_cal_y, self.gyro_cal_z, self.accel_cal_x, self.accel_cal_y, self.accel_cal_z))

class MAVLink_set_mag_offsets_message(MAVLink_message):
        '''
        set the magnetometer offsets
        '''
        def __init__(self, target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_MAG_OFFSETS, 'SET_MAG_OFFSETS')
                self._fieldnames = ['target_system', 'target_component', 'mag_ofs_x', 'mag_ofs_y', 'mag_ofs_z']
                self.target_system = target_system
                self.target_component = target_component
                self.mag_ofs_x = mag_ofs_x
                self.mag_ofs_y = mag_ofs_y
                self.mag_ofs_z = mag_ofs_z

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 29, struct.pack('>BBhhh', self.target_system, self.target_component, self.mag_ofs_x, self.mag_ofs_y, self.mag_ofs_z))

class MAVLink_meminfo_message(MAVLink_message):
        '''
        state of APM memory
        '''
        def __init__(self, brkval, freemem):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_MEMINFO, 'MEMINFO')
                self._fieldnames = ['brkval', 'freemem']
                self.brkval = brkval
                self.freemem = freemem

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 208, struct.pack('>HH', self.brkval, self.freemem))

class MAVLink_ap_adc_message(MAVLink_message):
        '''
        raw ADC output
        '''
        def __init__(self, adc1, adc2, adc3, adc4, adc5, adc6):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_AP_ADC, 'AP_ADC')
                self._fieldnames = ['adc1', 'adc2', 'adc3', 'adc4', 'adc5', 'adc6']
                self.adc1 = adc1
                self.adc2 = adc2
                self.adc3 = adc3
                self.adc4 = adc4
                self.adc5 = adc5
                self.adc6 = adc6

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 188, struct.pack('>HHHHHH', self.adc1, self.adc2, self.adc3, self.adc4, self.adc5, self.adc6))

class MAVLink_digicam_configure_message(MAVLink_message):
        '''
        Configure on-board Camera Control System.
        '''
        def __init__(self, target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, 'DIGICAM_CONFIGURE')
                self._fieldnames = ['target_system', 'target_component', 'mode', 'shutter_speed', 'aperture', 'iso', 'exposure_type', 'command_id', 'engine_cut_off', 'extra_param', 'extra_value']
                self.target_system = target_system
                self.target_component = target_component
                self.mode = mode
                self.shutter_speed = shutter_speed
                self.aperture = aperture
                self.iso = iso
                self.exposure_type = exposure_type
                self.command_id = command_id
                self.engine_cut_off = engine_cut_off
                self.extra_param = extra_param
                self.extra_value = extra_value

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 118, struct.pack('>BBBHBBBBBBf', self.target_system, self.target_component, self.mode, self.shutter_speed, self.aperture, self.iso, self.exposure_type, self.command_id, self.engine_cut_off, self.extra_param, self.extra_value))

class MAVLink_digicam_control_message(MAVLink_message):
        '''
        Control on-board Camera Control System to take shots.
        '''
        def __init__(self, target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_DIGICAM_CONTROL, 'DIGICAM_CONTROL')
                self._fieldnames = ['target_system', 'target_component', 'session', 'zoom_pos', 'zoom_step', 'focus_lock', 'shot', 'command_id', 'extra_param', 'extra_value']
                self.target_system = target_system
                self.target_component = target_component
                self.session = session
                self.zoom_pos = zoom_pos
                self.zoom_step = zoom_step
                self.focus_lock = focus_lock
                self.shot = shot
                self.command_id = command_id
                self.extra_param = extra_param
                self.extra_value = extra_value

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 242, struct.pack('>BBBBbBBBBf', self.target_system, self.target_component, self.session, self.zoom_pos, self.zoom_step, self.focus_lock, self.shot, self.command_id, self.extra_param, self.extra_value))

class MAVLink_mount_configure_message(MAVLink_message):
        '''
        Message to configure a camera mount, directional antenna, etc.
        '''
        def __init__(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_MOUNT_CONFIGURE, 'MOUNT_CONFIGURE')
                self._fieldnames = ['target_system', 'target_component', 'mount_mode', 'stab_roll', 'stab_pitch', 'stab_yaw']
                self.target_system = target_system
                self.target_component = target_component
                self.mount_mode = mount_mode
                self.stab_roll = stab_roll
                self.stab_pitch = stab_pitch
                self.stab_yaw = stab_yaw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 19, struct.pack('>BBBBBB', self.target_system, self.target_component, self.mount_mode, self.stab_roll, self.stab_pitch, self.stab_yaw))

class MAVLink_mount_control_message(MAVLink_message):
        '''
        Message to control a camera mount, directional antenna, etc.
        '''
        def __init__(self, target_system, target_component, input_a, input_b, input_c, save_position):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_MOUNT_CONTROL, 'MOUNT_CONTROL')
                self._fieldnames = ['target_system', 'target_component', 'input_a', 'input_b', 'input_c', 'save_position']
                self.target_system = target_system
                self.target_component = target_component
                self.input_a = input_a
                self.input_b = input_b
                self.input_c = input_c
                self.save_position = save_position

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 97, struct.pack('>BBiiiB', self.target_system, self.target_component, self.input_a, self.input_b, self.input_c, self.save_position))

class MAVLink_mount_status_message(MAVLink_message):
        '''
        Message with some status from APM to GCS about camera or
        antenna mount
        '''
        def __init__(self, target_system, target_component, pointing_a, pointing_b, pointing_c):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_MOUNT_STATUS, 'MOUNT_STATUS')
                self._fieldnames = ['target_system', 'target_component', 'pointing_a', 'pointing_b', 'pointing_c']
                self.target_system = target_system
                self.target_component = target_component
                self.pointing_a = pointing_a
                self.pointing_b = pointing_b
                self.pointing_c = pointing_c

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 233, struct.pack('>BBiii', self.target_system, self.target_component, self.pointing_a, self.pointing_b, self.pointing_c))

class MAVLink_fence_point_message(MAVLink_message):
        '''
        A fence point. Used to set a point when from               GCS
        -> MAV. Also used to return a point from MAV -> GCS
        '''
        def __init__(self, target_system, target_component, idx, count, lat, lng):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_FENCE_POINT, 'FENCE_POINT')
                self._fieldnames = ['target_system', 'target_component', 'idx', 'count', 'lat', 'lng']
                self.target_system = target_system
                self.target_component = target_component
                self.idx = idx
                self.count = count
                self.lat = lat
                self.lng = lng

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 18, struct.pack('>BBBBff', self.target_system, self.target_component, self.idx, self.count, self.lat, self.lng))

class MAVLink_fence_fetch_point_message(MAVLink_message):
        '''
        Request a current fence point from MAV
        '''
        def __init__(self, target_system, target_component, idx):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_FENCE_FETCH_POINT, 'FENCE_FETCH_POINT')
                self._fieldnames = ['target_system', 'target_component', 'idx']
                self.target_system = target_system
                self.target_component = target_component
                self.idx = idx

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 68, struct.pack('>BBB', self.target_system, self.target_component, self.idx))

class MAVLink_fence_status_message(MAVLink_message):
        '''
        Status of geo-fencing. Sent in extended             status
        stream when fencing enabled
        '''
        def __init__(self, breach_status, breach_count, breach_type, breach_time):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_FENCE_STATUS, 'FENCE_STATUS')
                self._fieldnames = ['breach_status', 'breach_count', 'breach_type', 'breach_time']
                self.breach_status = breach_status
                self.breach_count = breach_count
                self.breach_type = breach_type
                self.breach_time = breach_time

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 136, struct.pack('>BHBI', self.breach_status, self.breach_count, self.breach_type, self.breach_time))

class MAVLink_ahrs_message(MAVLink_message):
        '''
        Status of DCM attitude estimator
        '''
        def __init__(self, omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_AHRS, 'AHRS')
                self._fieldnames = ['omegaIx', 'omegaIy', 'omegaIz', 'accel_weight', 'renorm_val', 'error_rp', 'error_yaw']
                self.omegaIx = omegaIx
                self.omegaIy = omegaIy
                self.omegaIz = omegaIz
                self.accel_weight = accel_weight
                self.renorm_val = renorm_val
                self.error_rp = error_rp
                self.error_yaw = error_yaw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 127, struct.pack('>fffffff', self.omegaIx, self.omegaIy, self.omegaIz, self.accel_weight, self.renorm_val, self.error_rp, self.error_yaw))

class MAVLink_simstate_message(MAVLink_message):
        '''
        Status of simulation environment, if used
        '''
        def __init__(self, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SIMSTATE, 'SIMSTATE')
                self._fieldnames = ['roll', 'pitch', 'yaw', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro']
                self.roll = roll
                self.pitch = pitch
                self.yaw = yaw
                self.xacc = xacc
                self.yacc = yacc
                self.zacc = zacc
                self.xgyro = xgyro
                self.ygyro = ygyro
                self.zgyro = zgyro

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 42, struct.pack('>fffffffff', self.roll, self.pitch, self.yaw, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro))

class MAVLink_hwstatus_message(MAVLink_message):
        '''
        Status of key hardware
        '''
        def __init__(self, Vcc, I2Cerr):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_HWSTATUS, 'HWSTATUS')
                self._fieldnames = ['Vcc', 'I2Cerr']
                self.Vcc = Vcc
                self.I2Cerr = I2Cerr

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 21, struct.pack('>HB', self.Vcc, self.I2Cerr))

class MAVLink_radio_message(MAVLink_message):
        '''
        Status generated by radio
        '''
        def __init__(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_RADIO, 'RADIO')
                self._fieldnames = ['rssi', 'remrssi', 'txbuf', 'noise', 'remnoise', 'rxerrors', 'fixed']
                self.rssi = rssi
                self.remrssi = remrssi
                self.txbuf = txbuf
                self.noise = noise
                self.remnoise = remnoise
                self.rxerrors = rxerrors
                self.fixed = fixed

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 93, struct.pack('>BBBBBHH', self.rssi, self.remrssi, self.txbuf, self.noise, self.remnoise, self.rxerrors, self.fixed))

class MAVLink_heartbeat_message(MAVLink_message):
        '''
        The heartbeat message shows that a system is present and
        responding. The type of the MAV and Autopilot hardware allow
        the receiving system to treat further messages from this
        system appropriate (e.g. by laying out the user interface
        based on the autopilot).
        '''
        def __init__(self, type, autopilot, mavlink_version):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_HEARTBEAT, 'HEARTBEAT')
                self._fieldnames = ['type', 'autopilot', 'mavlink_version']
                self.type = type
                self.autopilot = autopilot
                self.mavlink_version = mavlink_version

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 72, struct.pack('>BBB', self.type, self.autopilot, self.mavlink_version))

class MAVLink_boot_message(MAVLink_message):
        '''
        The boot message indicates that a system is starting. The
        onboard software version allows to keep track of onboard
        soft/firmware revisions.
        '''
        def __init__(self, version):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_BOOT, 'BOOT')
                self._fieldnames = ['version']
                self.version = version

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 39, struct.pack('>I', self.version))

class MAVLink_system_time_message(MAVLink_message):
        '''
        The system time is the time of the master clock, typically the
        computer clock of the main onboard computer.
        '''
        def __init__(self, time_usec):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SYSTEM_TIME, 'SYSTEM_TIME')
                self._fieldnames = ['time_usec']
                self.time_usec = time_usec

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 190, struct.pack('>Q', self.time_usec))

class MAVLink_ping_message(MAVLink_message):
        '''
        A ping message either requesting or responding to a ping. This
        allows to measure the system latencies, including serial port,
        radio modem and UDP connections.
        '''
        def __init__(self, seq, target_system, target_component, time):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_PING, 'PING')
                self._fieldnames = ['seq', 'target_system', 'target_component', 'time']
                self.seq = seq
                self.target_system = target_system
                self.target_component = target_component
                self.time = time

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 92, struct.pack('>IBBQ', self.seq, self.target_system, self.target_component, self.time))

class MAVLink_system_time_utc_message(MAVLink_message):
        '''
        UTC date and time from GPS module
        '''
        def __init__(self, utc_date, utc_time):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SYSTEM_TIME_UTC, 'SYSTEM_TIME_UTC')
                self._fieldnames = ['utc_date', 'utc_time']
                self.utc_date = utc_date
                self.utc_time = utc_time

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 191, struct.pack('>II', self.utc_date, self.utc_time))

class MAVLink_change_operator_control_message(MAVLink_message):
        '''
        Request to control this MAV
        '''
        def __init__(self, target_system, control_request, version, passkey):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, 'CHANGE_OPERATOR_CONTROL')
                self._fieldnames = ['target_system', 'control_request', 'version', 'passkey']
                self.target_system = target_system
                self.control_request = control_request
                self.version = version
                self.passkey = passkey

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 217, struct.pack('>BBB25s', self.target_system, self.control_request, self.version, self.passkey))

class MAVLink_change_operator_control_ack_message(MAVLink_message):
        '''
        Accept / deny control of this MAV
        '''
        def __init__(self, gcs_system_id, control_request, ack):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, 'CHANGE_OPERATOR_CONTROL_ACK')
                self._fieldnames = ['gcs_system_id', 'control_request', 'ack']
                self.gcs_system_id = gcs_system_id
                self.control_request = control_request
                self.ack = ack

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 104, struct.pack('>BBB', self.gcs_system_id, self.control_request, self.ack))

class MAVLink_auth_key_message(MAVLink_message):
        '''
        Emit an encrypted signature / key identifying this system.
        PLEASE NOTE: This protocol has been kept simple, so
        transmitting the key requires an encrypted channel for true
        safety.
        '''
        def __init__(self, key):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_AUTH_KEY, 'AUTH_KEY')
                self._fieldnames = ['key']
                self.key = key

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 119, struct.pack('>32s', self.key))

class MAVLink_action_ack_message(MAVLink_message):
        '''
        This message acknowledges an action. IMPORTANT: The
        acknowledgement can be also negative, e.g. the MAV rejects a
        reset message because it is in-flight. The action ids are
        defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h
        '''
        def __init__(self, action, result):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_ACTION_ACK, 'ACTION_ACK')
                self._fieldnames = ['action', 'result']
                self.action = action
                self.result = result

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 219, struct.pack('>BB', self.action, self.result))

class MAVLink_action_message(MAVLink_message):
        '''
        An action message allows to execute a certain onboard action.
        These include liftoff, land, storing parameters too EEPROM,
        shutddown, etc. The action ids are defined in ENUM MAV_ACTION
        in mavlink/include/mavlink_types.h
        '''
        def __init__(self, target, target_component, action):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_ACTION, 'ACTION')
                self._fieldnames = ['target', 'target_component', 'action']
                self.target = target
                self.target_component = target_component
                self.action = action

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 60, struct.pack('>BBB', self.target, self.target_component, self.action))

class MAVLink_set_mode_message(MAVLink_message):
        '''
        Set the system mode, as defined by enum MAV_MODE in
        mavlink/include/mavlink_types.h. There is no target component
        id as the mode is by definition for the overall aircraft, not
        only for one component.
        '''
        def __init__(self, target, mode):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_MODE, 'SET_MODE')
                self._fieldnames = ['target', 'mode']
                self.target = target
                self.mode = mode

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 186, struct.pack('>BB', self.target, self.mode))

class MAVLink_set_nav_mode_message(MAVLink_message):
        '''
        Set the system navigation mode, as defined by enum
        MAV_NAV_MODE in mavlink/include/mavlink_types.h. The
        navigation mode applies to the whole aircraft and thus all
        components.
        '''
        def __init__(self, target, nav_mode):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_NAV_MODE, 'SET_NAV_MODE')
                self._fieldnames = ['target', 'nav_mode']
                self.target = target
                self.nav_mode = nav_mode

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 10, struct.pack('>BB', self.target, self.nav_mode))

class MAVLink_param_request_read_message(MAVLink_message):
        '''
        Request to read the onboard parameter with the param_id string
        id. Onboard parameters are stored as key[const char*] ->
        value[float]. This allows to send a parameter to any other
        component (such as the GCS) without the need of previous
        knowledge of possible parameter names. Thus the same GCS can
        store different parameters for different autopilots. See also
        http://qgroundcontrol.org/parameter_interface for a full
        documentation of QGroundControl and IMU code.
        '''
        def __init__(self, target_system, target_component, param_id, param_index):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_REQUEST_READ, 'PARAM_REQUEST_READ')
                self._fieldnames = ['target_system', 'target_component', 'param_id', 'param_index']
                self.target_system = target_system
                self.target_component = target_component
                self.param_id = param_id
                self.param_index = param_index

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 89, struct.pack('>BB15sh', self.target_system, self.target_component, self.param_id, self.param_index))

class MAVLink_param_request_list_message(MAVLink_message):
        '''
        Request all parameters of this component. After his request,
        all parameters are emitted.
        '''
        def __init__(self, target_system, target_component):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, 'PARAM_REQUEST_LIST')
                self._fieldnames = ['target_system', 'target_component']
                self.target_system = target_system
                self.target_component = target_component

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 159, struct.pack('>BB', self.target_system, self.target_component))

class MAVLink_param_value_message(MAVLink_message):
        '''
        Emit the value of a onboard parameter. The inclusion of
        param_count and param_index in the message allows the
        recipient to keep track of received parameters and allows him
        to re-request missing parameters after a loss or timeout.
        '''
        def __init__(self, param_id, param_value, param_count, param_index):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_VALUE, 'PARAM_VALUE')
                self._fieldnames = ['param_id', 'param_value', 'param_count', 'param_index']
                self.param_id = param_id
                self.param_value = param_value
                self.param_count = param_count
                self.param_index = param_index

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 162, struct.pack('>15sfHH', self.param_id, self.param_value, self.param_count, self.param_index))

class MAVLink_param_set_message(MAVLink_message):
        '''
        Set a parameter value TEMPORARILY to RAM. It will be reset to
        default on system reboot. Send the ACTION
        MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents
        to EEPROM. IMPORTANT: The receiving component should
        acknowledge the new parameter value by sending a param_value
        message to all communication partners. This will also ensure
        that multiple GCS all have an up-to-date list of all
        parameters. If the sending GCS did not receive a PARAM_VALUE
        message within its timeout time, it should re-send the
        PARAM_SET message.
        '''
        def __init__(self, target_system, target_component, param_id, param_value):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_SET, 'PARAM_SET')
                self._fieldnames = ['target_system', 'target_component', 'param_id', 'param_value']
                self.target_system = target_system
                self.target_component = target_component
                self.param_id = param_id
                self.param_value = param_value

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 121, struct.pack('>BB15sf', self.target_system, self.target_component, self.param_id, self.param_value))

class MAVLink_gps_raw_int_message(MAVLink_message):
        '''
        The global position, as returned by the Global Positioning
        System (GPS). This is NOT the global position estimate of the
        sytem, but rather a RAW sensor value. See message
        GLOBAL_POSITION for the global position estimate. Coordinate
        frame is right-handed, Z-axis up (GPS frame)
        '''
        def __init__(self, usec, fix_type, lat, lon, alt, eph, epv, v, hdg):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_RAW_INT, 'GPS_RAW_INT')
                self._fieldnames = ['usec', 'fix_type', 'lat', 'lon', 'alt', 'eph', 'epv', 'v', 'hdg']
                self.usec = usec
                self.fix_type = fix_type
                self.lat = lat
                self.lon = lon
                self.alt = alt
                self.eph = eph
                self.epv = epv
                self.v = v
                self.hdg = hdg

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 149, struct.pack('>QBiiiffff', self.usec, self.fix_type, self.lat, self.lon, self.alt, self.eph, self.epv, self.v, self.hdg))

class MAVLink_scaled_imu_message(MAVLink_message):
        '''
        The RAW IMU readings for the usual 9DOF sensor setup. This
        message should contain the scaled values to the described
        units
        '''
        def __init__(self, usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SCALED_IMU, 'SCALED_IMU')
                self._fieldnames = ['usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
                self.usec = usec
                self.xacc = xacc
                self.yacc = yacc
                self.zacc = zacc
                self.xgyro = xgyro
                self.ygyro = ygyro
                self.zgyro = zgyro
                self.xmag = xmag
                self.ymag = ymag
                self.zmag = zmag

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 222, struct.pack('>Qhhhhhhhhh', self.usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag))

class MAVLink_gps_status_message(MAVLink_message):
        '''
        The positioning status, as reported by GPS. This message is
        intended to display status information about each satellite
        visible to the receiver. See message GLOBAL_POSITION for the
        global position estimate. This message can contain information
        for up to 20 satellites.
        '''
        def __init__(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_STATUS, 'GPS_STATUS')
                self._fieldnames = ['satellites_visible', 'satellite_prn', 'satellite_used', 'satellite_elevation', 'satellite_azimuth', 'satellite_snr']
                self.satellites_visible = satellites_visible
                self.satellite_prn = satellite_prn
                self.satellite_used = satellite_used
                self.satellite_elevation = satellite_elevation
                self.satellite_azimuth = satellite_azimuth
                self.satellite_snr = satellite_snr

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 110, struct.pack('>B20s20s20s20s20s', self.satellites_visible, self.satellite_prn, self.satellite_used, self.satellite_elevation, self.satellite_azimuth, self.satellite_snr))

class MAVLink_raw_imu_message(MAVLink_message):
        '''
        The RAW IMU readings for the usual 9DOF sensor setup. This
        message should always contain the true raw values without any
        scaling to allow data capture and system debugging.
        '''
        def __init__(self, usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_RAW_IMU, 'RAW_IMU')
                self._fieldnames = ['usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
                self.usec = usec
                self.xacc = xacc
                self.yacc = yacc
                self.zacc = zacc
                self.xgyro = xgyro
                self.ygyro = ygyro
                self.zgyro = zgyro
                self.xmag = xmag
                self.ymag = ymag
                self.zmag = zmag

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 179, struct.pack('>Qhhhhhhhhh', self.usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag))

class MAVLink_raw_pressure_message(MAVLink_message):
        '''
        The RAW pressure readings for the typical setup of one
        absolute pressure and one differential pressure sensor. The
        sensor values should be the raw, UNSCALED ADC values.
        '''
        def __init__(self, usec, press_abs, press_diff1, press_diff2, temperature):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_RAW_PRESSURE, 'RAW_PRESSURE')
                self._fieldnames = ['usec', 'press_abs', 'press_diff1', 'press_diff2', 'temperature']
                self.usec = usec
                self.press_abs = press_abs
                self.press_diff1 = press_diff1
                self.press_diff2 = press_diff2
                self.temperature = temperature

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 136, struct.pack('>Qhhhh', self.usec, self.press_abs, self.press_diff1, self.press_diff2, self.temperature))

class MAVLink_scaled_pressure_message(MAVLink_message):
        '''
        The pressure readings for the typical setup of one absolute
        and differential pressure sensor. The units are as specified
        in each field.
        '''
        def __init__(self, usec, press_abs, press_diff, temperature):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SCALED_PRESSURE, 'SCALED_PRESSURE')
                self._fieldnames = ['usec', 'press_abs', 'press_diff', 'temperature']
                self.usec = usec
                self.press_abs = press_abs
                self.press_diff = press_diff
                self.temperature = temperature

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 229, struct.pack('>Qffh', self.usec, self.press_abs, self.press_diff, self.temperature))

class MAVLink_attitude_message(MAVLink_message):
        '''
        The attitude in the aeronautical frame (right-handed, Z-down,
        X-front, Y-right).
        '''
        def __init__(self, usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_ATTITUDE, 'ATTITUDE')
                self._fieldnames = ['usec', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed']
                self.usec = usec
                self.roll = roll
                self.pitch = pitch
                self.yaw = yaw
                self.rollspeed = rollspeed
                self.pitchspeed = pitchspeed
                self.yawspeed = yawspeed

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 66, struct.pack('>Qffffff', self.usec, self.roll, self.pitch, self.yaw, self.rollspeed, self.pitchspeed, self.yawspeed))

class MAVLink_local_position_message(MAVLink_message):
        '''
        The filtered local position (e.g. fused computer vision and
        accelerometers). Coordinate frame is right-handed, Z-axis down
        (aeronautical frame)
        '''
        def __init__(self, usec, x, y, z, vx, vy, vz):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_LOCAL_POSITION, 'LOCAL_POSITION')
                self._fieldnames = ['usec', 'x', 'y', 'z', 'vx', 'vy', 'vz']
                self.usec = usec
                self.x = x
                self.y = y
                self.z = z
                self.vx = vx
                self.vy = vy
                self.vz = vz

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 126, struct.pack('>Qffffff', self.usec, self.x, self.y, self.z, self.vx, self.vy, self.vz))

class MAVLink_global_position_message(MAVLink_message):
        '''
        The filtered global position (e.g. fused GPS and
        accelerometers). Coordinate frame is right-handed, Z-axis up
        (GPS frame)
        '''
        def __init__(self, usec, lat, lon, alt, vx, vy, vz):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_GLOBAL_POSITION, 'GLOBAL_POSITION')
                self._fieldnames = ['usec', 'lat', 'lon', 'alt', 'vx', 'vy', 'vz']
                self.usec = usec
                self.lat = lat
                self.lon = lon
                self.alt = alt
                self.vx = vx
                self.vy = vy
                self.vz = vz

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 147, struct.pack('>Qffffff', self.usec, self.lat, self.lon, self.alt, self.vx, self.vy, self.vz))

class MAVLink_gps_raw_message(MAVLink_message):
        '''
        The global position, as returned by the Global Positioning
        System (GPS). This is NOT the global position estimate of the
        sytem, but rather a RAW sensor value. See message
        GLOBAL_POSITION for the global position estimate. Coordinate
        frame is right-handed, Z-axis up (GPS frame)
        '''
        def __init__(self, usec, fix_type, lat, lon, alt, eph, epv, v, hdg):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_RAW, 'GPS_RAW')
                self._fieldnames = ['usec', 'fix_type', 'lat', 'lon', 'alt', 'eph', 'epv', 'v', 'hdg']
                self.usec = usec
                self.fix_type = fix_type
                self.lat = lat
                self.lon = lon
                self.alt = alt
                self.eph = eph
                self.epv = epv
                self.v = v
                self.hdg = hdg

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 185, struct.pack('>QBfffffff', self.usec, self.fix_type, self.lat, self.lon, self.alt, self.eph, self.epv, self.v, self.hdg))

class MAVLink_sys_status_message(MAVLink_message):
        '''
        The general system state. If the system is following the
        MAVLink standard, the system state is mainly defined by three
        orthogonal states/modes: The system mode, which is either
        LOCKED (motors shut down and locked), MANUAL (system under RC
        control), GUIDED (system with autonomous position control,
        position setpoint controlled manually) or AUTO (system guided
        by path/waypoint planner). The NAV_MODE defined the current
        flight state: LIFTOFF (often an open-loop maneuver), LANDING,
        WAYPOINTS or VECTOR. This represents the internal navigation
        state machine. The system status shows wether the system is
        currently active or not and if an emergency occured. During
        the CRITICAL and EMERGENCY states the MAV is still considered
        to be active, but should start emergency procedures
        autonomously. After a failure occured it should first move
        from active to critical to allow manual intervention and then
        move to emergency after a certain timeout.
        '''
        def __init__(self, mode, nav_mode, status, load, vbat, battery_remaining, packet_drop):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SYS_STATUS, 'SYS_STATUS')
                self._fieldnames = ['mode', 'nav_mode', 'status', 'load', 'vbat', 'battery_remaining', 'packet_drop']
                self.mode = mode
                self.nav_mode = nav_mode
                self.status = status
                self.load = load
                self.vbat = vbat
                self.battery_remaining = battery_remaining
                self.packet_drop = packet_drop

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 112, struct.pack('>BBBHHHH', self.mode, self.nav_mode, self.status, self.load, self.vbat, self.battery_remaining, self.packet_drop))

class MAVLink_rc_channels_raw_message(MAVLink_message):
        '''
        The RAW values of the RC channels received. The standard PPM
        modulation is as follows: 1000 microseconds: 0%, 2000
        microseconds: 100%. Individual receivers/transmitters might
        violate this specification.
        '''
        def __init__(self, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_RC_CHANNELS_RAW, 'RC_CHANNELS_RAW')
                self._fieldnames = ['chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'rssi']
                self.chan1_raw = chan1_raw
                self.chan2_raw = chan2_raw
                self.chan3_raw = chan3_raw
                self.chan4_raw = chan4_raw
                self.chan5_raw = chan5_raw
                self.chan6_raw = chan6_raw
                self.chan7_raw = chan7_raw
                self.chan8_raw = chan8_raw
                self.rssi = rssi

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 252, struct.pack('>HHHHHHHHB', self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.rssi))

class MAVLink_rc_channels_scaled_message(MAVLink_message):
        '''
        The scaled values of the RC channels received. (-100%) -10000,
        (0%) 0, (100%) 10000
        '''
        def __init__(self, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, 'RC_CHANNELS_SCALED')
                self._fieldnames = ['chan1_scaled', 'chan2_scaled', 'chan3_scaled', 'chan4_scaled', 'chan5_scaled', 'chan6_scaled', 'chan7_scaled', 'chan8_scaled', 'rssi']
                self.chan1_scaled = chan1_scaled
                self.chan2_scaled = chan2_scaled
                self.chan3_scaled = chan3_scaled
                self.chan4_scaled = chan4_scaled
                self.chan5_scaled = chan5_scaled
                self.chan6_scaled = chan6_scaled
                self.chan7_scaled = chan7_scaled
                self.chan8_scaled = chan8_scaled
                self.rssi = rssi

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 162, struct.pack('>hhhhhhhhB', self.chan1_scaled, self.chan2_scaled, self.chan3_scaled, self.chan4_scaled, self.chan5_scaled, self.chan6_scaled, self.chan7_scaled, self.chan8_scaled, self.rssi))

class MAVLink_servo_output_raw_message(MAVLink_message):
        '''
        The RAW values of the servo outputs (for RC input from the
        remote, use the RC_CHANNELS messages). The standard PPM
        modulation is as follows: 1000 microseconds: 0%, 2000
        microseconds: 100%.
        '''
        def __init__(self, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 'SERVO_OUTPUT_RAW')
                self._fieldnames = ['servo1_raw', 'servo2_raw', 'servo3_raw', 'servo4_raw', 'servo5_raw', 'servo6_raw', 'servo7_raw', 'servo8_raw']
                self.servo1_raw = servo1_raw
                self.servo2_raw = servo2_raw
                self.servo3_raw = servo3_raw
                self.servo4_raw = servo4_raw
                self.servo5_raw = servo5_raw
                self.servo6_raw = servo6_raw
                self.servo7_raw = servo7_raw
                self.servo8_raw = servo8_raw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 215, struct.pack('>HHHHHHHH', self.servo1_raw, self.servo2_raw, self.servo3_raw, self.servo4_raw, self.servo5_raw, self.servo6_raw, self.servo7_raw, self.servo8_raw))

class MAVLink_waypoint_message(MAVLink_message):
        '''
        Message encoding a waypoint. This message is emitted to
        announce      the presence of a waypoint and to set a waypoint
        on the system. The waypoint can be either in x, y, z meters
        (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is
        Z-down, right handed, global frame is Z-up, right handed
        '''
        def __init__(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT, 'WAYPOINT')
                self._fieldnames = ['target_system', 'target_component', 'seq', 'frame', 'command', 'current', 'autocontinue', 'param1', 'param2', 'param3', 'param4', 'x', 'y', 'z']
                self.target_system = target_system
                self.target_component = target_component
                self.seq = seq
                self.frame = frame
                self.command = command
                self.current = current
                self.autocontinue = autocontinue
                self.param1 = param1
                self.param2 = param2
                self.param3 = param3
                self.param4 = param4
                self.x = x
                self.y = y
                self.z = z

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 128, struct.pack('>BBHBBBBfffffff', self.target_system, self.target_component, self.seq, self.frame, self.command, self.current, self.autocontinue, self.param1, self.param2, self.param3, self.param4, self.x, self.y, self.z))

class MAVLink_waypoint_request_message(MAVLink_message):
        '''
        Request the information of the waypoint with the sequence
        number seq. The response of the system to this message should
        be a WAYPOINT message.
        '''
        def __init__(self, target_system, target_component, seq):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_REQUEST, 'WAYPOINT_REQUEST')
                self._fieldnames = ['target_system', 'target_component', 'seq']
                self.target_system = target_system
                self.target_component = target_component
                self.seq = seq

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 9, struct.pack('>BBH', self.target_system, self.target_component, self.seq))

class MAVLink_waypoint_set_current_message(MAVLink_message):
        '''
        Set the waypoint with sequence number seq as current waypoint.
        This means that the MAV will continue to this waypoint on the
        shortest path (not following the waypoints in-between).
        '''
        def __init__(self, target_system, target_component, seq):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT, 'WAYPOINT_SET_CURRENT')
                self._fieldnames = ['target_system', 'target_component', 'seq']
                self.target_system = target_system
                self.target_component = target_component
                self.seq = seq

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 106, struct.pack('>BBH', self.target_system, self.target_component, self.seq))

class MAVLink_waypoint_current_message(MAVLink_message):
        '''
        Message that announces the sequence number of the current
        active waypoint. The MAV will fly towards this waypoint.
        '''
        def __init__(self, seq):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_CURRENT, 'WAYPOINT_CURRENT')
                self._fieldnames = ['seq']
                self.seq = seq

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 101, struct.pack('>H', self.seq))

class MAVLink_waypoint_request_list_message(MAVLink_message):
        '''
        Request the overall list of waypoints from the
        system/component.
        '''
        def __init__(self, target_system, target_component):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST, 'WAYPOINT_REQUEST_LIST')
                self._fieldnames = ['target_system', 'target_component']
                self.target_system = target_system
                self.target_component = target_component

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 213, struct.pack('>BB', self.target_system, self.target_component))

class MAVLink_waypoint_count_message(MAVLink_message):
        '''
        This message is emitted as response to WAYPOINT_REQUEST_LIST
        by the MAV. The GCS can then request the individual waypoints
        based on the knowledge of the total number of waypoints.
        '''
        def __init__(self, target_system, target_component, count):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_COUNT, 'WAYPOINT_COUNT')
                self._fieldnames = ['target_system', 'target_component', 'count']
                self.target_system = target_system
                self.target_component = target_component
                self.count = count

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 4, struct.pack('>BBH', self.target_system, self.target_component, self.count))

class MAVLink_waypoint_clear_all_message(MAVLink_message):
        '''
        Delete all waypoints at once.
        '''
        def __init__(self, target_system, target_component):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL, 'WAYPOINT_CLEAR_ALL')
                self._fieldnames = ['target_system', 'target_component']
                self.target_system = target_system
                self.target_component = target_component

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 229, struct.pack('>BB', self.target_system, self.target_component))

class MAVLink_waypoint_reached_message(MAVLink_message):
        '''
        A certain waypoint has been reached. The system will either
        hold this position (or circle on the orbit) or (if the
        autocontinue on the WP was set) continue to the next waypoint.
        '''
        def __init__(self, seq):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_REACHED, 'WAYPOINT_REACHED')
                self._fieldnames = ['seq']
                self.seq = seq

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 21, struct.pack('>H', self.seq))

class MAVLink_waypoint_ack_message(MAVLink_message):
        '''
        Ack message during waypoint handling. The type field states if
        this message is a positive ack (type=0) or if an error
        happened (type=non-zero).
        '''
        def __init__(self, target_system, target_component, type):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_WAYPOINT_ACK, 'WAYPOINT_ACK')
                self._fieldnames = ['target_system', 'target_component', 'type']
                self.target_system = target_system
                self.target_component = target_component
                self.type = type

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 214, struct.pack('>BBB', self.target_system, self.target_component, self.type))

class MAVLink_gps_set_global_origin_message(MAVLink_message):
        '''
        As local waypoints exist, the global waypoint reference allows
        to transform between the local coordinate frame and the global
        (GPS) coordinate frame. This can be necessary when e.g. in-
        and outdoor settings are connected and the MAV should move
        from in- to outdoor.
        '''
        def __init__(self, target_system, target_component, latitude, longitude, altitude):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN, 'GPS_SET_GLOBAL_ORIGIN')
                self._fieldnames = ['target_system', 'target_component', 'latitude', 'longitude', 'altitude']
                self.target_system = target_system
                self.target_component = target_component
                self.latitude = latitude
                self.longitude = longitude
                self.altitude = altitude

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 215, struct.pack('>BBiii', self.target_system, self.target_component, self.latitude, self.longitude, self.altitude))

class MAVLink_gps_local_origin_set_message(MAVLink_message):
        '''
        Once the MAV sets a new GPS-Local correspondence, this message
        announces the origin (0,0,0) position
        '''
        def __init__(self, latitude, longitude, altitude):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET, 'GPS_LOCAL_ORIGIN_SET')
                self._fieldnames = ['latitude', 'longitude', 'altitude']
                self.latitude = latitude
                self.longitude = longitude
                self.altitude = altitude

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 14, struct.pack('>iii', self.latitude, self.longitude, self.altitude))

class MAVLink_local_position_setpoint_set_message(MAVLink_message):
        '''
        Set the setpoint for a local position controller. This is the
        position in local coordinates the MAV should fly to. This
        message is sent by the path/waypoint planner to the onboard
        position controller. As some MAVs have a degree of freedom in
        yaw (e.g. all helicopters/quadrotors), the desired yaw angle
        is part of the message.
        '''
        def __init__(self, target_system, target_component, x, y, z, yaw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET, 'LOCAL_POSITION_SETPOINT_SET')
                self._fieldnames = ['target_system', 'target_component', 'x', 'y', 'z', 'yaw']
                self.target_system = target_system
                self.target_component = target_component
                self.x = x
                self.y = y
                self.z = z
                self.yaw = yaw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 206, struct.pack('>BBffff', self.target_system, self.target_component, self.x, self.y, self.z, self.yaw))

class MAVLink_local_position_setpoint_message(MAVLink_message):
        '''
        Transmit the current local setpoint of the controller to other
        MAVs (collision avoidance) and to the GCS.
        '''
        def __init__(self, x, y, z, yaw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, 'LOCAL_POSITION_SETPOINT')
                self._fieldnames = ['x', 'y', 'z', 'yaw']
                self.x = x
                self.y = y
                self.z = z
                self.yaw = yaw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 50, struct.pack('>ffff', self.x, self.y, self.z, self.yaw))

class MAVLink_control_status_message(MAVLink_message):
        '''

        '''
        def __init__(self, position_fix, vision_fix, gps_fix, ahrs_health, control_att, control_pos_xy, control_pos_z, control_pos_yaw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_CONTROL_STATUS, 'CONTROL_STATUS')
                self._fieldnames = ['position_fix', 'vision_fix', 'gps_fix', 'ahrs_health', 'control_att', 'control_pos_xy', 'control_pos_z', 'control_pos_yaw']
                self.position_fix = position_fix
                self.vision_fix = vision_fix
                self.gps_fix = gps_fix
                self.ahrs_health = ahrs_health
                self.control_att = control_att
                self.control_pos_xy = control_pos_xy
                self.control_pos_z = control_pos_z
                self.control_pos_yaw = control_pos_yaw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 157, struct.pack('>BBBBBBBB', self.position_fix, self.vision_fix, self.gps_fix, self.ahrs_health, self.control_att, self.control_pos_xy, self.control_pos_z, self.control_pos_yaw))

class MAVLink_safety_set_allowed_area_message(MAVLink_message):
        '''
        Set a safety zone (volume), which is defined by two corners of
        a cube. This message can be used to tell the MAV which
        setpoints/waypoints to accept and which to reject. Safety
        areas are often enforced by national or competition
        regulations.
        '''
        def __init__(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, 'SAFETY_SET_ALLOWED_AREA')
                self._fieldnames = ['target_system', 'target_component', 'frame', 'p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z']
                self.target_system = target_system
                self.target_component = target_component
                self.frame = frame
                self.p1x = p1x
                self.p1y = p1y
                self.p1z = p1z
                self.p2x = p2x
                self.p2y = p2y
                self.p2z = p2z

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 126, struct.pack('>BBBffffff', self.target_system, self.target_component, self.frame, self.p1x, self.p1y, self.p1z, self.p2x, self.p2y, self.p2z))

class MAVLink_safety_allowed_area_message(MAVLink_message):
        '''
        Read out the safety zone the MAV currently assumes.
        '''
        def __init__(self, frame, p1x, p1y, p1z, p2x, p2y, p2z):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, 'SAFETY_ALLOWED_AREA')
                self._fieldnames = ['frame', 'p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z']
                self.frame = frame
                self.p1x = p1x
                self.p1y = p1y
                self.p1z = p1z
                self.p2x = p2x
                self.p2y = p2y
                self.p2z = p2z

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 108, struct.pack('>Bffffff', self.frame, self.p1x, self.p1y, self.p1z, self.p2x, self.p2y, self.p2z))

class MAVLink_set_roll_pitch_yaw_thrust_message(MAVLink_message):
        '''
        Set roll, pitch and yaw.
        '''
        def __init__(self, target_system, target_component, roll, pitch, yaw, thrust):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, 'SET_ROLL_PITCH_YAW_THRUST')
                self._fieldnames = ['target_system', 'target_component', 'roll', 'pitch', 'yaw', 'thrust']
                self.target_system = target_system
                self.target_component = target_component
                self.roll = roll
                self.pitch = pitch
                self.yaw = yaw
                self.thrust = thrust

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 213, struct.pack('>BBffff', self.target_system, self.target_component, self.roll, self.pitch, self.yaw, self.thrust))

class MAVLink_set_roll_pitch_yaw_speed_thrust_message(MAVLink_message):
        '''
        Set roll, pitch and yaw.
        '''
        def __init__(self, target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, 'SET_ROLL_PITCH_YAW_SPEED_THRUST')
                self._fieldnames = ['target_system', 'target_component', 'roll_speed', 'pitch_speed', 'yaw_speed', 'thrust']
                self.target_system = target_system
                self.target_component = target_component
                self.roll_speed = roll_speed
                self.pitch_speed = pitch_speed
                self.yaw_speed = yaw_speed
                self.thrust = thrust

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 95, struct.pack('>BBffff', self.target_system, self.target_component, self.roll_speed, self.pitch_speed, self.yaw_speed, self.thrust))

class MAVLink_roll_pitch_yaw_thrust_setpoint_message(MAVLink_message):
        '''
        Setpoint in roll, pitch, yaw currently active on the system.
        '''
        def __init__(self, time_us, roll, pitch, yaw, thrust):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, 'ROLL_PITCH_YAW_THRUST_SETPOINT')
                self._fieldnames = ['time_us', 'roll', 'pitch', 'yaw', 'thrust']
                self.time_us = time_us
                self.roll = roll
                self.pitch = pitch
                self.yaw = yaw
                self.thrust = thrust

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 5, struct.pack('>Qffff', self.time_us, self.roll, self.pitch, self.yaw, self.thrust))

class MAVLink_roll_pitch_yaw_speed_thrust_setpoint_message(MAVLink_message):
        '''
        Setpoint in rollspeed, pitchspeed, yawspeed currently active
        on the system.
        '''
        def __init__(self, time_us, roll_speed, pitch_speed, yaw_speed, thrust):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, 'ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT')
                self._fieldnames = ['time_us', 'roll_speed', 'pitch_speed', 'yaw_speed', 'thrust']
                self.time_us = time_us
                self.roll_speed = roll_speed
                self.pitch_speed = pitch_speed
                self.yaw_speed = yaw_speed
                self.thrust = thrust

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 127, struct.pack('>Qffff', self.time_us, self.roll_speed, self.pitch_speed, self.yaw_speed, self.thrust))

class MAVLink_nav_controller_output_message(MAVLink_message):
        '''
        Outputs of the APM navigation controller. The primary use of
        this message is to check the response and signs of the
        controller before actual flight and to assist with tuning
        controller parameters
        '''
        def __init__(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, 'NAV_CONTROLLER_OUTPUT')
                self._fieldnames = ['nav_roll', 'nav_pitch', 'nav_bearing', 'target_bearing', 'wp_dist', 'alt_error', 'aspd_error', 'xtrack_error']
                self.nav_roll = nav_roll
                self.nav_pitch = nav_pitch
                self.nav_bearing = nav_bearing
                self.target_bearing = target_bearing
                self.wp_dist = wp_dist
                self.alt_error = alt_error
                self.aspd_error = aspd_error
                self.xtrack_error = xtrack_error

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 57, struct.pack('>ffhhHfff', self.nav_roll, self.nav_pitch, self.nav_bearing, self.target_bearing, self.wp_dist, self.alt_error, self.aspd_error, self.xtrack_error))

class MAVLink_position_target_message(MAVLink_message):
        '''
        The goal position of the system. This position is the input to
        any navigation or path planning algorithm and does NOT
        represent the current controller setpoint.
        '''
        def __init__(self, x, y, z, yaw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_POSITION_TARGET, 'POSITION_TARGET')
                self._fieldnames = ['x', 'y', 'z', 'yaw']
                self.x = x
                self.y = y
                self.z = z
                self.yaw = yaw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 126, struct.pack('>ffff', self.x, self.y, self.z, self.yaw))

class MAVLink_state_correction_message(MAVLink_message):
        '''
        Corrects the systems state by adding an error correction term
        to the position and velocity, and by rotating the attitude by
        a correction angle.
        '''
        def __init__(self, xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_STATE_CORRECTION, 'STATE_CORRECTION')
                self._fieldnames = ['xErr', 'yErr', 'zErr', 'rollErr', 'pitchErr', 'yawErr', 'vxErr', 'vyErr', 'vzErr']
                self.xErr = xErr
                self.yErr = yErr
                self.zErr = zErr
                self.rollErr = rollErr
                self.pitchErr = pitchErr
                self.yawErr = yawErr
                self.vxErr = vxErr
                self.vyErr = vyErr
                self.vzErr = vzErr

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 130, struct.pack('>fffffffff', self.xErr, self.yErr, self.zErr, self.rollErr, self.pitchErr, self.yawErr, self.vxErr, self.vyErr, self.vzErr))

class MAVLink_set_altitude_message(MAVLink_message):
        '''

        '''
        def __init__(self, target, mode):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_ALTITUDE, 'SET_ALTITUDE')
                self._fieldnames = ['target', 'mode']
                self.target = target
                self.mode = mode

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 119, struct.pack('>BI', self.target, self.mode))

class MAVLink_request_data_stream_message(MAVLink_message):
        '''

        '''
        def __init__(self, target_system, target_component, req_stream_id, req_message_rate, start_stop):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, 'REQUEST_DATA_STREAM')
                self._fieldnames = ['target_system', 'target_component', 'req_stream_id', 'req_message_rate', 'start_stop']
                self.target_system = target_system
                self.target_component = target_component
                self.req_stream_id = req_stream_id
                self.req_message_rate = req_message_rate
                self.start_stop = start_stop

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 193, struct.pack('>BBBHB', self.target_system, self.target_component, self.req_stream_id, self.req_message_rate, self.start_stop))

class MAVLink_hil_state_message(MAVLink_message):
        '''
        This packet is useful for high throughput
        applications such as hardware in the loop simulations.
        '''
        def __init__(self, usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_HIL_STATE, 'HIL_STATE')
                self._fieldnames = ['usec', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed', 'lat', 'lon', 'alt', 'vx', 'vy', 'vz', 'xacc', 'yacc', 'zacc']
                self.usec = usec
                self.roll = roll
                self.pitch = pitch
                self.yaw = yaw
                self.rollspeed = rollspeed
                self.pitchspeed = pitchspeed
                self.yawspeed = yawspeed
                self.lat = lat
                self.lon = lon
                self.alt = alt
                self.vx = vx
                self.vy = vy
                self.vz = vz
                self.xacc = xacc
                self.yacc = yacc
                self.zacc = zacc

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 191, struct.pack('>Qffffffiiihhhhhh', self.usec, self.roll, self.pitch, self.yaw, self.rollspeed, self.pitchspeed, self.yawspeed, self.lat, self.lon, self.alt, self.vx, self.vy, self.vz, self.xacc, self.yacc, self.zacc))

class MAVLink_hil_controls_message(MAVLink_message):
        '''
        Hardware in the loop control outputs
        '''
        def __init__(self, time_us, roll_ailerons, pitch_elevator, yaw_rudder, throttle, mode, nav_mode):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_HIL_CONTROLS, 'HIL_CONTROLS')
                self._fieldnames = ['time_us', 'roll_ailerons', 'pitch_elevator', 'yaw_rudder', 'throttle', 'mode', 'nav_mode']
                self.time_us = time_us
                self.roll_ailerons = roll_ailerons
                self.pitch_elevator = pitch_elevator
                self.yaw_rudder = yaw_rudder
                self.throttle = throttle
                self.mode = mode
                self.nav_mode = nav_mode

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 236, struct.pack('>QffffBB', self.time_us, self.roll_ailerons, self.pitch_elevator, self.yaw_rudder, self.throttle, self.mode, self.nav_mode))

class MAVLink_manual_control_message(MAVLink_message):
        '''

        '''
        def __init__(self, target, roll, pitch, yaw, thrust, roll_manual, pitch_manual, yaw_manual, thrust_manual):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_MANUAL_CONTROL, 'MANUAL_CONTROL')
                self._fieldnames = ['target', 'roll', 'pitch', 'yaw', 'thrust', 'roll_manual', 'pitch_manual', 'yaw_manual', 'thrust_manual']
                self.target = target
                self.roll = roll
                self.pitch = pitch
                self.yaw = yaw
                self.thrust = thrust
                self.roll_manual = roll_manual
                self.pitch_manual = pitch_manual
                self.yaw_manual = yaw_manual
                self.thrust_manual = thrust_manual

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 158, struct.pack('>BffffBBBB', self.target, self.roll, self.pitch, self.yaw, self.thrust, self.roll_manual, self.pitch_manual, self.yaw_manual, self.thrust_manual))

class MAVLink_rc_channels_override_message(MAVLink_message):
        '''
        The RAW values of the RC channels sent to the MAV to override
        info received from the RC radio. A value of -1 means no change
        to that channel. A value of 0 means control of that channel
        should be released back to the RC radio. The standard PPM
        modulation is as follows: 1000 microseconds: 0%, 2000
        microseconds: 100%. Individual receivers/transmitters might
        violate this specification.
        '''
        def __init__(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, 'RC_CHANNELS_OVERRIDE')
                self._fieldnames = ['target_system', 'target_component', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw']
                self.target_system = target_system
                self.target_component = target_component
                self.chan1_raw = chan1_raw
                self.chan2_raw = chan2_raw
                self.chan3_raw = chan3_raw
                self.chan4_raw = chan4_raw
                self.chan5_raw = chan5_raw
                self.chan6_raw = chan6_raw
                self.chan7_raw = chan7_raw
                self.chan8_raw = chan8_raw

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 143, struct.pack('>BBHHHHHHHH', self.target_system, self.target_component, self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw))

class MAVLink_global_position_int_message(MAVLink_message):
        '''
        The filtered global position (e.g. fused GPS and
        accelerometers). The position is in GPS-frame (right-handed,
        Z-up)
        '''
        def __init__(self, lat, lon, alt, vx, vy, vz):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, 'GLOBAL_POSITION_INT')
                self._fieldnames = ['lat', 'lon', 'alt', 'vx', 'vy', 'vz']
                self.lat = lat
                self.lon = lon
                self.alt = alt
                self.vx = vx
                self.vy = vy
                self.vz = vz

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 104, struct.pack('>iiihhh', self.lat, self.lon, self.alt, self.vx, self.vy, self.vz))

class MAVLink_vfr_hud_message(MAVLink_message):
        '''
        Metrics typically displayed on a HUD for fixed wing aircraft
        '''
        def __init__(self, airspeed, groundspeed, heading, throttle, alt, climb):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_VFR_HUD, 'VFR_HUD')
                self._fieldnames = ['airspeed', 'groundspeed', 'heading', 'throttle', 'alt', 'climb']
                self.airspeed = airspeed
                self.groundspeed = groundspeed
                self.heading = heading
                self.throttle = throttle
                self.alt = alt
                self.climb = climb

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 123, struct.pack('>ffhHff', self.airspeed, self.groundspeed, self.heading, self.throttle, self.alt, self.climb))

class MAVLink_command_message(MAVLink_message):
        '''
        Send a command with up to four parameters to the MAV
        '''
        def __init__(self, target_system, target_component, command, confirmation, param1, param2, param3, param4):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_COMMAND, 'COMMAND')
                self._fieldnames = ['target_system', 'target_component', 'command', 'confirmation', 'param1', 'param2', 'param3', 'param4']
                self.target_system = target_system
                self.target_component = target_component
                self.command = command
                self.confirmation = confirmation
                self.param1 = param1
                self.param2 = param2
                self.param3 = param3
                self.param4 = param4

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 131, struct.pack('>BBBBffff', self.target_system, self.target_component, self.command, self.confirmation, self.param1, self.param2, self.param3, self.param4))

class MAVLink_command_ack_message(MAVLink_message):
        '''
        Report status of a command. Includes feedback wether the
        command was executed
        '''
        def __init__(self, command, result):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_COMMAND_ACK, 'COMMAND_ACK')
                self._fieldnames = ['command', 'result']
                self.command = command
                self.result = result

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 8, struct.pack('>ff', self.command, self.result))

class MAVLink_optical_flow_message(MAVLink_message):
        '''
        Optical flow from a flow sensor (e.g. optical mouse sensor)
        '''
        def __init__(self, time, sensor_id, flow_x, flow_y, quality, ground_distance):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_OPTICAL_FLOW, 'OPTICAL_FLOW')
                self._fieldnames = ['time', 'sensor_id', 'flow_x', 'flow_y', 'quality', 'ground_distance']
                self.time = time
                self.sensor_id = sensor_id
                self.flow_x = flow_x
                self.flow_y = flow_y
                self.quality = quality
                self.ground_distance = ground_distance

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 174, struct.pack('>QBhhBf', self.time, self.sensor_id, self.flow_x, self.flow_y, self.quality, self.ground_distance))

class MAVLink_object_detection_event_message(MAVLink_message):
        '''
        Object has been detected
        '''
        def __init__(self, time, object_id, type, name, quality, bearing, distance):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT, 'OBJECT_DETECTION_EVENT')
                self._fieldnames = ['time', 'object_id', 'type', 'name', 'quality', 'bearing', 'distance']
                self.time = time
                self.object_id = object_id
                self.type = type
                self.name = name
                self.quality = quality
                self.bearing = bearing
                self.distance = distance

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 155, struct.pack('>IHB20sBff', self.time, self.object_id, self.type, self.name, self.quality, self.bearing, self.distance))

class MAVLink_debug_vect_message(MAVLink_message):
        '''

        '''
        def __init__(self, name, usec, x, y, z):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_DEBUG_VECT, 'DEBUG_VECT')
                self._fieldnames = ['name', 'usec', 'x', 'y', 'z']
                self.name = name
                self.usec = usec
                self.x = x
                self.y = y
                self.z = z

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 178, struct.pack('>10sQfff', self.name, self.usec, self.x, self.y, self.z))

class MAVLink_named_value_float_message(MAVLink_message):
        '''
        Send a key-value pair as float. The use of this message is
        discouraged for normal packets, but a quite efficient way for
        testing new messages and getting experimental debug output.
        '''
        def __init__(self, name, value):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, 'NAMED_VALUE_FLOAT')
                self._fieldnames = ['name', 'value']
                self.name = name
                self.value = value

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 224, struct.pack('>10sf', self.name, self.value))

class MAVLink_named_value_int_message(MAVLink_message):
        '''
        Send a key-value pair as integer. The use of this message is
        discouraged for normal packets, but a quite efficient way for
        testing new messages and getting experimental debug output.
        '''
        def __init__(self, name, value):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_NAMED_VALUE_INT, 'NAMED_VALUE_INT')
                self._fieldnames = ['name', 'value']
                self.name = name
                self.value = value

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 60, struct.pack('>10si', self.name, self.value))

class MAVLink_statustext_message(MAVLink_message):
        '''
        Status text message. These messages are printed in yellow in
        the COMM console of QGroundControl. WARNING: They consume
        quite some bandwidth, so use only for important status and
        error messages. If implemented wisely, these messages are
        buffered on the MCU and sent only at a limited rate (e.g. 10
        Hz).
        '''
        def __init__(self, severity, text):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_STATUSTEXT, 'STATUSTEXT')
                self._fieldnames = ['severity', 'text']
                self.severity = severity
                self.text = text

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 106, struct.pack('>B50s', self.severity, self.text))

class MAVLink_debug_message(MAVLink_message):
        '''
        Send a debug value. The index is used to discriminate between
        values. These values show up in the plot of QGroundControl as
        DEBUG N.
        '''
        def __init__(self, ind, value):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_DEBUG, 'DEBUG')
                self._fieldnames = ['ind', 'value']
                self.ind = ind
                self.value = value

        def pack(self, mav):
                return MAVLink_message.pack(self, mav, 7, struct.pack('>Bf', self.ind, self.value))


mavlink_map = {
        MAVLINK_MSG_ID_SENSOR_OFFSETS : ( '>hhhfiiffffff', MAVLink_sensor_offsets_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 143 ),
        MAVLINK_MSG_ID_SET_MAG_OFFSETS : ( '>BBhhh', MAVLink_set_mag_offsets_message, [0, 1, 2, 3, 4], 29 ),
        MAVLINK_MSG_ID_MEMINFO : ( '>HH', MAVLink_meminfo_message, [0, 1], 208 ),
        MAVLINK_MSG_ID_AP_ADC : ( '>HHHHHH', MAVLink_ap_adc_message, [0, 1, 2, 3, 4, 5], 188 ),
        MAVLINK_MSG_ID_DIGICAM_CONFIGURE : ( '>BBBHBBBBBBf', MAVLink_digicam_configure_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 118 ),
        MAVLINK_MSG_ID_DIGICAM_CONTROL : ( '>BBBBbBBBBf', MAVLink_digicam_control_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 242 ),
        MAVLINK_MSG_ID_MOUNT_CONFIGURE : ( '>BBBBBB', MAVLink_mount_configure_message, [0, 1, 2, 3, 4, 5], 19 ),
        MAVLINK_MSG_ID_MOUNT_CONTROL : ( '>BBiiiB', MAVLink_mount_control_message, [0, 1, 2, 3, 4, 5], 97 ),
        MAVLINK_MSG_ID_MOUNT_STATUS : ( '>BBiii', MAVLink_mount_status_message, [0, 1, 2, 3, 4], 233 ),
        MAVLINK_MSG_ID_FENCE_POINT : ( '>BBBBff', MAVLink_fence_point_message, [0, 1, 2, 3, 4, 5], 18 ),
        MAVLINK_MSG_ID_FENCE_FETCH_POINT : ( '>BBB', MAVLink_fence_fetch_point_message, [0, 1, 2], 68 ),
        MAVLINK_MSG_ID_FENCE_STATUS : ( '>BHBI', MAVLink_fence_status_message, [0, 1, 2, 3], 136 ),
        MAVLINK_MSG_ID_AHRS : ( '>fffffff', MAVLink_ahrs_message, [0, 1, 2, 3, 4, 5, 6], 127 ),
        MAVLINK_MSG_ID_SIMSTATE : ( '>fffffffff', MAVLink_simstate_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 42 ),
        MAVLINK_MSG_ID_HWSTATUS : ( '>HB', MAVLink_hwstatus_message, [0, 1], 21 ),
        MAVLINK_MSG_ID_RADIO : ( '>BBBBBHH', MAVLink_radio_message, [0, 1, 2, 3, 4, 5, 6], 93 ),
        MAVLINK_MSG_ID_HEARTBEAT : ( '>BBB', MAVLink_heartbeat_message, [0, 1, 2], 72 ),
        MAVLINK_MSG_ID_BOOT : ( '>I', MAVLink_boot_message, [0], 39 ),
        MAVLINK_MSG_ID_SYSTEM_TIME : ( '>Q', MAVLink_system_time_message, [0], 190 ),
        MAVLINK_MSG_ID_PING : ( '>IBBQ', MAVLink_ping_message, [0, 1, 2, 3], 92 ),
        MAVLINK_MSG_ID_SYSTEM_TIME_UTC : ( '>II', MAVLink_system_time_utc_message, [0, 1], 191 ),
        MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL : ( '>BBB25s', MAVLink_change_operator_control_message, [0, 1, 2, 3], 217 ),
        MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK : ( '>BBB', MAVLink_change_operator_control_ack_message, [0, 1, 2], 104 ),
        MAVLINK_MSG_ID_AUTH_KEY : ( '>32s', MAVLink_auth_key_message, [0], 119 ),
        MAVLINK_MSG_ID_ACTION_ACK : ( '>BB', MAVLink_action_ack_message, [0, 1], 219 ),
        MAVLINK_MSG_ID_ACTION : ( '>BBB', MAVLink_action_message, [0, 1, 2], 60 ),
        MAVLINK_MSG_ID_SET_MODE : ( '>BB', MAVLink_set_mode_message, [0, 1], 186 ),
        MAVLINK_MSG_ID_SET_NAV_MODE : ( '>BB', MAVLink_set_nav_mode_message, [0, 1], 10 ),
        MAVLINK_MSG_ID_PARAM_REQUEST_READ : ( '>BB15sh', MAVLink_param_request_read_message, [0, 1, 2, 3], 89 ),
        MAVLINK_MSG_ID_PARAM_REQUEST_LIST : ( '>BB', MAVLink_param_request_list_message, [0, 1], 159 ),
        MAVLINK_MSG_ID_PARAM_VALUE : ( '>15sfHH', MAVLink_param_value_message, [0, 1, 2, 3], 162 ),
        MAVLINK_MSG_ID_PARAM_SET : ( '>BB15sf', MAVLink_param_set_message, [0, 1, 2, 3], 121 ),
        MAVLINK_MSG_ID_GPS_RAW_INT : ( '>QBiiiffff', MAVLink_gps_raw_int_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 149 ),
        MAVLINK_MSG_ID_SCALED_IMU : ( '>Qhhhhhhhhh', MAVLink_scaled_imu_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 222 ),
        MAVLINK_MSG_ID_GPS_STATUS : ( '>B20s20s20s20s20s', MAVLink_gps_status_message, [0, 1, 2, 3, 4, 5], 110 ),
        MAVLINK_MSG_ID_RAW_IMU : ( '>Qhhhhhhhhh', MAVLink_raw_imu_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 179 ),
        MAVLINK_MSG_ID_RAW_PRESSURE : ( '>Qhhhh', MAVLink_raw_pressure_message, [0, 1, 2, 3, 4], 136 ),
        MAVLINK_MSG_ID_SCALED_PRESSURE : ( '>Qffh', MAVLink_scaled_pressure_message, [0, 1, 2, 3], 229 ),
        MAVLINK_MSG_ID_ATTITUDE : ( '>Qffffff', MAVLink_attitude_message, [0, 1, 2, 3, 4, 5, 6], 66 ),
        MAVLINK_MSG_ID_LOCAL_POSITION : ( '>Qffffff', MAVLink_local_position_message, [0, 1, 2, 3, 4, 5, 6], 126 ),
        MAVLINK_MSG_ID_GLOBAL_POSITION : ( '>Qffffff', MAVLink_global_position_message, [0, 1, 2, 3, 4, 5, 6], 147 ),
        MAVLINK_MSG_ID_GPS_RAW : ( '>QBfffffff', MAVLink_gps_raw_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 185 ),
        MAVLINK_MSG_ID_SYS_STATUS : ( '>BBBHHHH', MAVLink_sys_status_message, [0, 1, 2, 3, 4, 5, 6], 112 ),
        MAVLINK_MSG_ID_RC_CHANNELS_RAW : ( '>HHHHHHHHB', MAVLink_rc_channels_raw_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 252 ),
        MAVLINK_MSG_ID_RC_CHANNELS_SCALED : ( '>hhhhhhhhB', MAVLink_rc_channels_scaled_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 162 ),
        MAVLINK_MSG_ID_SERVO_OUTPUT_RAW : ( '>HHHHHHHH', MAVLink_servo_output_raw_message, [0, 1, 2, 3, 4, 5, 6, 7], 215 ),
        MAVLINK_MSG_ID_WAYPOINT : ( '>BBHBBBBfffffff', MAVLink_waypoint_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 128 ),
        MAVLINK_MSG_ID_WAYPOINT_REQUEST : ( '>BBH', MAVLink_waypoint_request_message, [0, 1, 2], 9 ),
        MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT : ( '>BBH', MAVLink_waypoint_set_current_message, [0, 1, 2], 106 ),
        MAVLINK_MSG_ID_WAYPOINT_CURRENT : ( '>H', MAVLink_waypoint_current_message, [0], 101 ),
        MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST : ( '>BB', MAVLink_waypoint_request_list_message, [0, 1], 213 ),
        MAVLINK_MSG_ID_WAYPOINT_COUNT : ( '>BBH', MAVLink_waypoint_count_message, [0, 1, 2], 4 ),
        MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL : ( '>BB', MAVLink_waypoint_clear_all_message, [0, 1], 229 ),
        MAVLINK_MSG_ID_WAYPOINT_REACHED : ( '>H', MAVLink_waypoint_reached_message, [0], 21 ),
        MAVLINK_MSG_ID_WAYPOINT_ACK : ( '>BBB', MAVLink_waypoint_ack_message, [0, 1, 2], 214 ),
        MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN : ( '>BBiii', MAVLink_gps_set_global_origin_message, [0, 1, 2, 3, 4], 215 ),
        MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET : ( '>iii', MAVLink_gps_local_origin_set_message, [0, 1, 2], 14 ),
        MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET : ( '>BBffff', MAVLink_local_position_setpoint_set_message, [0, 1, 2, 3, 4, 5], 206 ),
        MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT : ( '>ffff', MAVLink_local_position_setpoint_message, [0, 1, 2, 3], 50 ),
        MAVLINK_MSG_ID_CONTROL_STATUS : ( '>BBBBBBBB', MAVLink_control_status_message, [0, 1, 2, 3, 4, 5, 6, 7], 157 ),
        MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA : ( '>BBBffffff', MAVLink_safety_set_allowed_area_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 126 ),
        MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA : ( '>Bffffff', MAVLink_safety_allowed_area_message, [0, 1, 2, 3, 4, 5, 6], 108 ),
        MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST : ( '>BBffff', MAVLink_set_roll_pitch_yaw_thrust_message, [0, 1, 2, 3, 4, 5], 213 ),
        MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST : ( '>BBffff', MAVLink_set_roll_pitch_yaw_speed_thrust_message, [0, 1, 2, 3, 4, 5], 95 ),
        MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT : ( '>Qffff', MAVLink_roll_pitch_yaw_thrust_setpoint_message, [0, 1, 2, 3, 4], 5 ),
        MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT : ( '>Qffff', MAVLink_roll_pitch_yaw_speed_thrust_setpoint_message, [0, 1, 2, 3, 4], 127 ),
        MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT : ( '>ffhhHfff', MAVLink_nav_controller_output_message, [0, 1, 2, 3, 4, 5, 6, 7], 57 ),
        MAVLINK_MSG_ID_POSITION_TARGET : ( '>ffff', MAVLink_position_target_message, [0, 1, 2, 3], 126 ),
        MAVLINK_MSG_ID_STATE_CORRECTION : ( '>fffffffff', MAVLink_state_correction_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 130 ),
        MAVLINK_MSG_ID_SET_ALTITUDE : ( '>BI', MAVLink_set_altitude_message, [0, 1], 119 ),
        MAVLINK_MSG_ID_REQUEST_DATA_STREAM : ( '>BBBHB', MAVLink_request_data_stream_message, [0, 1, 2, 3, 4], 193 ),
        MAVLINK_MSG_ID_HIL_STATE : ( '>Qffffffiiihhhhhh', MAVLink_hil_state_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 191 ),
        MAVLINK_MSG_ID_HIL_CONTROLS : ( '>QffffBB', MAVLink_hil_controls_message, [0, 1, 2, 3, 4, 5, 6], 236 ),
        MAVLINK_MSG_ID_MANUAL_CONTROL : ( '>BffffBBBB', MAVLink_manual_control_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 158 ),
        MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE : ( '>BBHHHHHHHH', MAVLink_rc_channels_override_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 143 ),
        MAVLINK_MSG_ID_GLOBAL_POSITION_INT : ( '>iiihhh', MAVLink_global_position_int_message, [0, 1, 2, 3, 4, 5], 104 ),
        MAVLINK_MSG_ID_VFR_HUD : ( '>ffhHff', MAVLink_vfr_hud_message, [0, 1, 2, 3, 4, 5], 123 ),
        MAVLINK_MSG_ID_COMMAND : ( '>BBBBffff', MAVLink_command_message, [0, 1, 2, 3, 4, 5, 6, 7], 131 ),
        MAVLINK_MSG_ID_COMMAND_ACK : ( '>ff', MAVLink_command_ack_message, [0, 1], 8 ),
        MAVLINK_MSG_ID_OPTICAL_FLOW : ( '>QBhhBf', MAVLink_optical_flow_message, [0, 1, 2, 3, 4, 5], 174 ),
        MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT : ( '>IHB20sBff', MAVLink_object_detection_event_message, [0, 1, 2, 3, 4, 5, 6], 155 ),
        MAVLINK_MSG_ID_DEBUG_VECT : ( '>10sQfff', MAVLink_debug_vect_message, [0, 1, 2, 3, 4], 178 ),
        MAVLINK_MSG_ID_NAMED_VALUE_FLOAT : ( '>10sf', MAVLink_named_value_float_message, [0, 1], 224 ),
        MAVLINK_MSG_ID_NAMED_VALUE_INT : ( '>10si', MAVLink_named_value_int_message, [0, 1], 60 ),
        MAVLINK_MSG_ID_STATUSTEXT : ( '>B50s', MAVLink_statustext_message, [0, 1], 106 ),
        MAVLINK_MSG_ID_DEBUG : ( '>Bf', MAVLink_debug_message, [0, 1], 7 ),
}

class MAVError(Exception):
        '''MAVLink error class'''
        def __init__(self, msg):
            Exception.__init__(self, msg)
            self.message = msg

class MAVString(str):
        '''NUL terminated string'''
        def __init__(self, s):
                str.__init__(self)
        def __str__(self):
            i = self.find(chr(0))
            if i == -1:
                return self[:]
            return self[0:i]

class MAVLink_bad_data(MAVLink_message):
        '''
        a piece of bad data in a mavlink stream
        '''
        def __init__(self, data, reason):
                MAVLink_message.__init__(self, MAVLINK_MSG_ID_BAD_DATA, 'BAD_DATA')
                self._fieldnames = ['data', 'reason']
                self.data = data
                self.reason = reason
                self._msgbuf = data
            
class MAVLink(object):
        '''MAVLink protocol handling class'''
        def __init__(self, file, srcSystem=0, srcComponent=0):
                self.seq = 0
                self.file = file
                self.srcSystem = srcSystem
                self.srcComponent = srcComponent
                self.callback = None
                self.callback_args = None
                self.callback_kwargs = None
                self.buf = array.array('B')
                self.expected_length = 6
                self.have_prefix_error = False
                self.robust_parsing = False
                self.protocol_marker = 85
                self.little_endian = False
                self.crc_extra = False
                self.sort_fields = False
                self.total_packets_sent = 0
                self.total_bytes_sent = 0
                self.total_packets_received = 0
                self.total_bytes_received = 0
                self.total_receive_errors = 0
                self.startup_time = time.time()

        def set_callback(self, callback, *args, **kwargs):
            self.callback = callback
            self.callback_args = args
            self.callback_kwargs = kwargs
            
        def send(self, mavmsg):
                '''send a MAVLink message'''
                buf = mavmsg.pack(self)
                self.file.write(buf)
                self.seq = (self.seq + 1) % 255
                self.total_packets_sent += 1
                self.total_bytes_sent += len(buf)

        def bytes_needed(self):
            '''return number of bytes needed for next parsing stage'''
            ret = self.expected_length - len(self.buf)
            if ret <= 0:
                return 1
            return ret

        def parse_char(self, c):
            '''input some data bytes, possibly returning a new message'''
            if isinstance(c, str):
                self.buf.fromstring(c)
            else:
                self.buf.extend(c)
            self.total_bytes_received += len(c)
            if len(self.buf) >= 1 and self.buf[0] != 85:
                magic = self.buf[0]
                self.buf = self.buf[1:]
                if self.robust_parsing:
                    m = MAVLink_bad_data(chr(magic), "Bad prefix")
                    if self.callback:
                        self.callback(m, *self.callback_args, **self.callback_kwargs)
                    self.expected_length = 6
                    self.total_receive_errors += 1
                    return m
                if self.have_prefix_error:
                    return None
                self.have_prefix_error = True
                self.total_receive_errors += 1
                raise MAVError("invalid MAVLink prefix '%s'" % magic) 
            self.have_prefix_error = False
            if len(self.buf) >= 2:
                (magic, self.expected_length) = struct.unpack('BB', self.buf[0:2])
                self.expected_length += 8
            if self.expected_length >= 8 and len(self.buf) >= self.expected_length:
                mbuf = self.buf[0:self.expected_length]
                self.buf = self.buf[self.expected_length:]
                self.expected_length = 6
                if self.robust_parsing:
                    try:
                        m = self.decode(mbuf)
                        self.total_packets_received += 1
                    except MAVError as reason:
                        m = MAVLink_bad_data(mbuf, reason.message)
                        self.total_receive_errors += 1
                else:
                    m = self.decode(mbuf)
                    self.total_packets_received += 1
                if self.callback:
                    self.callback(m, *self.callback_args, **self.callback_kwargs)
                return m
            return None

        def parse_buffer(self, s):
            '''input some data bytes, possibly returning a list of new messages'''
            m = self.parse_char(s)
            if m is None:
                return None
            ret = [m]
            while True:
                m = self.parse_char("")
                if m is None:
                    return ret
                ret.append(m)
            return ret

        def decode(self, msgbuf):
                '''decode a buffer as a MAVLink message'''
                # decode the header
                try:
                    magic, mlen, seq, srcSystem, srcComponent, msgId = struct.unpack('cBBBBB', msgbuf[:6])
                except struct.error as emsg:
                    raise MAVError('Unable to unpack MAVLink header: %s' % emsg)
                if ord(magic) != 85:
                    raise MAVError("invalid MAVLink prefix '%s'" % magic)
                if mlen != len(msgbuf)-8:
                    raise MAVError('invalid MAVLink message length. Got %u expected %u, msgId=%u' % (len(msgbuf)-8, mlen, msgId))

                if not msgId in mavlink_map:
                    raise MAVError('unknown MAVLink message ID %u' % msgId)

                # decode the payload
                (fmt, type, order_map, crc_extra) = mavlink_map[msgId]

                # decode the checksum
                try:
                    crc, = struct.unpack('<H', msgbuf[-2:])
                except struct.error as emsg:
                    raise MAVError('Unable to unpack MAVLink CRC: %s' % emsg)
                crc2 = mavutil.x25crc(msgbuf[1:-2])
                if False: # using CRC extra 
                    crc2.accumulate(chr(crc_extra))
                if crc != crc2.crc:
                    raise MAVError('invalid MAVLink CRC in msgID %u 0x%04x should be 0x%04x' % (msgId, crc, crc2.crc))

                try:
                    t = struct.unpack(fmt, msgbuf[6:-2])
                except struct.error as emsg:
                    raise MAVError('Unable to unpack MAVLink payload type=%s fmt=%s payloadLength=%u: %s' % (
                        type, fmt, len(msgbuf[6:-2]), emsg))

                tlist = list(t)
                # handle sorted fields
                if False:
                    t = tlist[:]
                    for i in range(0, len(tlist)):
                        tlist[i] = t[order_map[i]]

                # terminate any strings
                for i in range(0, len(tlist)):
                    if isinstance(tlist[i], str):
                        tlist[i] = MAVString(tlist[i])
                t = tuple(tlist)
                # construct the message object
                try:
                    m = type(*t)
                except Exception as emsg:
                    raise MAVError('Unable to instantiate MAVLink message of type %s : %s' % (type, emsg))
                m._msgbuf = msgbuf
                m._payload = msgbuf[6:-2]
                m._crc = crc
                m._header = MAVLink_header(msgId, mlen, seq, srcSystem, srcComponent)
                return m
        def sensor_offsets_encode(self, mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z):
                '''
                Offsets and calibrations values for hardware         sensors. This
                makes it easier to debug the calibration process.

                mag_ofs_x                 : magnetometer X offset (int16_t)
                mag_ofs_y                 : magnetometer Y offset (int16_t)
                mag_ofs_z                 : magnetometer Z offset (int16_t)
                mag_declination           : magnetic declination (radians) (float)
                raw_press                 : raw pressure from barometer (int32_t)
                raw_temp                  : raw temperature from barometer (int32_t)
                gyro_cal_x                : gyro X calibration (float)
                gyro_cal_y                : gyro Y calibration (float)
                gyro_cal_z                : gyro Z calibration (float)
                accel_cal_x               : accel X calibration (float)
                accel_cal_y               : accel Y calibration (float)
                accel_cal_z               : accel Z calibration (float)

                '''
                msg = MAVLink_sensor_offsets_message(mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z)
                msg.pack(self)
                return msg
            
        def sensor_offsets_send(self, mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z):
                '''
                Offsets and calibrations values for hardware         sensors. This
                makes it easier to debug the calibration process.

                mag_ofs_x                 : magnetometer X offset (int16_t)
                mag_ofs_y                 : magnetometer Y offset (int16_t)
                mag_ofs_z                 : magnetometer Z offset (int16_t)
                mag_declination           : magnetic declination (radians) (float)
                raw_press                 : raw pressure from barometer (int32_t)
                raw_temp                  : raw temperature from barometer (int32_t)
                gyro_cal_x                : gyro X calibration (float)
                gyro_cal_y                : gyro Y calibration (float)
                gyro_cal_z                : gyro Z calibration (float)
                accel_cal_x               : accel X calibration (float)
                accel_cal_y               : accel Y calibration (float)
                accel_cal_z               : accel Z calibration (float)

                '''
                return self.send(self.sensor_offsets_encode(mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z))
            
        def set_mag_offsets_encode(self, target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z):
                '''
                set the magnetometer offsets

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                mag_ofs_x                 : magnetometer X offset (int16_t)
                mag_ofs_y                 : magnetometer Y offset (int16_t)
                mag_ofs_z                 : magnetometer Z offset (int16_t)

                '''
                msg = MAVLink_set_mag_offsets_message(target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z)
                msg.pack(self)
                return msg
            
        def set_mag_offsets_send(self, target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z):
                '''
                set the magnetometer offsets

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                mag_ofs_x                 : magnetometer X offset (int16_t)
                mag_ofs_y                 : magnetometer Y offset (int16_t)
                mag_ofs_z                 : magnetometer Z offset (int16_t)

                '''
                return self.send(self.set_mag_offsets_encode(target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z))
            
        def meminfo_encode(self, brkval, freemem):
                '''
                state of APM memory

                brkval                    : heap top (uint16_t)
                freemem                   : free memory (uint16_t)

                '''
                msg = MAVLink_meminfo_message(brkval, freemem)
                msg.pack(self)
                return msg
            
        def meminfo_send(self, brkval, freemem):
                '''
                state of APM memory

                brkval                    : heap top (uint16_t)
                freemem                   : free memory (uint16_t)

                '''
                return self.send(self.meminfo_encode(brkval, freemem))
            
        def ap_adc_encode(self, adc1, adc2, adc3, adc4, adc5, adc6):
                '''
                raw ADC output

                adc1                      : ADC output 1 (uint16_t)
                adc2                      : ADC output 2 (uint16_t)
                adc3                      : ADC output 3 (uint16_t)
                adc4                      : ADC output 4 (uint16_t)
                adc5                      : ADC output 5 (uint16_t)
                adc6                      : ADC output 6 (uint16_t)

                '''
                msg = MAVLink_ap_adc_message(adc1, adc2, adc3, adc4, adc5, adc6)
                msg.pack(self)
                return msg
            
        def ap_adc_send(self, adc1, adc2, adc3, adc4, adc5, adc6):
                '''
                raw ADC output

                adc1                      : ADC output 1 (uint16_t)
                adc2                      : ADC output 2 (uint16_t)
                adc3                      : ADC output 3 (uint16_t)
                adc4                      : ADC output 4 (uint16_t)
                adc5                      : ADC output 5 (uint16_t)
                adc6                      : ADC output 6 (uint16_t)

                '''
                return self.send(self.ap_adc_encode(adc1, adc2, adc3, adc4, adc5, adc6))
            
        def digicam_configure_encode(self, target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value):
                '''
                Configure on-board Camera Control System.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                mode                      : Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) (uint8_t)
                shutter_speed             : Divisor number //e.g. 1000 means 1/1000 (0 means ignore) (uint16_t)
                aperture                  : F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) (uint8_t)
                iso                       : ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) (uint8_t)
                exposure_type             : Exposure type enumeration from 1 to N (0 means ignore) (uint8_t)
                command_id                : Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once (uint8_t)
                engine_cut_off            : Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) (uint8_t)
                extra_param               : Extra parameters enumeration (0 means ignore) (uint8_t)
                extra_value               : Correspondent value to given extra_param (float)

                '''
                msg = MAVLink_digicam_configure_message(target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value)
                msg.pack(self)
                return msg
            
        def digicam_configure_send(self, target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value):
                '''
                Configure on-board Camera Control System.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                mode                      : Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) (uint8_t)
                shutter_speed             : Divisor number //e.g. 1000 means 1/1000 (0 means ignore) (uint16_t)
                aperture                  : F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) (uint8_t)
                iso                       : ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) (uint8_t)
                exposure_type             : Exposure type enumeration from 1 to N (0 means ignore) (uint8_t)
                command_id                : Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once (uint8_t)
                engine_cut_off            : Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) (uint8_t)
                extra_param               : Extra parameters enumeration (0 means ignore) (uint8_t)
                extra_value               : Correspondent value to given extra_param (float)

                '''
                return self.send(self.digicam_configure_encode(target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value))
            
        def digicam_control_encode(self, target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value):
                '''
                Control on-board Camera Control System to take shots.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                session                   : 0: stop, 1: start or keep it up //Session control e.g. show/hide lens (uint8_t)
                zoom_pos                  : 1 to N //Zoom's absolute position (0 means ignore) (uint8_t)
                zoom_step                 : -100 to 100 //Zooming step value to offset zoom from the current position (int8_t)
                focus_lock                : 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus (uint8_t)
                shot                      : 0: ignore, 1: shot or start filming (uint8_t)
                command_id                : Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once (uint8_t)
                extra_param               : Extra parameters enumeration (0 means ignore) (uint8_t)
                extra_value               : Correspondent value to given extra_param (float)

                '''
                msg = MAVLink_digicam_control_message(target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value)
                msg.pack(self)
                return msg
            
        def digicam_control_send(self, target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value):
                '''
                Control on-board Camera Control System to take shots.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                session                   : 0: stop, 1: start or keep it up //Session control e.g. show/hide lens (uint8_t)
                zoom_pos                  : 1 to N //Zoom's absolute position (0 means ignore) (uint8_t)
                zoom_step                 : -100 to 100 //Zooming step value to offset zoom from the current position (int8_t)
                focus_lock                : 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus (uint8_t)
                shot                      : 0: ignore, 1: shot or start filming (uint8_t)
                command_id                : Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once (uint8_t)
                extra_param               : Extra parameters enumeration (0 means ignore) (uint8_t)
                extra_value               : Correspondent value to given extra_param (float)

                '''
                return self.send(self.digicam_control_encode(target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value))
            
        def mount_configure_encode(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw):
                '''
                Message to configure a camera mount, directional antenna, etc.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                mount_mode                : mount operating mode (see MAV_MOUNT_MODE enum) (uint8_t)
                stab_roll                 : (1 = yes, 0 = no) (uint8_t)
                stab_pitch                : (1 = yes, 0 = no) (uint8_t)
                stab_yaw                  : (1 = yes, 0 = no) (uint8_t)

                '''
                msg = MAVLink_mount_configure_message(target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw)
                msg.pack(self)
                return msg
            
        def mount_configure_send(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw):
                '''
                Message to configure a camera mount, directional antenna, etc.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                mount_mode                : mount operating mode (see MAV_MOUNT_MODE enum) (uint8_t)
                stab_roll                 : (1 = yes, 0 = no) (uint8_t)
                stab_pitch                : (1 = yes, 0 = no) (uint8_t)
                stab_yaw                  : (1 = yes, 0 = no) (uint8_t)

                '''
                return self.send(self.mount_configure_encode(target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw))
            
        def mount_control_encode(self, target_system, target_component, input_a, input_b, input_c, save_position):
                '''
                Message to control a camera mount, directional antenna, etc.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                input_a                   : pitch(deg*100) or lat, depending on mount mode (int32_t)
                input_b                   : roll(deg*100) or lon depending on mount mode (int32_t)
                input_c                   : yaw(deg*100) or alt (in cm) depending on mount mode (int32_t)
                save_position             : if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) (uint8_t)

                '''
                msg = MAVLink_mount_control_message(target_system, target_component, input_a, input_b, input_c, save_position)
                msg.pack(self)
                return msg
            
        def mount_control_send(self, target_system, target_component, input_a, input_b, input_c, save_position):
                '''
                Message to control a camera mount, directional antenna, etc.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                input_a                   : pitch(deg*100) or lat, depending on mount mode (int32_t)
                input_b                   : roll(deg*100) or lon depending on mount mode (int32_t)
                input_c                   : yaw(deg*100) or alt (in cm) depending on mount mode (int32_t)
                save_position             : if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) (uint8_t)

                '''
                return self.send(self.mount_control_encode(target_system, target_component, input_a, input_b, input_c, save_position))
            
        def mount_status_encode(self, target_system, target_component, pointing_a, pointing_b, pointing_c):
                '''
                Message with some status from APM to GCS about camera or antenna mount

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                pointing_a                : pitch(deg*100) or lat, depending on mount mode (int32_t)
                pointing_b                : roll(deg*100) or lon depending on mount mode (int32_t)
                pointing_c                : yaw(deg*100) or alt (in cm) depending on mount mode (int32_t)

                '''
                msg = MAVLink_mount_status_message(target_system, target_component, pointing_a, pointing_b, pointing_c)
                msg.pack(self)
                return msg
            
        def mount_status_send(self, target_system, target_component, pointing_a, pointing_b, pointing_c):
                '''
                Message with some status from APM to GCS about camera or antenna mount

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                pointing_a                : pitch(deg*100) or lat, depending on mount mode (int32_t)
                pointing_b                : roll(deg*100) or lon depending on mount mode (int32_t)
                pointing_c                : yaw(deg*100) or alt (in cm) depending on mount mode (int32_t)

                '''
                return self.send(self.mount_status_encode(target_system, target_component, pointing_a, pointing_b, pointing_c))
            
        def fence_point_encode(self, target_system, target_component, idx, count, lat, lng):
                '''
                A fence point. Used to set a point when from               GCS -> MAV.
                Also used to return a point from MAV -> GCS

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                idx                       : point index (first point is 1, 0 is for return point) (uint8_t)
                count                     : total number of points (for sanity checking) (uint8_t)
                lat                       : Latitude of point (float)
                lng                       : Longitude of point (float)

                '''
                msg = MAVLink_fence_point_message(target_system, target_component, idx, count, lat, lng)
                msg.pack(self)
                return msg
            
        def fence_point_send(self, target_system, target_component, idx, count, lat, lng):
                '''
                A fence point. Used to set a point when from               GCS -> MAV.
                Also used to return a point from MAV -> GCS

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                idx                       : point index (first point is 1, 0 is for return point) (uint8_t)
                count                     : total number of points (for sanity checking) (uint8_t)
                lat                       : Latitude of point (float)
                lng                       : Longitude of point (float)

                '''
                return self.send(self.fence_point_encode(target_system, target_component, idx, count, lat, lng))
            
        def fence_fetch_point_encode(self, target_system, target_component, idx):
                '''
                Request a current fence point from MAV

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                idx                       : point index (first point is 1, 0 is for return point) (uint8_t)

                '''
                msg = MAVLink_fence_fetch_point_message(target_system, target_component, idx)
                msg.pack(self)
                return msg
            
        def fence_fetch_point_send(self, target_system, target_component, idx):
                '''
                Request a current fence point from MAV

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                idx                       : point index (first point is 1, 0 is for return point) (uint8_t)

                '''
                return self.send(self.fence_fetch_point_encode(target_system, target_component, idx))
            
        def fence_status_encode(self, breach_status, breach_count, breach_type, breach_time):
                '''
                Status of geo-fencing. Sent in extended             status stream when
                fencing enabled

                breach_status             : 0 if currently inside fence, 1 if outside (uint8_t)
                breach_count              : number of fence breaches (uint16_t)
                breach_type               : last breach type (see FENCE_BREACH_* enum) (uint8_t)
                breach_time               : time of last breach in milliseconds since boot (uint32_t)

                '''
                msg = MAVLink_fence_status_message(breach_status, breach_count, breach_type, breach_time)
                msg.pack(self)
                return msg
            
        def fence_status_send(self, breach_status, breach_count, breach_type, breach_time):
                '''
                Status of geo-fencing. Sent in extended             status stream when
                fencing enabled

                breach_status             : 0 if currently inside fence, 1 if outside (uint8_t)
                breach_count              : number of fence breaches (uint16_t)
                breach_type               : last breach type (see FENCE_BREACH_* enum) (uint8_t)
                breach_time               : time of last breach in milliseconds since boot (uint32_t)

                '''
                return self.send(self.fence_status_encode(breach_status, breach_count, breach_type, breach_time))
            
        def ahrs_encode(self, omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw):
                '''
                Status of DCM attitude estimator

                omegaIx                   : X gyro drift estimate rad/s (float)
                omegaIy                   : Y gyro drift estimate rad/s (float)
                omegaIz                   : Z gyro drift estimate rad/s (float)
                accel_weight              : average accel_weight (float)
                renorm_val                : average renormalisation value (float)
                error_rp                  : average error_roll_pitch value (float)
                error_yaw                 : average error_yaw value (float)

                '''
                msg = MAVLink_ahrs_message(omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw)
                msg.pack(self)
                return msg
            
        def ahrs_send(self, omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw):
                '''
                Status of DCM attitude estimator

                omegaIx                   : X gyro drift estimate rad/s (float)
                omegaIy                   : Y gyro drift estimate rad/s (float)
                omegaIz                   : Z gyro drift estimate rad/s (float)
                accel_weight              : average accel_weight (float)
                renorm_val                : average renormalisation value (float)
                error_rp                  : average error_roll_pitch value (float)
                error_yaw                 : average error_yaw value (float)

                '''
                return self.send(self.ahrs_encode(omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw))
            
        def simstate_encode(self, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro):
                '''
                Status of simulation environment, if used

                roll                      : Roll angle (rad) (float)
                pitch                     : Pitch angle (rad) (float)
                yaw                       : Yaw angle (rad) (float)
                xacc                      : X acceleration m/s/s (float)
                yacc                      : Y acceleration m/s/s (float)
                zacc                      : Z acceleration m/s/s (float)
                xgyro                     : Angular speed around X axis rad/s (float)
                ygyro                     : Angular speed around Y axis rad/s (float)
                zgyro                     : Angular speed around Z axis rad/s (float)

                '''
                msg = MAVLink_simstate_message(roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro)
                msg.pack(self)
                return msg
            
        def simstate_send(self, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro):
                '''
                Status of simulation environment, if used

                roll                      : Roll angle (rad) (float)
                pitch                     : Pitch angle (rad) (float)
                yaw                       : Yaw angle (rad) (float)
                xacc                      : X acceleration m/s/s (float)
                yacc                      : Y acceleration m/s/s (float)
                zacc                      : Z acceleration m/s/s (float)
                xgyro                     : Angular speed around X axis rad/s (float)
                ygyro                     : Angular speed around Y axis rad/s (float)
                zgyro                     : Angular speed around Z axis rad/s (float)

                '''
                return self.send(self.simstate_encode(roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro))
            
        def hwstatus_encode(self, Vcc, I2Cerr):
                '''
                Status of key hardware

                Vcc                       : board voltage (mV) (uint16_t)
                I2Cerr                    : I2C error count (uint8_t)

                '''
                msg = MAVLink_hwstatus_message(Vcc, I2Cerr)
                msg.pack(self)
                return msg
            
        def hwstatus_send(self, Vcc, I2Cerr):
                '''
                Status of key hardware

                Vcc                       : board voltage (mV) (uint16_t)
                I2Cerr                    : I2C error count (uint8_t)

                '''
                return self.send(self.hwstatus_encode(Vcc, I2Cerr))
            
        def radio_encode(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed):
                '''
                Status generated by radio

                rssi                      : local signal strength (uint8_t)
                remrssi                   : remote signal strength (uint8_t)
                txbuf                     : how full the tx buffer is as a percentage (uint8_t)
                noise                     : background noise level (uint8_t)
                remnoise                  : remote background noise level (uint8_t)
                rxerrors                  : receive errors (uint16_t)
                fixed                     : count of error corrected packets (uint16_t)

                '''
                msg = MAVLink_radio_message(rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed)
                msg.pack(self)
                return msg
            
        def radio_send(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed):
                '''
                Status generated by radio

                rssi                      : local signal strength (uint8_t)
                remrssi                   : remote signal strength (uint8_t)
                txbuf                     : how full the tx buffer is as a percentage (uint8_t)
                noise                     : background noise level (uint8_t)
                remnoise                  : remote background noise level (uint8_t)
                rxerrors                  : receive errors (uint16_t)
                fixed                     : count of error corrected packets (uint16_t)

                '''
                return self.send(self.radio_encode(rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed))
            
        def heartbeat_encode(self, type, autopilot, mavlink_version=2):
                '''
                The heartbeat message shows that a system is present and responding.
                The type of the MAV and Autopilot hardware allow the
                receiving system to treat further messages from this
                system appropriate (e.g. by laying out the user
                interface based on the autopilot).

                type                      : Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) (uint8_t)
                autopilot                 : Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM (uint8_t)
                mavlink_version           : MAVLink version (uint8_t)

                '''
                msg = MAVLink_heartbeat_message(type, autopilot, mavlink_version)
                msg.pack(self)
                return msg
            
        def heartbeat_send(self, type, autopilot, mavlink_version=2):
                '''
                The heartbeat message shows that a system is present and responding.
                The type of the MAV and Autopilot hardware allow the
                receiving system to treat further messages from this
                system appropriate (e.g. by laying out the user
                interface based on the autopilot).

                type                      : Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) (uint8_t)
                autopilot                 : Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM (uint8_t)
                mavlink_version           : MAVLink version (uint8_t)

                '''
                return self.send(self.heartbeat_encode(type, autopilot, mavlink_version))
            
        def boot_encode(self, version):
                '''
                The boot message indicates that a system is starting. The onboard
                software version allows to keep track of onboard
                soft/firmware revisions.

                version                   : The onboard software version (uint32_t)

                '''
                msg = MAVLink_boot_message(version)
                msg.pack(self)
                return msg
            
        def boot_send(self, version):
                '''
                The boot message indicates that a system is starting. The onboard
                software version allows to keep track of onboard
                soft/firmware revisions.

                version                   : The onboard software version (uint32_t)

                '''
                return self.send(self.boot_encode(version))
            
        def system_time_encode(self, time_usec):
                '''
                The system time is the time of the master clock, typically the
                computer clock of the main onboard computer.

                time_usec                 : Timestamp of the master clock in microseconds since UNIX epoch. (uint64_t)

                '''
                msg = MAVLink_system_time_message(time_usec)
                msg.pack(self)
                return msg
            
        def system_time_send(self, time_usec):
                '''
                The system time is the time of the master clock, typically the
                computer clock of the main onboard computer.

                time_usec                 : Timestamp of the master clock in microseconds since UNIX epoch. (uint64_t)

                '''
                return self.send(self.system_time_encode(time_usec))
            
        def ping_encode(self, seq, target_system, target_component, time):
                '''
                A ping message either requesting or responding to a ping. This allows
                to measure the system latencies, including serial
                port, radio modem and UDP connections.

                seq                       : PING sequence (uint32_t)
                target_system             : 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t)
                target_component          : 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t)
                time                      : Unix timestamp in microseconds (uint64_t)

                '''
                msg = MAVLink_ping_message(seq, target_system, target_component, time)
                msg.pack(self)
                return msg
            
        def ping_send(self, seq, target_system, target_component, time):
                '''
                A ping message either requesting or responding to a ping. This allows
                to measure the system latencies, including serial
                port, radio modem and UDP connections.

                seq                       : PING sequence (uint32_t)
                target_system             : 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t)
                target_component          : 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t)
                time                      : Unix timestamp in microseconds (uint64_t)

                '''
                return self.send(self.ping_encode(seq, target_system, target_component, time))
            
        def system_time_utc_encode(self, utc_date, utc_time):
                '''
                UTC date and time from GPS module

                utc_date                  : GPS UTC date ddmmyy (uint32_t)
                utc_time                  : GPS UTC time hhmmss (uint32_t)

                '''
                msg = MAVLink_system_time_utc_message(utc_date, utc_time)
                msg.pack(self)
                return msg
            
        def system_time_utc_send(self, utc_date, utc_time):
                '''
                UTC date and time from GPS module

                utc_date                  : GPS UTC date ddmmyy (uint32_t)
                utc_time                  : GPS UTC time hhmmss (uint32_t)

                '''
                return self.send(self.system_time_utc_encode(utc_date, utc_time))
            
        def change_operator_control_encode(self, target_system, control_request, version, passkey):
                '''
                Request to control this MAV

                target_system             : System the GCS requests control for (uint8_t)
                control_request           : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
                version                   : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t)
                passkey                   : Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" (char)

                '''
                msg = MAVLink_change_operator_control_message(target_system, control_request, version, passkey)
                msg.pack(self)
                return msg
            
        def change_operator_control_send(self, target_system, control_request, version, passkey):
                '''
                Request to control this MAV

                target_system             : System the GCS requests control for (uint8_t)
                control_request           : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
                version                   : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t)
                passkey                   : Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" (char)

                '''
                return self.send(self.change_operator_control_encode(target_system, control_request, version, passkey))
            
        def change_operator_control_ack_encode(self, gcs_system_id, control_request, ack):
                '''
                Accept / deny control of this MAV

                gcs_system_id             : ID of the GCS this message (uint8_t)
                control_request           : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
                ack                       : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (uint8_t)

                '''
                msg = MAVLink_change_operator_control_ack_message(gcs_system_id, control_request, ack)
                msg.pack(self)
                return msg
            
        def change_operator_control_ack_send(self, gcs_system_id, control_request, ack):
                '''
                Accept / deny control of this MAV

                gcs_system_id             : ID of the GCS this message (uint8_t)
                control_request           : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
                ack                       : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (uint8_t)

                '''
                return self.send(self.change_operator_control_ack_encode(gcs_system_id, control_request, ack))
            
        def auth_key_encode(self, key):
                '''
                Emit an encrypted signature / key identifying this system. PLEASE
                NOTE: This protocol has been kept simple, so
                transmitting the key requires an encrypted channel for
                true safety.

                key                       : key (char)

                '''
                msg = MAVLink_auth_key_message(key)
                msg.pack(self)
                return msg
            
        def auth_key_send(self, key):
                '''
                Emit an encrypted signature / key identifying this system. PLEASE
                NOTE: This protocol has been kept simple, so
                transmitting the key requires an encrypted channel for
                true safety.

                key                       : key (char)

                '''
                return self.send(self.auth_key_encode(key))
            
        def action_ack_encode(self, action, result):
                '''
                This message acknowledges an action. IMPORTANT: The acknowledgement
                can be also negative, e.g. the MAV rejects a reset
                message because it is in-flight. The action ids are
                defined in ENUM MAV_ACTION in
                mavlink/include/mavlink_types.h

                action                    : The action id (uint8_t)
                result                    : 0: Action DENIED, 1: Action executed (uint8_t)

                '''
                msg = MAVLink_action_ack_message(action, result)
                msg.pack(self)
                return msg
            
        def action_ack_send(self, action, result):
                '''
                This message acknowledges an action. IMPORTANT: The acknowledgement
                can be also negative, e.g. the MAV rejects a reset
                message because it is in-flight. The action ids are
                defined in ENUM MAV_ACTION in
                mavlink/include/mavlink_types.h

                action                    : The action id (uint8_t)
                result                    : 0: Action DENIED, 1: Action executed (uint8_t)

                '''
                return self.send(self.action_ack_encode(action, result))
            
        def action_encode(self, target, target_component, action):
                '''
                An action message allows to execute a certain onboard action. These
                include liftoff, land, storing parameters too EEPROM,
                shutddown, etc. The action ids are defined in ENUM
                MAV_ACTION in mavlink/include/mavlink_types.h

                target                    : The system executing the action (uint8_t)
                target_component          : The component executing the action (uint8_t)
                action                    : The action id (uint8_t)

                '''
                msg = MAVLink_action_message(target, target_component, action)
                msg.pack(self)
                return msg
            
        def action_send(self, target, target_component, action):
                '''
                An action message allows to execute a certain onboard action. These
                include liftoff, land, storing parameters too EEPROM,
                shutddown, etc. The action ids are defined in ENUM
                MAV_ACTION in mavlink/include/mavlink_types.h

                target                    : The system executing the action (uint8_t)
                target_component          : The component executing the action (uint8_t)
                action                    : The action id (uint8_t)

                '''
                return self.send(self.action_encode(target, target_component, action))
            
        def set_mode_encode(self, target, mode):
                '''
                Set the system mode, as defined by enum MAV_MODE in
                mavlink/include/mavlink_types.h. There is no target
                component id as the mode is by definition for the
                overall aircraft, not only for one component.

                target                    : The system setting the mode (uint8_t)
                mode                      : The new mode (uint8_t)

                '''
                msg = MAVLink_set_mode_message(target, mode)
                msg.pack(self)
                return msg
            
        def set_mode_send(self, target, mode):
                '''
                Set the system mode, as defined by enum MAV_MODE in
                mavlink/include/mavlink_types.h. There is no target
                component id as the mode is by definition for the
                overall aircraft, not only for one component.

                target                    : The system setting the mode (uint8_t)
                mode                      : The new mode (uint8_t)

                '''
                return self.send(self.set_mode_encode(target, mode))
            
        def set_nav_mode_encode(self, target, nav_mode):
                '''
                Set the system navigation mode, as defined by enum MAV_NAV_MODE in
                mavlink/include/mavlink_types.h. The navigation mode
                applies to the whole aircraft and thus all components.

                target                    : The system setting the mode (uint8_t)
                nav_mode                  : The new navigation mode (uint8_t)

                '''
                msg = MAVLink_set_nav_mode_message(target, nav_mode)
                msg.pack(self)
                return msg
            
        def set_nav_mode_send(self, target, nav_mode):
                '''
                Set the system navigation mode, as defined by enum MAV_NAV_MODE in
                mavlink/include/mavlink_types.h. The navigation mode
                applies to the whole aircraft and thus all components.

                target                    : The system setting the mode (uint8_t)
                nav_mode                  : The new navigation mode (uint8_t)

                '''
                return self.send(self.set_nav_mode_encode(target, nav_mode))
            
        def param_request_read_encode(self, target_system, target_component, param_id, param_index):
                '''
                Request to read the onboard parameter with the param_id string id.
                Onboard parameters are stored as key[const char*] ->
                value[float]. This allows to send a parameter to any
                other component (such as the GCS) without the need of
                previous knowledge of possible parameter names. Thus
                the same GCS can store different parameters for
                different autopilots. See also
                http://qgroundcontrol.org/parameter_interface for a
                full documentation of QGroundControl and IMU code.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                param_id                  : Onboard parameter id (int8_t)
                param_index               : Parameter index. Send -1 to use the param ID field as identifier (int16_t)

                '''
                msg = MAVLink_param_request_read_message(target_system, target_component, param_id, param_index)
                msg.pack(self)
                return msg
            
        def param_request_read_send(self, target_system, target_component, param_id, param_index):
                '''
                Request to read the onboard parameter with the param_id string id.
                Onboard parameters are stored as key[const char*] ->
                value[float]. This allows to send a parameter to any
                other component (such as the GCS) without the need of
                previous knowledge of possible parameter names. Thus
                the same GCS can store different parameters for
                different autopilots. See also
                http://qgroundcontrol.org/parameter_interface for a
                full documentation of QGroundControl and IMU code.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                param_id                  : Onboard parameter id (int8_t)
                param_index               : Parameter index. Send -1 to use the param ID field as identifier (int16_t)

                '''
                return self.send(self.param_request_read_encode(target_system, target_component, param_id, param_index))
            
        def param_request_list_encode(self, target_system, target_component):
                '''
                Request all parameters of this component. After his request, all
                parameters are emitted.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)

                '''
                msg = MAVLink_param_request_list_message(target_system, target_component)
                msg.pack(self)
                return msg
            
        def param_request_list_send(self, target_system, target_component):
                '''
                Request all parameters of this component. After his request, all
                parameters are emitted.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)

                '''
                return self.send(self.param_request_list_encode(target_system, target_component))
            
        def param_value_encode(self, param_id, param_value, param_count, param_index):
                '''
                Emit the value of a onboard parameter. The inclusion of param_count
                and param_index in the message allows the recipient to
                keep track of received parameters and allows him to
                re-request missing parameters after a loss or timeout.

                param_id                  : Onboard parameter id (int8_t)
                param_value               : Onboard parameter value (float)
                param_count               : Total number of onboard parameters (uint16_t)
                param_index               : Index of this onboard parameter (uint16_t)

                '''
                msg = MAVLink_param_value_message(param_id, param_value, param_count, param_index)
                msg.pack(self)
                return msg
            
        def param_value_send(self, param_id, param_value, param_count, param_index):
                '''
                Emit the value of a onboard parameter. The inclusion of param_count
                and param_index in the message allows the recipient to
                keep track of received parameters and allows him to
                re-request missing parameters after a loss or timeout.

                param_id                  : Onboard parameter id (int8_t)
                param_value               : Onboard parameter value (float)
                param_count               : Total number of onboard parameters (uint16_t)
                param_index               : Index of this onboard parameter (uint16_t)

                '''
                return self.send(self.param_value_encode(param_id, param_value, param_count, param_index))
            
        def param_set_encode(self, target_system, target_component, param_id, param_value):
                '''
                Set a parameter value TEMPORARILY to RAM. It will be reset to default
                on system reboot. Send the ACTION
                MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM
                contents to EEPROM. IMPORTANT: The receiving component
                should acknowledge the new parameter value by sending
                a param_value message to all communication partners.
                This will also ensure that multiple GCS all have an
                up-to-date list of all parameters. If the sending GCS
                did not receive a PARAM_VALUE message within its
                timeout time, it should re-send the PARAM_SET message.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                param_id                  : Onboard parameter id (int8_t)
                param_value               : Onboard parameter value (float)

                '''
                msg = MAVLink_param_set_message(target_system, target_component, param_id, param_value)
                msg.pack(self)
                return msg
            
        def param_set_send(self, target_system, target_component, param_id, param_value):
                '''
                Set a parameter value TEMPORARILY to RAM. It will be reset to default
                on system reboot. Send the ACTION
                MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM
                contents to EEPROM. IMPORTANT: The receiving component
                should acknowledge the new parameter value by sending
                a param_value message to all communication partners.
                This will also ensure that multiple GCS all have an
                up-to-date list of all parameters. If the sending GCS
                did not receive a PARAM_VALUE message within its
                timeout time, it should re-send the PARAM_SET message.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                param_id                  : Onboard parameter id (int8_t)
                param_value               : Onboard parameter value (float)

                '''
                return self.send(self.param_set_encode(target_system, target_component, param_id, param_value))
            
        def gps_raw_int_encode(self, usec, fix_type, lat, lon, alt, eph, epv, v, hdg):
                '''
                The global position, as returned by the Global Positioning System
                (GPS). This is NOT the global position estimate of the
                sytem, but rather a RAW sensor value. See message
                GLOBAL_POSITION for the global position estimate.
                Coordinate frame is right-handed, Z-axis up (GPS
                frame)

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                fix_type                  : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (uint8_t)
                lat                       : Latitude in 1E7 degrees (int32_t)
                lon                       : Longitude in 1E7 degrees (int32_t)
                alt                       : Altitude in 1E3 meters (millimeters) (int32_t)
                eph                       : GPS HDOP (float)
                epv                       : GPS VDOP (float)
                v                         : GPS ground speed (m/s) (float)
                hdg                       : Compass heading in degrees, 0..360 degrees (float)

                '''
                msg = MAVLink_gps_raw_int_message(usec, fix_type, lat, lon, alt, eph, epv, v, hdg)
                msg.pack(self)
                return msg
            
        def gps_raw_int_send(self, usec, fix_type, lat, lon, alt, eph, epv, v, hdg):
                '''
                The global position, as returned by the Global Positioning System
                (GPS). This is NOT the global position estimate of the
                sytem, but rather a RAW sensor value. See message
                GLOBAL_POSITION for the global position estimate.
                Coordinate frame is right-handed, Z-axis up (GPS
                frame)

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                fix_type                  : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (uint8_t)
                lat                       : Latitude in 1E7 degrees (int32_t)
                lon                       : Longitude in 1E7 degrees (int32_t)
                alt                       : Altitude in 1E3 meters (millimeters) (int32_t)
                eph                       : GPS HDOP (float)
                epv                       : GPS VDOP (float)
                v                         : GPS ground speed (m/s) (float)
                hdg                       : Compass heading in degrees, 0..360 degrees (float)

                '''
                return self.send(self.gps_raw_int_encode(usec, fix_type, lat, lon, alt, eph, epv, v, hdg))
            
        def scaled_imu_encode(self, usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
                '''
                The RAW IMU readings for the usual 9DOF sensor setup. This message
                should contain the scaled values to the described
                units

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                xacc                      : X acceleration (mg) (int16_t)
                yacc                      : Y acceleration (mg) (int16_t)
                zacc                      : Z acceleration (mg) (int16_t)
                xgyro                     : Angular speed around X axis (millirad /sec) (int16_t)
                ygyro                     : Angular speed around Y axis (millirad /sec) (int16_t)
                zgyro                     : Angular speed around Z axis (millirad /sec) (int16_t)
                xmag                      : X Magnetic field (milli tesla) (int16_t)
                ymag                      : Y Magnetic field (milli tesla) (int16_t)
                zmag                      : Z Magnetic field (milli tesla) (int16_t)

                '''
                msg = MAVLink_scaled_imu_message(usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
                msg.pack(self)
                return msg
            
        def scaled_imu_send(self, usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
                '''
                The RAW IMU readings for the usual 9DOF sensor setup. This message
                should contain the scaled values to the described
                units

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                xacc                      : X acceleration (mg) (int16_t)
                yacc                      : Y acceleration (mg) (int16_t)
                zacc                      : Z acceleration (mg) (int16_t)
                xgyro                     : Angular speed around X axis (millirad /sec) (int16_t)
                ygyro                     : Angular speed around Y axis (millirad /sec) (int16_t)
                zgyro                     : Angular speed around Z axis (millirad /sec) (int16_t)
                xmag                      : X Magnetic field (milli tesla) (int16_t)
                ymag                      : Y Magnetic field (milli tesla) (int16_t)
                zmag                      : Z Magnetic field (milli tesla) (int16_t)

                '''
                return self.send(self.scaled_imu_encode(usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag))
            
        def gps_status_encode(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr):
                '''
                The positioning status, as reported by GPS. This message is intended
                to display status information about each satellite
                visible to the receiver. See message GLOBAL_POSITION
                for the global position estimate. This message can
                contain information for up to 20 satellites.

                satellites_visible        : Number of satellites visible (uint8_t)
                satellite_prn             : Global satellite ID (int8_t)
                satellite_used            : 0: Satellite not used, 1: used for localization (int8_t)
                satellite_elevation        : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (int8_t)
                satellite_azimuth         : Direction of satellite, 0: 0 deg, 255: 360 deg. (int8_t)
                satellite_snr             : Signal to noise ratio of satellite (int8_t)

                '''
                msg = MAVLink_gps_status_message(satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr)
                msg.pack(self)
                return msg
            
        def gps_status_send(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr):
                '''
                The positioning status, as reported by GPS. This message is intended
                to display status information about each satellite
                visible to the receiver. See message GLOBAL_POSITION
                for the global position estimate. This message can
                contain information for up to 20 satellites.

                satellites_visible        : Number of satellites visible (uint8_t)
                satellite_prn             : Global satellite ID (int8_t)
                satellite_used            : 0: Satellite not used, 1: used for localization (int8_t)
                satellite_elevation        : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (int8_t)
                satellite_azimuth         : Direction of satellite, 0: 0 deg, 255: 360 deg. (int8_t)
                satellite_snr             : Signal to noise ratio of satellite (int8_t)

                '''
                return self.send(self.gps_status_encode(satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr))
            
        def raw_imu_encode(self, usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
                '''
                The RAW IMU readings for the usual 9DOF sensor setup. This message
                should always contain the true raw values without any
                scaling to allow data capture and system debugging.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                xacc                      : X acceleration (raw) (int16_t)
                yacc                      : Y acceleration (raw) (int16_t)
                zacc                      : Z acceleration (raw) (int16_t)
                xgyro                     : Angular speed around X axis (raw) (int16_t)
                ygyro                     : Angular speed around Y axis (raw) (int16_t)
                zgyro                     : Angular speed around Z axis (raw) (int16_t)
                xmag                      : X Magnetic field (raw) (int16_t)
                ymag                      : Y Magnetic field (raw) (int16_t)
                zmag                      : Z Magnetic field (raw) (int16_t)

                '''
                msg = MAVLink_raw_imu_message(usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
                msg.pack(self)
                return msg
            
        def raw_imu_send(self, usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
                '''
                The RAW IMU readings for the usual 9DOF sensor setup. This message
                should always contain the true raw values without any
                scaling to allow data capture and system debugging.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                xacc                      : X acceleration (raw) (int16_t)
                yacc                      : Y acceleration (raw) (int16_t)
                zacc                      : Z acceleration (raw) (int16_t)
                xgyro                     : Angular speed around X axis (raw) (int16_t)
                ygyro                     : Angular speed around Y axis (raw) (int16_t)
                zgyro                     : Angular speed around Z axis (raw) (int16_t)
                xmag                      : X Magnetic field (raw) (int16_t)
                ymag                      : Y Magnetic field (raw) (int16_t)
                zmag                      : Z Magnetic field (raw) (int16_t)

                '''
                return self.send(self.raw_imu_encode(usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag))
            
        def raw_pressure_encode(self, usec, press_abs, press_diff1, press_diff2, temperature):
                '''
                The RAW pressure readings for the typical setup of one absolute
                pressure and one differential pressure sensor. The
                sensor values should be the raw, UNSCALED ADC values.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                press_abs                 : Absolute pressure (raw) (int16_t)
                press_diff1               : Differential pressure 1 (raw) (int16_t)
                press_diff2               : Differential pressure 2 (raw) (int16_t)
                temperature               : Raw Temperature measurement (raw) (int16_t)

                '''
                msg = MAVLink_raw_pressure_message(usec, press_abs, press_diff1, press_diff2, temperature)
                msg.pack(self)
                return msg
            
        def raw_pressure_send(self, usec, press_abs, press_diff1, press_diff2, temperature):
                '''
                The RAW pressure readings for the typical setup of one absolute
                pressure and one differential pressure sensor. The
                sensor values should be the raw, UNSCALED ADC values.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                press_abs                 : Absolute pressure (raw) (int16_t)
                press_diff1               : Differential pressure 1 (raw) (int16_t)
                press_diff2               : Differential pressure 2 (raw) (int16_t)
                temperature               : Raw Temperature measurement (raw) (int16_t)

                '''
                return self.send(self.raw_pressure_encode(usec, press_abs, press_diff1, press_diff2, temperature))
            
        def scaled_pressure_encode(self, usec, press_abs, press_diff, temperature):
                '''
                The pressure readings for the typical setup of one absolute and
                differential pressure sensor. The units are as
                specified in each field.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                press_abs                 : Absolute pressure (hectopascal) (float)
                press_diff                : Differential pressure 1 (hectopascal) (float)
                temperature               : Temperature measurement (0.01 degrees celsius) (int16_t)

                '''
                msg = MAVLink_scaled_pressure_message(usec, press_abs, press_diff, temperature)
                msg.pack(self)
                return msg
            
        def scaled_pressure_send(self, usec, press_abs, press_diff, temperature):
                '''
                The pressure readings for the typical setup of one absolute and
                differential pressure sensor. The units are as
                specified in each field.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                press_abs                 : Absolute pressure (hectopascal) (float)
                press_diff                : Differential pressure 1 (hectopascal) (float)
                temperature               : Temperature measurement (0.01 degrees celsius) (int16_t)

                '''
                return self.send(self.scaled_pressure_encode(usec, press_abs, press_diff, temperature))
            
        def attitude_encode(self, usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed):
                '''
                The attitude in the aeronautical frame (right-handed, Z-down, X-front,
                Y-right).

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                roll                      : Roll angle (rad) (float)
                pitch                     : Pitch angle (rad) (float)
                yaw                       : Yaw angle (rad) (float)
                rollspeed                 : Roll angular speed (rad/s) (float)
                pitchspeed                : Pitch angular speed (rad/s) (float)
                yawspeed                  : Yaw angular speed (rad/s) (float)

                '''
                msg = MAVLink_attitude_message(usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed)
                msg.pack(self)
                return msg
            
        def attitude_send(self, usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed):
                '''
                The attitude in the aeronautical frame (right-handed, Z-down, X-front,
                Y-right).

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                roll                      : Roll angle (rad) (float)
                pitch                     : Pitch angle (rad) (float)
                yaw                       : Yaw angle (rad) (float)
                rollspeed                 : Roll angular speed (rad/s) (float)
                pitchspeed                : Pitch angular speed (rad/s) (float)
                yawspeed                  : Yaw angular speed (rad/s) (float)

                '''
                return self.send(self.attitude_encode(usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed))
            
        def local_position_encode(self, usec, x, y, z, vx, vy, vz):
                '''
                The filtered local position (e.g. fused computer vision and
                accelerometers). Coordinate frame is right-handed,
                Z-axis down (aeronautical frame)

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                x                         : X Position (float)
                y                         : Y Position (float)
                z                         : Z Position (float)
                vx                        : X Speed (float)
                vy                        : Y Speed (float)
                vz                        : Z Speed (float)

                '''
                msg = MAVLink_local_position_message(usec, x, y, z, vx, vy, vz)
                msg.pack(self)
                return msg
            
        def local_position_send(self, usec, x, y, z, vx, vy, vz):
                '''
                The filtered local position (e.g. fused computer vision and
                accelerometers). Coordinate frame is right-handed,
                Z-axis down (aeronautical frame)

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                x                         : X Position (float)
                y                         : Y Position (float)
                z                         : Z Position (float)
                vx                        : X Speed (float)
                vy                        : Y Speed (float)
                vz                        : Z Speed (float)

                '''
                return self.send(self.local_position_encode(usec, x, y, z, vx, vy, vz))
            
        def global_position_encode(self, usec, lat, lon, alt, vx, vy, vz):
                '''
                The filtered global position (e.g. fused GPS and accelerometers).
                Coordinate frame is right-handed, Z-axis up (GPS
                frame)

                usec                      : Timestamp (microseconds since unix epoch) (uint64_t)
                lat                       : Latitude, in degrees (float)
                lon                       : Longitude, in degrees (float)
                alt                       : Absolute altitude, in meters (float)
                vx                        : X Speed (in Latitude direction, positive: going north) (float)
                vy                        : Y Speed (in Longitude direction, positive: going east) (float)
                vz                        : Z Speed (in Altitude direction, positive: going up) (float)

                '''
                msg = MAVLink_global_position_message(usec, lat, lon, alt, vx, vy, vz)
                msg.pack(self)
                return msg
            
        def global_position_send(self, usec, lat, lon, alt, vx, vy, vz):
                '''
                The filtered global position (e.g. fused GPS and accelerometers).
                Coordinate frame is right-handed, Z-axis up (GPS
                frame)

                usec                      : Timestamp (microseconds since unix epoch) (uint64_t)
                lat                       : Latitude, in degrees (float)
                lon                       : Longitude, in degrees (float)
                alt                       : Absolute altitude, in meters (float)
                vx                        : X Speed (in Latitude direction, positive: going north) (float)
                vy                        : Y Speed (in Longitude direction, positive: going east) (float)
                vz                        : Z Speed (in Altitude direction, positive: going up) (float)

                '''
                return self.send(self.global_position_encode(usec, lat, lon, alt, vx, vy, vz))
            
        def gps_raw_encode(self, usec, fix_type, lat, lon, alt, eph, epv, v, hdg):
                '''
                The global position, as returned by the Global Positioning System
                (GPS). This is NOT the global position estimate of the
                sytem, but rather a RAW sensor value. See message
                GLOBAL_POSITION for the global position estimate.
                Coordinate frame is right-handed, Z-axis up (GPS
                frame)

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                fix_type                  : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (uint8_t)
                lat                       : Latitude in degrees (float)
                lon                       : Longitude in degrees (float)
                alt                       : Altitude in meters (float)
                eph                       : GPS HDOP (float)
                epv                       : GPS VDOP (float)
                v                         : GPS ground speed (float)
                hdg                       : Compass heading in degrees, 0..360 degrees (float)

                '''
                msg = MAVLink_gps_raw_message(usec, fix_type, lat, lon, alt, eph, epv, v, hdg)
                msg.pack(self)
                return msg
            
        def gps_raw_send(self, usec, fix_type, lat, lon, alt, eph, epv, v, hdg):
                '''
                The global position, as returned by the Global Positioning System
                (GPS). This is NOT the global position estimate of the
                sytem, but rather a RAW sensor value. See message
                GLOBAL_POSITION for the global position estimate.
                Coordinate frame is right-handed, Z-axis up (GPS
                frame)

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                fix_type                  : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (uint8_t)
                lat                       : Latitude in degrees (float)
                lon                       : Longitude in degrees (float)
                alt                       : Altitude in meters (float)
                eph                       : GPS HDOP (float)
                epv                       : GPS VDOP (float)
                v                         : GPS ground speed (float)
                hdg                       : Compass heading in degrees, 0..360 degrees (float)

                '''
                return self.send(self.gps_raw_encode(usec, fix_type, lat, lon, alt, eph, epv, v, hdg))
            
        def sys_status_encode(self, mode, nav_mode, status, load, vbat, battery_remaining, packet_drop):
                '''
                The general system state. If the system is following the MAVLink
                standard, the system state is mainly defined by three
                orthogonal states/modes: The system mode, which is
                either LOCKED (motors shut down and locked), MANUAL
                (system under RC control), GUIDED (system with
                autonomous position control, position setpoint
                controlled manually) or AUTO (system guided by
                path/waypoint planner). The NAV_MODE defined the
                current flight state: LIFTOFF (often an open-loop
                maneuver), LANDING, WAYPOINTS or VECTOR. This
                represents the internal navigation state machine. The
                system status shows wether the system is currently
                active or not and if an emergency occured. During the
                CRITICAL and EMERGENCY states the MAV is still
                considered to be active, but should start emergency
                procedures autonomously. After a failure occured it
                should first move from active to critical to allow
                manual intervention and then move to emergency after a
                certain timeout.

                mode                      : System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h (uint8_t)
                nav_mode                  : Navigation mode, see MAV_NAV_MODE ENUM (uint8_t)
                status                    : System status flag, see MAV_STATUS ENUM (uint8_t)
                load                      : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t)
                vbat                      : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t)
                battery_remaining         : Remaining battery energy: (0%: 0, 100%: 1000) (uint16_t)
                packet_drop               : Dropped packets (packets that were corrupted on reception on the MAV) (uint16_t)

                '''
                msg = MAVLink_sys_status_message(mode, nav_mode, status, load, vbat, battery_remaining, packet_drop)
                msg.pack(self)
                return msg
            
        def sys_status_send(self, mode, nav_mode, status, load, vbat, battery_remaining, packet_drop):
                '''
                The general system state. If the system is following the MAVLink
                standard, the system state is mainly defined by three
                orthogonal states/modes: The system mode, which is
                either LOCKED (motors shut down and locked), MANUAL
                (system under RC control), GUIDED (system with
                autonomous position control, position setpoint
                controlled manually) or AUTO (system guided by
                path/waypoint planner). The NAV_MODE defined the
                current flight state: LIFTOFF (often an open-loop
                maneuver), LANDING, WAYPOINTS or VECTOR. This
                represents the internal navigation state machine. The
                system status shows wether the system is currently
                active or not and if an emergency occured. During the
                CRITICAL and EMERGENCY states the MAV is still
                considered to be active, but should start emergency
                procedures autonomously. After a failure occured it
                should first move from active to critical to allow
                manual intervention and then move to emergency after a
                certain timeout.

                mode                      : System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h (uint8_t)
                nav_mode                  : Navigation mode, see MAV_NAV_MODE ENUM (uint8_t)
                status                    : System status flag, see MAV_STATUS ENUM (uint8_t)
                load                      : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t)
                vbat                      : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t)
                battery_remaining         : Remaining battery energy: (0%: 0, 100%: 1000) (uint16_t)
                packet_drop               : Dropped packets (packets that were corrupted on reception on the MAV) (uint16_t)

                '''
                return self.send(self.sys_status_encode(mode, nav_mode, status, load, vbat, battery_remaining, packet_drop))
            
        def rc_channels_raw_encode(self, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi):
                '''
                The RAW values of the RC channels received. The standard PPM
                modulation is as follows: 1000 microseconds: 0%, 2000
                microseconds: 100%. Individual receivers/transmitters
                might violate this specification.

                chan1_raw                 : RC channel 1 value, in microseconds (uint16_t)
                chan2_raw                 : RC channel 2 value, in microseconds (uint16_t)
                chan3_raw                 : RC channel 3 value, in microseconds (uint16_t)
                chan4_raw                 : RC channel 4 value, in microseconds (uint16_t)
                chan5_raw                 : RC channel 5 value, in microseconds (uint16_t)
                chan6_raw                 : RC channel 6 value, in microseconds (uint16_t)
                chan7_raw                 : RC channel 7 value, in microseconds (uint16_t)
                chan8_raw                 : RC channel 8 value, in microseconds (uint16_t)
                rssi                      : Receive signal strength indicator, 0: 0%, 255: 100% (uint8_t)

                '''
                msg = MAVLink_rc_channels_raw_message(chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi)
                msg.pack(self)
                return msg
            
        def rc_channels_raw_send(self, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi):
                '''
                The RAW values of the RC channels received. The standard PPM
                modulation is as follows: 1000 microseconds: 0%, 2000
                microseconds: 100%. Individual receivers/transmitters
                might violate this specification.

                chan1_raw                 : RC channel 1 value, in microseconds (uint16_t)
                chan2_raw                 : RC channel 2 value, in microseconds (uint16_t)
                chan3_raw                 : RC channel 3 value, in microseconds (uint16_t)
                chan4_raw                 : RC channel 4 value, in microseconds (uint16_t)
                chan5_raw                 : RC channel 5 value, in microseconds (uint16_t)
                chan6_raw                 : RC channel 6 value, in microseconds (uint16_t)
                chan7_raw                 : RC channel 7 value, in microseconds (uint16_t)
                chan8_raw                 : RC channel 8 value, in microseconds (uint16_t)
                rssi                      : Receive signal strength indicator, 0: 0%, 255: 100% (uint8_t)

                '''
                return self.send(self.rc_channels_raw_encode(chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi))
            
        def rc_channels_scaled_encode(self, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi):
                '''
                The scaled values of the RC channels received. (-100%) -10000, (0%) 0,
                (100%) 10000

                chan1_scaled              : RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan2_scaled              : RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan3_scaled              : RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan4_scaled              : RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan5_scaled              : RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan6_scaled              : RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan7_scaled              : RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan8_scaled              : RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                rssi                      : Receive signal strength indicator, 0: 0%, 255: 100% (uint8_t)

                '''
                msg = MAVLink_rc_channels_scaled_message(chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi)
                msg.pack(self)
                return msg
            
        def rc_channels_scaled_send(self, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi):
                '''
                The scaled values of the RC channels received. (-100%) -10000, (0%) 0,
                (100%) 10000

                chan1_scaled              : RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan2_scaled              : RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan3_scaled              : RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan4_scaled              : RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan5_scaled              : RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan6_scaled              : RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan7_scaled              : RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                chan8_scaled              : RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 (int16_t)
                rssi                      : Receive signal strength indicator, 0: 0%, 255: 100% (uint8_t)

                '''
                return self.send(self.rc_channels_scaled_encode(chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi))
            
        def servo_output_raw_encode(self, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw):
                '''
                The RAW values of the servo outputs (for RC input from the remote, use
                the RC_CHANNELS messages). The standard PPM modulation
                is as follows: 1000 microseconds: 0%, 2000
                microseconds: 100%.

                servo1_raw                : Servo output 1 value, in microseconds (uint16_t)
                servo2_raw                : Servo output 2 value, in microseconds (uint16_t)
                servo3_raw                : Servo output 3 value, in microseconds (uint16_t)
                servo4_raw                : Servo output 4 value, in microseconds (uint16_t)
                servo5_raw                : Servo output 5 value, in microseconds (uint16_t)
                servo6_raw                : Servo output 6 value, in microseconds (uint16_t)
                servo7_raw                : Servo output 7 value, in microseconds (uint16_t)
                servo8_raw                : Servo output 8 value, in microseconds (uint16_t)

                '''
                msg = MAVLink_servo_output_raw_message(servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw)
                msg.pack(self)
                return msg
            
        def servo_output_raw_send(self, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw):
                '''
                The RAW values of the servo outputs (for RC input from the remote, use
                the RC_CHANNELS messages). The standard PPM modulation
                is as follows: 1000 microseconds: 0%, 2000
                microseconds: 100%.

                servo1_raw                : Servo output 1 value, in microseconds (uint16_t)
                servo2_raw                : Servo output 2 value, in microseconds (uint16_t)
                servo3_raw                : Servo output 3 value, in microseconds (uint16_t)
                servo4_raw                : Servo output 4 value, in microseconds (uint16_t)
                servo5_raw                : Servo output 5 value, in microseconds (uint16_t)
                servo6_raw                : Servo output 6 value, in microseconds (uint16_t)
                servo7_raw                : Servo output 7 value, in microseconds (uint16_t)
                servo8_raw                : Servo output 8 value, in microseconds (uint16_t)

                '''
                return self.send(self.servo_output_raw_encode(servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw))
            
        def waypoint_encode(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
                '''
                Message encoding a waypoint. This message is emitted to announce
                the presence of a waypoint and to set a waypoint on
                the system. The waypoint can be either in x, y, z
                meters (type: LOCAL) or x:lat, y:lon, z:altitude.
                Local frame is Z-down, right handed, global frame is
                Z-up, right handed

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                seq                       : Sequence (uint16_t)
                frame                     : The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h (uint8_t)
                command                   : The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs (uint8_t)
                current                   : false:0, true:1 (uint8_t)
                autocontinue              : autocontinue to next wp (uint8_t)
                param1                    : PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters (float)
                param2                    : PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds (float)
                param3                    : PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. (float)
                param4                    : PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH (float)
                x                         : PARAM5 / local: x position, global: latitude (float)
                y                         : PARAM6 / y position: global: longitude (float)
                z                         : PARAM7 / z position: global: altitude (float)

                '''
                msg = MAVLink_waypoint_message(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z)
                msg.pack(self)
                return msg
            
        def waypoint_send(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
                '''
                Message encoding a waypoint. This message is emitted to announce
                the presence of a waypoint and to set a waypoint on
                the system. The waypoint can be either in x, y, z
                meters (type: LOCAL) or x:lat, y:lon, z:altitude.
                Local frame is Z-down, right handed, global frame is
                Z-up, right handed

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                seq                       : Sequence (uint16_t)
                frame                     : The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h (uint8_t)
                command                   : The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs (uint8_t)
                current                   : false:0, true:1 (uint8_t)
                autocontinue              : autocontinue to next wp (uint8_t)
                param1                    : PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters (float)
                param2                    : PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds (float)
                param3                    : PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. (float)
                param4                    : PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH (float)
                x                         : PARAM5 / local: x position, global: latitude (float)
                y                         : PARAM6 / y position: global: longitude (float)
                z                         : PARAM7 / z position: global: altitude (float)

                '''
                return self.send(self.waypoint_encode(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z))
            
        def waypoint_request_encode(self, target_system, target_component, seq):
                '''
                Request the information of the waypoint with the sequence number seq.
                The response of the system to this message should be a
                WAYPOINT message.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                seq                       : Sequence (uint16_t)

                '''
                msg = MAVLink_waypoint_request_message(target_system, target_component, seq)
                msg.pack(self)
                return msg
            
        def waypoint_request_send(self, target_system, target_component, seq):
                '''
                Request the information of the waypoint with the sequence number seq.
                The response of the system to this message should be a
                WAYPOINT message.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                seq                       : Sequence (uint16_t)

                '''
                return self.send(self.waypoint_request_encode(target_system, target_component, seq))
            
        def waypoint_set_current_encode(self, target_system, target_component, seq):
                '''
                Set the waypoint with sequence number seq as current waypoint. This
                means that the MAV will continue to this waypoint on
                the shortest path (not following the waypoints in-
                between).

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                seq                       : Sequence (uint16_t)

                '''
                msg = MAVLink_waypoint_set_current_message(target_system, target_component, seq)
                msg.pack(self)
                return msg
            
        def waypoint_set_current_send(self, target_system, target_component, seq):
                '''
                Set the waypoint with sequence number seq as current waypoint. This
                means that the MAV will continue to this waypoint on
                the shortest path (not following the waypoints in-
                between).

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                seq                       : Sequence (uint16_t)

                '''
                return self.send(self.waypoint_set_current_encode(target_system, target_component, seq))
            
        def waypoint_current_encode(self, seq):
                '''
                Message that announces the sequence number of the current active
                waypoint. The MAV will fly towards this waypoint.

                seq                       : Sequence (uint16_t)

                '''
                msg = MAVLink_waypoint_current_message(seq)
                msg.pack(self)
                return msg
            
        def waypoint_current_send(self, seq):
                '''
                Message that announces the sequence number of the current active
                waypoint. The MAV will fly towards this waypoint.

                seq                       : Sequence (uint16_t)

                '''
                return self.send(self.waypoint_current_encode(seq))
            
        def waypoint_request_list_encode(self, target_system, target_component):
                '''
                Request the overall list of waypoints from the system/component.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)

                '''
                msg = MAVLink_waypoint_request_list_message(target_system, target_component)
                msg.pack(self)
                return msg
            
        def waypoint_request_list_send(self, target_system, target_component):
                '''
                Request the overall list of waypoints from the system/component.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)

                '''
                return self.send(self.waypoint_request_list_encode(target_system, target_component))
            
        def waypoint_count_encode(self, target_system, target_component, count):
                '''
                This message is emitted as response to WAYPOINT_REQUEST_LIST by the
                MAV. The GCS can then request the individual waypoints
                based on the knowledge of the total number of
                waypoints.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                count                     : Number of Waypoints in the Sequence (uint16_t)

                '''
                msg = MAVLink_waypoint_count_message(target_system, target_component, count)
                msg.pack(self)
                return msg
            
        def waypoint_count_send(self, target_system, target_component, count):
                '''
                This message is emitted as response to WAYPOINT_REQUEST_LIST by the
                MAV. The GCS can then request the individual waypoints
                based on the knowledge of the total number of
                waypoints.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                count                     : Number of Waypoints in the Sequence (uint16_t)

                '''
                return self.send(self.waypoint_count_encode(target_system, target_component, count))
            
        def waypoint_clear_all_encode(self, target_system, target_component):
                '''
                Delete all waypoints at once.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)

                '''
                msg = MAVLink_waypoint_clear_all_message(target_system, target_component)
                msg.pack(self)
                return msg
            
        def waypoint_clear_all_send(self, target_system, target_component):
                '''
                Delete all waypoints at once.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)

                '''
                return self.send(self.waypoint_clear_all_encode(target_system, target_component))
            
        def waypoint_reached_encode(self, seq):
                '''
                A certain waypoint has been reached. The system will either hold this
                position (or circle on the orbit) or (if the
                autocontinue on the WP was set) continue to the next
                waypoint.

                seq                       : Sequence (uint16_t)

                '''
                msg = MAVLink_waypoint_reached_message(seq)
                msg.pack(self)
                return msg
            
        def waypoint_reached_send(self, seq):
                '''
                A certain waypoint has been reached. The system will either hold this
                position (or circle on the orbit) or (if the
                autocontinue on the WP was set) continue to the next
                waypoint.

                seq                       : Sequence (uint16_t)

                '''
                return self.send(self.waypoint_reached_encode(seq))
            
        def waypoint_ack_encode(self, target_system, target_component, type):
                '''
                Ack message during waypoint handling. The type field states if this
                message is a positive ack (type=0) or if an error
                happened (type=non-zero).

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                type                      : 0: OK, 1: Error (uint8_t)

                '''
                msg = MAVLink_waypoint_ack_message(target_system, target_component, type)
                msg.pack(self)
                return msg
            
        def waypoint_ack_send(self, target_system, target_component, type):
                '''
                Ack message during waypoint handling. The type field states if this
                message is a positive ack (type=0) or if an error
                happened (type=non-zero).

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                type                      : 0: OK, 1: Error (uint8_t)

                '''
                return self.send(self.waypoint_ack_encode(target_system, target_component, type))
            
        def gps_set_global_origin_encode(self, target_system, target_component, latitude, longitude, altitude):
                '''
                As local waypoints exist, the global waypoint reference allows to
                transform between the local coordinate frame and the
                global (GPS) coordinate frame. This can be necessary
                when e.g. in- and outdoor settings are connected and
                the MAV should move from in- to outdoor.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                latitude                  : global position * 1E7 (int32_t)
                longitude                 : global position * 1E7 (int32_t)
                altitude                  : global position * 1000 (int32_t)

                '''
                msg = MAVLink_gps_set_global_origin_message(target_system, target_component, latitude, longitude, altitude)
                msg.pack(self)
                return msg
            
        def gps_set_global_origin_send(self, target_system, target_component, latitude, longitude, altitude):
                '''
                As local waypoints exist, the global waypoint reference allows to
                transform between the local coordinate frame and the
                global (GPS) coordinate frame. This can be necessary
                when e.g. in- and outdoor settings are connected and
                the MAV should move from in- to outdoor.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                latitude                  : global position * 1E7 (int32_t)
                longitude                 : global position * 1E7 (int32_t)
                altitude                  : global position * 1000 (int32_t)

                '''
                return self.send(self.gps_set_global_origin_encode(target_system, target_component, latitude, longitude, altitude))
            
        def gps_local_origin_set_encode(self, latitude, longitude, altitude):
                '''
                Once the MAV sets a new GPS-Local correspondence, this message
                announces the origin (0,0,0) position

                latitude                  : Latitude (WGS84), expressed as * 1E7 (int32_t)
                longitude                 : Longitude (WGS84), expressed as * 1E7 (int32_t)
                altitude                  : Altitude(WGS84), expressed as * 1000 (int32_t)

                '''
                msg = MAVLink_gps_local_origin_set_message(latitude, longitude, altitude)
                msg.pack(self)
                return msg
            
        def gps_local_origin_set_send(self, latitude, longitude, altitude):
                '''
                Once the MAV sets a new GPS-Local correspondence, this message
                announces the origin (0,0,0) position

                latitude                  : Latitude (WGS84), expressed as * 1E7 (int32_t)
                longitude                 : Longitude (WGS84), expressed as * 1E7 (int32_t)
                altitude                  : Altitude(WGS84), expressed as * 1000 (int32_t)

                '''
                return self.send(self.gps_local_origin_set_encode(latitude, longitude, altitude))
            
        def local_position_setpoint_set_encode(self, target_system, target_component, x, y, z, yaw):
                '''
                Set the setpoint for a local position controller. This is the position
                in local coordinates the MAV should fly to. This
                message is sent by the path/waypoint planner to the
                onboard position controller. As some MAVs have a
                degree of freedom in yaw (e.g. all
                helicopters/quadrotors), the desired yaw angle is part
                of the message.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                x                         : x position (float)
                y                         : y position (float)
                z                         : z position (float)
                yaw                       : Desired yaw angle (float)

                '''
                msg = MAVLink_local_position_setpoint_set_message(target_system, target_component, x, y, z, yaw)
                msg.pack(self)
                return msg
            
        def local_position_setpoint_set_send(self, target_system, target_component, x, y, z, yaw):
                '''
                Set the setpoint for a local position controller. This is the position
                in local coordinates the MAV should fly to. This
                message is sent by the path/waypoint planner to the
                onboard position controller. As some MAVs have a
                degree of freedom in yaw (e.g. all
                helicopters/quadrotors), the desired yaw angle is part
                of the message.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                x                         : x position (float)
                y                         : y position (float)
                z                         : z position (float)
                yaw                       : Desired yaw angle (float)

                '''
                return self.send(self.local_position_setpoint_set_encode(target_system, target_component, x, y, z, yaw))
            
        def local_position_setpoint_encode(self, x, y, z, yaw):
                '''
                Transmit the current local setpoint of the controller to other MAVs
                (collision avoidance) and to the GCS.

                x                         : x position (float)
                y                         : y position (float)
                z                         : z position (float)
                yaw                       : Desired yaw angle (float)

                '''
                msg = MAVLink_local_position_setpoint_message(x, y, z, yaw)
                msg.pack(self)
                return msg
            
        def local_position_setpoint_send(self, x, y, z, yaw):
                '''
                Transmit the current local setpoint of the controller to other MAVs
                (collision avoidance) and to the GCS.

                x                         : x position (float)
                y                         : y position (float)
                z                         : z position (float)
                yaw                       : Desired yaw angle (float)

                '''
                return self.send(self.local_position_setpoint_encode(x, y, z, yaw))
            
        def control_status_encode(self, position_fix, vision_fix, gps_fix, ahrs_health, control_att, control_pos_xy, control_pos_z, control_pos_yaw):
                '''
                

                position_fix              : Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix (uint8_t)
                vision_fix                : Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix (uint8_t)
                gps_fix                   : GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix (uint8_t)
                ahrs_health               : Attitude estimation health: 0: poor, 255: excellent (uint8_t)
                control_att               : 0: Attitude control disabled, 1: enabled (uint8_t)
                control_pos_xy            : 0: X, Y position control disabled, 1: enabled (uint8_t)
                control_pos_z             : 0: Z position control disabled, 1: enabled (uint8_t)
                control_pos_yaw           : 0: Yaw angle control disabled, 1: enabled (uint8_t)

                '''
                msg = MAVLink_control_status_message(position_fix, vision_fix, gps_fix, ahrs_health, control_att, control_pos_xy, control_pos_z, control_pos_yaw)
                msg.pack(self)
                return msg
            
        def control_status_send(self, position_fix, vision_fix, gps_fix, ahrs_health, control_att, control_pos_xy, control_pos_z, control_pos_yaw):
                '''
                

                position_fix              : Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix (uint8_t)
                vision_fix                : Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix (uint8_t)
                gps_fix                   : GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix (uint8_t)
                ahrs_health               : Attitude estimation health: 0: poor, 255: excellent (uint8_t)
                control_att               : 0: Attitude control disabled, 1: enabled (uint8_t)
                control_pos_xy            : 0: X, Y position control disabled, 1: enabled (uint8_t)
                control_pos_z             : 0: Z position control disabled, 1: enabled (uint8_t)
                control_pos_yaw           : 0: Yaw angle control disabled, 1: enabled (uint8_t)

                '''
                return self.send(self.control_status_encode(position_fix, vision_fix, gps_fix, ahrs_health, control_att, control_pos_xy, control_pos_z, control_pos_yaw))
            
        def safety_set_allowed_area_encode(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z):
                '''
                Set a safety zone (volume), which is defined by two corners of a cube.
                This message can be used to tell the MAV which
                setpoints/waypoints to accept and which to reject.
                Safety areas are often enforced by national or
                competition regulations.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                frame                     : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t)
                p1x                       : x position 1 / Latitude 1 (float)
                p1y                       : y position 1 / Longitude 1 (float)
                p1z                       : z position 1 / Altitude 1 (float)
                p2x                       : x position 2 / Latitude 2 (float)
                p2y                       : y position 2 / Longitude 2 (float)
                p2z                       : z position 2 / Altitude 2 (float)

                '''
                msg = MAVLink_safety_set_allowed_area_message(target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z)
                msg.pack(self)
                return msg
            
        def safety_set_allowed_area_send(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z):
                '''
                Set a safety zone (volume), which is defined by two corners of a cube.
                This message can be used to tell the MAV which
                setpoints/waypoints to accept and which to reject.
                Safety areas are often enforced by national or
                competition regulations.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                frame                     : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t)
                p1x                       : x position 1 / Latitude 1 (float)
                p1y                       : y position 1 / Longitude 1 (float)
                p1z                       : z position 1 / Altitude 1 (float)
                p2x                       : x position 2 / Latitude 2 (float)
                p2y                       : y position 2 / Longitude 2 (float)
                p2z                       : z position 2 / Altitude 2 (float)

                '''
                return self.send(self.safety_set_allowed_area_encode(target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z))
            
        def safety_allowed_area_encode(self, frame, p1x, p1y, p1z, p2x, p2y, p2z):
                '''
                Read out the safety zone the MAV currently assumes.

                frame                     : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t)
                p1x                       : x position 1 / Latitude 1 (float)
                p1y                       : y position 1 / Longitude 1 (float)
                p1z                       : z position 1 / Altitude 1 (float)
                p2x                       : x position 2 / Latitude 2 (float)
                p2y                       : y position 2 / Longitude 2 (float)
                p2z                       : z position 2 / Altitude 2 (float)

                '''
                msg = MAVLink_safety_allowed_area_message(frame, p1x, p1y, p1z, p2x, p2y, p2z)
                msg.pack(self)
                return msg
            
        def safety_allowed_area_send(self, frame, p1x, p1y, p1z, p2x, p2y, p2z):
                '''
                Read out the safety zone the MAV currently assumes.

                frame                     : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t)
                p1x                       : x position 1 / Latitude 1 (float)
                p1y                       : y position 1 / Longitude 1 (float)
                p1z                       : z position 1 / Altitude 1 (float)
                p2x                       : x position 2 / Latitude 2 (float)
                p2y                       : y position 2 / Longitude 2 (float)
                p2z                       : z position 2 / Altitude 2 (float)

                '''
                return self.send(self.safety_allowed_area_encode(frame, p1x, p1y, p1z, p2x, p2y, p2z))
            
        def set_roll_pitch_yaw_thrust_encode(self, target_system, target_component, roll, pitch, yaw, thrust):
                '''
                Set roll, pitch and yaw.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                roll                      : Desired roll angle in radians (float)
                pitch                     : Desired pitch angle in radians (float)
                yaw                       : Desired yaw angle in radians (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                msg = MAVLink_set_roll_pitch_yaw_thrust_message(target_system, target_component, roll, pitch, yaw, thrust)
                msg.pack(self)
                return msg
            
        def set_roll_pitch_yaw_thrust_send(self, target_system, target_component, roll, pitch, yaw, thrust):
                '''
                Set roll, pitch and yaw.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                roll                      : Desired roll angle in radians (float)
                pitch                     : Desired pitch angle in radians (float)
                yaw                       : Desired yaw angle in radians (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                return self.send(self.set_roll_pitch_yaw_thrust_encode(target_system, target_component, roll, pitch, yaw, thrust))
            
        def set_roll_pitch_yaw_speed_thrust_encode(self, target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust):
                '''
                Set roll, pitch and yaw.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                roll_speed                : Desired roll angular speed in rad/s (float)
                pitch_speed               : Desired pitch angular speed in rad/s (float)
                yaw_speed                 : Desired yaw angular speed in rad/s (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                msg = MAVLink_set_roll_pitch_yaw_speed_thrust_message(target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust)
                msg.pack(self)
                return msg
            
        def set_roll_pitch_yaw_speed_thrust_send(self, target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust):
                '''
                Set roll, pitch and yaw.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                roll_speed                : Desired roll angular speed in rad/s (float)
                pitch_speed               : Desired pitch angular speed in rad/s (float)
                yaw_speed                 : Desired yaw angular speed in rad/s (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                return self.send(self.set_roll_pitch_yaw_speed_thrust_encode(target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust))
            
        def roll_pitch_yaw_thrust_setpoint_encode(self, time_us, roll, pitch, yaw, thrust):
                '''
                Setpoint in roll, pitch, yaw currently active on the system.

                time_us                   : Timestamp in micro seconds since unix epoch (uint64_t)
                roll                      : Desired roll angle in radians (float)
                pitch                     : Desired pitch angle in radians (float)
                yaw                       : Desired yaw angle in radians (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                msg = MAVLink_roll_pitch_yaw_thrust_setpoint_message(time_us, roll, pitch, yaw, thrust)
                msg.pack(self)
                return msg
            
        def roll_pitch_yaw_thrust_setpoint_send(self, time_us, roll, pitch, yaw, thrust):
                '''
                Setpoint in roll, pitch, yaw currently active on the system.

                time_us                   : Timestamp in micro seconds since unix epoch (uint64_t)
                roll                      : Desired roll angle in radians (float)
                pitch                     : Desired pitch angle in radians (float)
                yaw                       : Desired yaw angle in radians (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                return self.send(self.roll_pitch_yaw_thrust_setpoint_encode(time_us, roll, pitch, yaw, thrust))
            
        def roll_pitch_yaw_speed_thrust_setpoint_encode(self, time_us, roll_speed, pitch_speed, yaw_speed, thrust):
                '''
                Setpoint in rollspeed, pitchspeed, yawspeed currently active on the
                system.

                time_us                   : Timestamp in micro seconds since unix epoch (uint64_t)
                roll_speed                : Desired roll angular speed in rad/s (float)
                pitch_speed               : Desired pitch angular speed in rad/s (float)
                yaw_speed                 : Desired yaw angular speed in rad/s (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                msg = MAVLink_roll_pitch_yaw_speed_thrust_setpoint_message(time_us, roll_speed, pitch_speed, yaw_speed, thrust)
                msg.pack(self)
                return msg
            
        def roll_pitch_yaw_speed_thrust_setpoint_send(self, time_us, roll_speed, pitch_speed, yaw_speed, thrust):
                '''
                Setpoint in rollspeed, pitchspeed, yawspeed currently active on the
                system.

                time_us                   : Timestamp in micro seconds since unix epoch (uint64_t)
                roll_speed                : Desired roll angular speed in rad/s (float)
                pitch_speed               : Desired pitch angular speed in rad/s (float)
                yaw_speed                 : Desired yaw angular speed in rad/s (float)
                thrust                    : Collective thrust, normalized to 0 .. 1 (float)

                '''
                return self.send(self.roll_pitch_yaw_speed_thrust_setpoint_encode(time_us, roll_speed, pitch_speed, yaw_speed, thrust))
            
        def nav_controller_output_encode(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error):
                '''
                Outputs of the APM navigation controller. The primary use of this
                message is to check the response and signs of the
                controller before actual flight and to assist with
                tuning controller parameters

                nav_roll                  : Current desired roll in degrees (float)
                nav_pitch                 : Current desired pitch in degrees (float)
                nav_bearing               : Current desired heading in degrees (int16_t)
                target_bearing            : Bearing to current waypoint/target in degrees (int16_t)
                wp_dist                   : Distance to active waypoint in meters (uint16_t)
                alt_error                 : Current altitude error in meters (float)
                aspd_error                : Current airspeed error in meters/second (float)
                xtrack_error              : Current crosstrack error on x-y plane in meters (float)

                '''
                msg = MAVLink_nav_controller_output_message(nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error)
                msg.pack(self)
                return msg
            
        def nav_controller_output_send(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error):
                '''
                Outputs of the APM navigation controller. The primary use of this
                message is to check the response and signs of the
                controller before actual flight and to assist with
                tuning controller parameters

                nav_roll                  : Current desired roll in degrees (float)
                nav_pitch                 : Current desired pitch in degrees (float)
                nav_bearing               : Current desired heading in degrees (int16_t)
                target_bearing            : Bearing to current waypoint/target in degrees (int16_t)
                wp_dist                   : Distance to active waypoint in meters (uint16_t)
                alt_error                 : Current altitude error in meters (float)
                aspd_error                : Current airspeed error in meters/second (float)
                xtrack_error              : Current crosstrack error on x-y plane in meters (float)

                '''
                return self.send(self.nav_controller_output_encode(nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error))
            
        def position_target_encode(self, x, y, z, yaw):
                '''
                The goal position of the system. This position is the input to any
                navigation or path planning algorithm and does NOT
                represent the current controller setpoint.

                x                         : x position (float)
                y                         : y position (float)
                z                         : z position (float)
                yaw                       : yaw orientation in radians, 0 = NORTH (float)

                '''
                msg = MAVLink_position_target_message(x, y, z, yaw)
                msg.pack(self)
                return msg
            
        def position_target_send(self, x, y, z, yaw):
                '''
                The goal position of the system. This position is the input to any
                navigation or path planning algorithm and does NOT
                represent the current controller setpoint.

                x                         : x position (float)
                y                         : y position (float)
                z                         : z position (float)
                yaw                       : yaw orientation in radians, 0 = NORTH (float)

                '''
                return self.send(self.position_target_encode(x, y, z, yaw))
            
        def state_correction_encode(self, xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr):
                '''
                Corrects the systems state by adding an error correction term to the
                position and velocity, and by rotating the attitude by
                a correction angle.

                xErr                      : x position error (float)
                yErr                      : y position error (float)
                zErr                      : z position error (float)
                rollErr                   : roll error (radians) (float)
                pitchErr                  : pitch error (radians) (float)
                yawErr                    : yaw error (radians) (float)
                vxErr                     : x velocity (float)
                vyErr                     : y velocity (float)
                vzErr                     : z velocity (float)

                '''
                msg = MAVLink_state_correction_message(xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr)
                msg.pack(self)
                return msg
            
        def state_correction_send(self, xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr):
                '''
                Corrects the systems state by adding an error correction term to the
                position and velocity, and by rotating the attitude by
                a correction angle.

                xErr                      : x position error (float)
                yErr                      : y position error (float)
                zErr                      : z position error (float)
                rollErr                   : roll error (radians) (float)
                pitchErr                  : pitch error (radians) (float)
                yawErr                    : yaw error (radians) (float)
                vxErr                     : x velocity (float)
                vyErr                     : y velocity (float)
                vzErr                     : z velocity (float)

                '''
                return self.send(self.state_correction_encode(xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr))
            
        def set_altitude_encode(self, target, mode):
                '''
                

                target                    : The system setting the altitude (uint8_t)
                mode                      : The new altitude in meters (uint32_t)

                '''
                msg = MAVLink_set_altitude_message(target, mode)
                msg.pack(self)
                return msg
            
        def set_altitude_send(self, target, mode):
                '''
                

                target                    : The system setting the altitude (uint8_t)
                mode                      : The new altitude in meters (uint32_t)

                '''
                return self.send(self.set_altitude_encode(target, mode))
            
        def request_data_stream_encode(self, target_system, target_component, req_stream_id, req_message_rate, start_stop):
                '''
                

                target_system             : The target requested to send the message stream. (uint8_t)
                target_component          : The target requested to send the message stream. (uint8_t)
                req_stream_id             : The ID of the requested message type (uint8_t)
                req_message_rate          : Update rate in Hertz (uint16_t)
                start_stop                : 1 to start sending, 0 to stop sending. (uint8_t)

                '''
                msg = MAVLink_request_data_stream_message(target_system, target_component, req_stream_id, req_message_rate, start_stop)
                msg.pack(self)
                return msg
            
        def request_data_stream_send(self, target_system, target_component, req_stream_id, req_message_rate, start_stop):
                '''
                

                target_system             : The target requested to send the message stream. (uint8_t)
                target_component          : The target requested to send the message stream. (uint8_t)
                req_stream_id             : The ID of the requested message type (uint8_t)
                req_message_rate          : Update rate in Hertz (uint16_t)
                start_stop                : 1 to start sending, 0 to stop sending. (uint8_t)

                '''
                return self.send(self.request_data_stream_encode(target_system, target_component, req_stream_id, req_message_rate, start_stop))
            
        def hil_state_encode(self, usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc):
                '''
                This packet is useful for high throughput                 applications
                such as hardware in the loop simulations.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                roll                      : Roll angle (rad) (float)
                pitch                     : Pitch angle (rad) (float)
                yaw                       : Yaw angle (rad) (float)
                rollspeed                 : Roll angular speed (rad/s) (float)
                pitchspeed                : Pitch angular speed (rad/s) (float)
                yawspeed                  : Yaw angular speed (rad/s) (float)
                lat                       : Latitude, expressed as * 1E7 (int32_t)
                lon                       : Longitude, expressed as * 1E7 (int32_t)
                alt                       : Altitude in meters, expressed as * 1000 (millimeters) (int32_t)
                vx                        : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t)
                vy                        : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t)
                vz                        : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t)
                xacc                      : X acceleration (mg) (int16_t)
                yacc                      : Y acceleration (mg) (int16_t)
                zacc                      : Z acceleration (mg) (int16_t)

                '''
                msg = MAVLink_hil_state_message(usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc)
                msg.pack(self)
                return msg
            
        def hil_state_send(self, usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc):
                '''
                This packet is useful for high throughput                 applications
                such as hardware in the loop simulations.

                usec                      : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                roll                      : Roll angle (rad) (float)
                pitch                     : Pitch angle (rad) (float)
                yaw                       : Yaw angle (rad) (float)
                rollspeed                 : Roll angular speed (rad/s) (float)
                pitchspeed                : Pitch angular speed (rad/s) (float)
                yawspeed                  : Yaw angular speed (rad/s) (float)
                lat                       : Latitude, expressed as * 1E7 (int32_t)
                lon                       : Longitude, expressed as * 1E7 (int32_t)
                alt                       : Altitude in meters, expressed as * 1000 (millimeters) (int32_t)
                vx                        : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t)
                vy                        : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t)
                vz                        : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t)
                xacc                      : X acceleration (mg) (int16_t)
                yacc                      : Y acceleration (mg) (int16_t)
                zacc                      : Z acceleration (mg) (int16_t)

                '''
                return self.send(self.hil_state_encode(usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc))
            
        def hil_controls_encode(self, time_us, roll_ailerons, pitch_elevator, yaw_rudder, throttle, mode, nav_mode):
                '''
                Hardware in the loop control outputs

                time_us                   : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                roll_ailerons             : Control output -3 .. 1 (float)
                pitch_elevator            : Control output -1 .. 1 (float)
                yaw_rudder                : Control output -1 .. 1 (float)
                throttle                  : Throttle 0 .. 1 (float)
                mode                      : System mode (MAV_MODE) (uint8_t)
                nav_mode                  : Navigation mode (MAV_NAV_MODE) (uint8_t)

                '''
                msg = MAVLink_hil_controls_message(time_us, roll_ailerons, pitch_elevator, yaw_rudder, throttle, mode, nav_mode)
                msg.pack(self)
                return msg
            
        def hil_controls_send(self, time_us, roll_ailerons, pitch_elevator, yaw_rudder, throttle, mode, nav_mode):
                '''
                Hardware in the loop control outputs

                time_us                   : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
                roll_ailerons             : Control output -3 .. 1 (float)
                pitch_elevator            : Control output -1 .. 1 (float)
                yaw_rudder                : Control output -1 .. 1 (float)
                throttle                  : Throttle 0 .. 1 (float)
                mode                      : System mode (MAV_MODE) (uint8_t)
                nav_mode                  : Navigation mode (MAV_NAV_MODE) (uint8_t)

                '''
                return self.send(self.hil_controls_encode(time_us, roll_ailerons, pitch_elevator, yaw_rudder, throttle, mode, nav_mode))
            
        def manual_control_encode(self, target, roll, pitch, yaw, thrust, roll_manual, pitch_manual, yaw_manual, thrust_manual):
                '''
                

                target                    : The system to be controlled (uint8_t)
                roll                      : roll (float)
                pitch                     : pitch (float)
                yaw                       : yaw (float)
                thrust                    : thrust (float)
                roll_manual               : roll control enabled auto:0, manual:1 (uint8_t)
                pitch_manual              : pitch auto:0, manual:1 (uint8_t)
                yaw_manual                : yaw auto:0, manual:1 (uint8_t)
                thrust_manual             : thrust auto:0, manual:1 (uint8_t)

                '''
                msg = MAVLink_manual_control_message(target, roll, pitch, yaw, thrust, roll_manual, pitch_manual, yaw_manual, thrust_manual)
                msg.pack(self)
                return msg
            
        def manual_control_send(self, target, roll, pitch, yaw, thrust, roll_manual, pitch_manual, yaw_manual, thrust_manual):
                '''
                

                target                    : The system to be controlled (uint8_t)
                roll                      : roll (float)
                pitch                     : pitch (float)
                yaw                       : yaw (float)
                thrust                    : thrust (float)
                roll_manual               : roll control enabled auto:0, manual:1 (uint8_t)
                pitch_manual              : pitch auto:0, manual:1 (uint8_t)
                yaw_manual                : yaw auto:0, manual:1 (uint8_t)
                thrust_manual             : thrust auto:0, manual:1 (uint8_t)

                '''
                return self.send(self.manual_control_encode(target, roll, pitch, yaw, thrust, roll_manual, pitch_manual, yaw_manual, thrust_manual))
            
        def rc_channels_override_encode(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw):
                '''
                The RAW values of the RC channels sent to the MAV to override info
                received from the RC radio. A value of -1 means no
                change to that channel. A value of 0 means control of
                that channel should be released back to the RC radio.
                The standard PPM modulation is as follows: 1000
                microseconds: 0%, 2000 microseconds: 100%. Individual
                receivers/transmitters might violate this
                specification.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                chan1_raw                 : RC channel 1 value, in microseconds (uint16_t)
                chan2_raw                 : RC channel 2 value, in microseconds (uint16_t)
                chan3_raw                 : RC channel 3 value, in microseconds (uint16_t)
                chan4_raw                 : RC channel 4 value, in microseconds (uint16_t)
                chan5_raw                 : RC channel 5 value, in microseconds (uint16_t)
                chan6_raw                 : RC channel 6 value, in microseconds (uint16_t)
                chan7_raw                 : RC channel 7 value, in microseconds (uint16_t)
                chan8_raw                 : RC channel 8 value, in microseconds (uint16_t)

                '''
                msg = MAVLink_rc_channels_override_message(target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw)
                msg.pack(self)
                return msg
            
        def rc_channels_override_send(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw):
                '''
                The RAW values of the RC channels sent to the MAV to override info
                received from the RC radio. A value of -1 means no
                change to that channel. A value of 0 means control of
                that channel should be released back to the RC radio.
                The standard PPM modulation is as follows: 1000
                microseconds: 0%, 2000 microseconds: 100%. Individual
                receivers/transmitters might violate this
                specification.

                target_system             : System ID (uint8_t)
                target_component          : Component ID (uint8_t)
                chan1_raw                 : RC channel 1 value, in microseconds (uint16_t)
                chan2_raw                 : RC channel 2 value, in microseconds (uint16_t)
                chan3_raw                 : RC channel 3 value, in microseconds (uint16_t)
                chan4_raw                 : RC channel 4 value, in microseconds (uint16_t)
                chan5_raw                 : RC channel 5 value, in microseconds (uint16_t)
                chan6_raw                 : RC channel 6 value, in microseconds (uint16_t)
                chan7_raw                 : RC channel 7 value, in microseconds (uint16_t)
                chan8_raw                 : RC channel 8 value, in microseconds (uint16_t)

                '''
                return self.send(self.rc_channels_override_encode(target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw))
            
        def global_position_int_encode(self, lat, lon, alt, vx, vy, vz):
                '''
                The filtered global position (e.g. fused GPS and accelerometers). The
                position is in GPS-frame (right-handed, Z-up)

                lat                       : Latitude, expressed as * 1E7 (int32_t)
                lon                       : Longitude, expressed as * 1E7 (int32_t)
                alt                       : Altitude in meters, expressed as * 1000 (millimeters) (int32_t)
                vx                        : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t)
                vy                        : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t)
                vz                        : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t)

                '''
                msg = MAVLink_global_position_int_message(lat, lon, alt, vx, vy, vz)
                msg.pack(self)
                return msg
            
        def global_position_int_send(self, lat, lon, alt, vx, vy, vz):
                '''
                The filtered global position (e.g. fused GPS and accelerometers). The
                position is in GPS-frame (right-handed, Z-up)

                lat                       : Latitude, expressed as * 1E7 (int32_t)
                lon                       : Longitude, expressed as * 1E7 (int32_t)
                alt                       : Altitude in meters, expressed as * 1000 (millimeters) (int32_t)
                vx                        : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t)
                vy                        : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t)
                vz                        : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t)

                '''
                return self.send(self.global_position_int_encode(lat, lon, alt, vx, vy, vz))
            
        def vfr_hud_encode(self, airspeed, groundspeed, heading, throttle, alt, climb):
                '''
                Metrics typically displayed on a HUD for fixed wing aircraft

                airspeed                  : Current airspeed in m/s (float)
                groundspeed               : Current ground speed in m/s (float)
                heading                   : Current heading in degrees, in compass units (0..360, 0=north) (int16_t)
                throttle                  : Current throttle setting in integer percent, 0 to 100 (uint16_t)
                alt                       : Current altitude (MSL), in meters (float)
                climb                     : Current climb rate in meters/second (float)

                '''
                msg = MAVLink_vfr_hud_message(airspeed, groundspeed, heading, throttle, alt, climb)
                msg.pack(self)
                return msg
            
        def vfr_hud_send(self, airspeed, groundspeed, heading, throttle, alt, climb):
                '''
                Metrics typically displayed on a HUD for fixed wing aircraft

                airspeed                  : Current airspeed in m/s (float)
                groundspeed               : Current ground speed in m/s (float)
                heading                   : Current heading in degrees, in compass units (0..360, 0=north) (int16_t)
                throttle                  : Current throttle setting in integer percent, 0 to 100 (uint16_t)
                alt                       : Current altitude (MSL), in meters (float)
                climb                     : Current climb rate in meters/second (float)

                '''
                return self.send(self.vfr_hud_encode(airspeed, groundspeed, heading, throttle, alt, climb))
            
        def command_encode(self, target_system, target_component, command, confirmation, param1, param2, param3, param4):
                '''
                Send a command with up to four parameters to the MAV

                target_system             : System which should execute the command (uint8_t)
                target_component          : Component which should execute the command, 0 for all components (uint8_t)
                command                   : Command ID, as defined by MAV_CMD enum. (uint8_t)
                confirmation              : 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) (uint8_t)
                param1                    : Parameter 1, as defined by MAV_CMD enum. (float)
                param2                    : Parameter 2, as defined by MAV_CMD enum. (float)
                param3                    : Parameter 3, as defined by MAV_CMD enum. (float)
                param4                    : Parameter 4, as defined by MAV_CMD enum. (float)

                '''
                msg = MAVLink_command_message(target_system, target_component, command, confirmation, param1, param2, param3, param4)
                msg.pack(self)
                return msg
            
        def command_send(self, target_system, target_component, command, confirmation, param1, param2, param3, param4):
                '''
                Send a command with up to four parameters to the MAV

                target_system             : System which should execute the command (uint8_t)
                target_component          : Component which should execute the command, 0 for all components (uint8_t)
                command                   : Command ID, as defined by MAV_CMD enum. (uint8_t)
                confirmation              : 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) (uint8_t)
                param1                    : Parameter 1, as defined by MAV_CMD enum. (float)
                param2                    : Parameter 2, as defined by MAV_CMD enum. (float)
                param3                    : Parameter 3, as defined by MAV_CMD enum. (float)
                param4                    : Parameter 4, as defined by MAV_CMD enum. (float)

                '''
                return self.send(self.command_encode(target_system, target_component, command, confirmation, param1, param2, param3, param4))
            
        def command_ack_encode(self, command, result):
                '''
                Report status of a command. Includes feedback wether the command was
                executed

                command                   : Current airspeed in m/s (float)
                result                    : 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION (float)

                '''
                msg = MAVLink_command_ack_message(command, result)
                msg.pack(self)
                return msg
            
        def command_ack_send(self, command, result):
                '''
                Report status of a command. Includes feedback wether the command was
                executed

                command                   : Current airspeed in m/s (float)
                result                    : 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION (float)

                '''
                return self.send(self.command_ack_encode(command, result))
            
        def optical_flow_encode(self, time, sensor_id, flow_x, flow_y, quality, ground_distance):
                '''
                Optical flow from a flow sensor (e.g. optical mouse sensor)

                time                      : Timestamp (UNIX) (uint64_t)
                sensor_id                 : Sensor ID (uint8_t)
                flow_x                    : Flow in pixels in x-sensor direction (int16_t)
                flow_y                    : Flow in pixels in y-sensor direction (int16_t)
                quality                   : Optical flow quality / confidence. 0: bad, 255: maximum quality (uint8_t)
                ground_distance           : Ground distance in meters (float)

                '''
                msg = MAVLink_optical_flow_message(time, sensor_id, flow_x, flow_y, quality, ground_distance)
                msg.pack(self)
                return msg
            
        def optical_flow_send(self, time, sensor_id, flow_x, flow_y, quality, ground_distance):
                '''
                Optical flow from a flow sensor (e.g. optical mouse sensor)

                time                      : Timestamp (UNIX) (uint64_t)
                sensor_id                 : Sensor ID (uint8_t)
                flow_x                    : Flow in pixels in x-sensor direction (int16_t)
                flow_y                    : Flow in pixels in y-sensor direction (int16_t)
                quality                   : Optical flow quality / confidence. 0: bad, 255: maximum quality (uint8_t)
                ground_distance           : Ground distance in meters (float)

                '''
                return self.send(self.optical_flow_encode(time, sensor_id, flow_x, flow_y, quality, ground_distance))
            
        def object_detection_event_encode(self, time, object_id, type, name, quality, bearing, distance):
                '''
                Object has been detected

                time                      : Timestamp in milliseconds since system boot (uint32_t)
                object_id                 : Object ID (uint16_t)
                type                      : Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal (uint8_t)
                name                      : Name of the object as defined by the detector (char)
                quality                   : Detection quality / confidence. 0: bad, 255: maximum confidence (uint8_t)
                bearing                   : Angle of the object with respect to the body frame in NED coordinates in radians. 0: front (float)
                distance                  : Ground distance in meters (float)

                '''
                msg = MAVLink_object_detection_event_message(time, object_id, type, name, quality, bearing, distance)
                msg.pack(self)
                return msg
            
        def object_detection_event_send(self, time, object_id, type, name, quality, bearing, distance):
                '''
                Object has been detected

                time                      : Timestamp in milliseconds since system boot (uint32_t)
                object_id                 : Object ID (uint16_t)
                type                      : Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal (uint8_t)
                name                      : Name of the object as defined by the detector (char)
                quality                   : Detection quality / confidence. 0: bad, 255: maximum confidence (uint8_t)
                bearing                   : Angle of the object with respect to the body frame in NED coordinates in radians. 0: front (float)
                distance                  : Ground distance in meters (float)

                '''
                return self.send(self.object_detection_event_encode(time, object_id, type, name, quality, bearing, distance))
            
        def debug_vect_encode(self, name, usec, x, y, z):
                '''
                

                name                      : Name (char)
                usec                      : Timestamp (uint64_t)
                x                         : x (float)
                y                         : y (float)
                z                         : z (float)

                '''
                msg = MAVLink_debug_vect_message(name, usec, x, y, z)
                msg.pack(self)
                return msg
            
        def debug_vect_send(self, name, usec, x, y, z):
                '''
                

                name                      : Name (char)
                usec                      : Timestamp (uint64_t)
                x                         : x (float)
                y                         : y (float)
                z                         : z (float)

                '''
                return self.send(self.debug_vect_encode(name, usec, x, y, z))
            
        def named_value_float_encode(self, name, value):
                '''
                Send a key-value pair as float. The use of this message is discouraged
                for normal packets, but a quite efficient way for
                testing new messages and getting experimental debug
                output.

                name                      : Name of the debug variable (char)
                value                     : Floating point value (float)

                '''
                msg = MAVLink_named_value_float_message(name, value)
                msg.pack(self)
                return msg
            
        def named_value_float_send(self, name, value):
                '''
                Send a key-value pair as float. The use of this message is discouraged
                for normal packets, but a quite efficient way for
                testing new messages and getting experimental debug
                output.

                name                      : Name of the debug variable (char)
                value                     : Floating point value (float)

                '''
                return self.send(self.named_value_float_encode(name, value))
            
        def named_value_int_encode(self, name, value):
                '''
                Send a key-value pair as integer. The use of this message is
                discouraged for normal packets, but a quite efficient
                way for testing new messages and getting experimental
                debug output.

                name                      : Name of the debug variable (char)
                value                     : Signed integer value (int32_t)

                '''
                msg = MAVLink_named_value_int_message(name, value)
                msg.pack(self)
                return msg
            
        def named_value_int_send(self, name, value):
                '''
                Send a key-value pair as integer. The use of this message is
                discouraged for normal packets, but a quite efficient
                way for testing new messages and getting experimental
                debug output.

                name                      : Name of the debug variable (char)
                value                     : Signed integer value (int32_t)

                '''
                return self.send(self.named_value_int_encode(name, value))
            
        def statustext_encode(self, severity, text):
                '''
                Status text message. These messages are printed in yellow in the COMM
                console of QGroundControl. WARNING: They consume quite
                some bandwidth, so use only for important status and
                error messages. If implemented wisely, these messages
                are buffered on the MCU and sent only at a limited
                rate (e.g. 10 Hz).

                severity                  : Severity of status, 0 = info message, 255 = critical fault (uint8_t)
                text                      : Status text message, without null termination character (int8_t)

                '''
                msg = MAVLink_statustext_message(severity, text)
                msg.pack(self)
                return msg
            
        def statustext_send(self, severity, text):
                '''
                Status text message. These messages are printed in yellow in the COMM
                console of QGroundControl. WARNING: They consume quite
                some bandwidth, so use only for important status and
                error messages. If implemented wisely, these messages
                are buffered on the MCU and sent only at a limited
                rate (e.g. 10 Hz).

                severity                  : Severity of status, 0 = info message, 255 = critical fault (uint8_t)
                text                      : Status text message, without null termination character (int8_t)

                '''
                return self.send(self.statustext_encode(severity, text))
            
        def debug_encode(self, ind, value):
                '''
                Send a debug value. The index is used to discriminate between values.
                These values show up in the plot of QGroundControl as
                DEBUG N.

                ind                       : index of debug variable (uint8_t)
                value                     : DEBUG value (float)

                '''
                msg = MAVLink_debug_message(ind, value)
                msg.pack(self)
                return msg
            
        def debug_send(self, ind, value):
                '''
                Send a debug value. The index is used to discriminate between values.
                These values show up in the plot of QGroundControl as
                DEBUG N.

                ind                       : index of debug variable (uint8_t)
                value                     : DEBUG value (float)

                '''
                return self.send(self.debug_encode(ind, value))