mirror of
https://github.com/mavlink/mavlink-devguide.git
synced 2026-06-19 07:36:26 +00:00
Update supported libraries with WLua, JavaScript stable/nextgen (#309)
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
+25
-25
@@ -26,39 +26,41 @@ MAVLink was first released early 2009 by Lorenz Meier and has now a [significant
|
||||
- Very efficient. MAVLink 1 has just 8 bytes overhead per packet, including start sign and packet drop detection. MAVLink 2 has just 14 bytes of overhead (but is a much more secure and extensible protocol).
|
||||
Because MAVLink doesn't require any additional framing it is very well suited for applications with very limited communication bandwidth.
|
||||
- Very reliable. MAVLink has been used since 2009 to communicate between many different vehicles, ground stations (and other nodes) over varied and challenging communication channels (high latency/noise). It provides methods for detecting packet drops, corruption, and for packet authentication.
|
||||
- Supports [many programming languages](#supported_languages), running on numerous microcontrollers/operating systems (including ARM7, ATMega, dsPic, STM32 and Windows, Linux, MacOS, Android and iOS).
|
||||
- [Many different programming languages](#supported_languages) can be used, running on numerous microcontrollers/operating systems (including ARM7, ATMega, dsPic, STM32 and Windows, Linux, MacOS, Android and iOS).
|
||||
- Allows up to 255 concurrent systems on the network (vehicles, ground stations, etc.)
|
||||
- Enables both offboard and onboard communications (e.g. between a GCS and drone, and between drone autopilot and MAVLink enabled drone camera).
|
||||
|
||||
|
||||
## Supported Languages {#supported_languages}
|
||||
## Language/Generator List {#supported_languages}
|
||||
|
||||
The MAVLink project includes the [mavgen](getting_started/generate_libraries.md#mavgen) and [mavgenerate](getting_started/generate_libraries.md#mavgenerate) tools that can be used to create MAVLink libraries for a number of programming languages.
|
||||
Additional generators have been provided by other projects.
|
||||
The MAVLink project includes the [mavgen](getting_started/generate_libraries.md#mavgen) and [mavgenerate](getting_started/generate_libraries.md#mavgenerate) tools that can be used to create MAVLink libraries for a number of programming languages.
|
||||
The organisation also includes [rust-mavlink](https://github.com/mavlink/rust-mavlink) for generating Rust MAVLink libraries.
|
||||
Additional generators are delivered by a number of other (independent) projects.
|
||||
|
||||
> **Note** The MAVLink project has not validated and does not provide technical support for generators other than *mavgen* and *mavgenerate*.
|
||||
> **Note** The MAVLink project has not validated and does not provide technical support for generators other than *mavgen*, *mavgenerate*, and *rust-mavlink*.
|
||||
|
||||
The table below shows the available languages/generators, along with their support for MAVLink v1, [MAVLink 2](guide/mavlink_2.md) and [Message Signing](guide/message_signing.md).
|
||||
|
||||
Language | Generator | MAVLink v1 | MAVLink v2 | Signing | Notes
|
||||
:--- | :--- | :---:| :---: | :---: | :---
|
||||
C | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | Y | Y | This is the MAVLink project reference implementation. [Generated libraries](#prebuilt_libraries) are also published for both protocol versions.
|
||||
C++11 | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | Y | Y |
|
||||
Python (2.7+, 3.3+) | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | Y | Y |
|
||||
C# | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | | |
|
||||
Objective C | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | | |
|
||||
Java | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | | |
|
||||
Java | [dronefleet/mavlink](https://github.com/dronefleet/mavlink) | Y | Y | Y | *Idiomatic* Java SDK/API for MAVLink. Provides a gradle plugin for the code generator.
|
||||
JavaScript | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | Y | N |
|
||||
TypeScript/JavaScript | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | Y | N | TypeScript classes which can be used with [node-mavlink](https://github.com/ifrunistuttgart/node-mavlink)
|
||||
Lua | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | Y | |
|
||||
Swift | [mavgen](getting_started/generate_libraries.md#mavgen) | Y | | |
|
||||
Clojure | [clj-mavlink](https://github.com/WickedShell/clj-mavlink) | Y | Y | Y | Clojure MAVLink Bindings.
|
||||
Go | [gomavlib](https://github.com/gswly/gomavlib) | Y | Y | Y |
|
||||
Go | [go-mavlink1](https://github.com/mgr9525/go-mavlink1) | Y | N | N | Golang MAVLink v1
|
||||
Haskell | [HaskMavlink](https://github.com/SweeWarman/HaskMavlink)| N | Y | N |
|
||||
Rust | [rust-mavlink](https://github.com/mavlink/rust-mavlink)| Y | Y | | Rust MAVLink generated code
|
||||
|
||||
:--- | :--- | :---:| :---: | :---
|
||||
C | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | ✓ | This is the MAVLink project reference implementation. [Generated libraries](#prebuilt_libraries) are also published for both protocol versions.
|
||||
C++11 | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | ✓ | |
|
||||
Python (2.7+, 3.3+) | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | ✓ | Python bindings. Library also available on PyPi: [pymavlink](https://pypi.org/project/pymavlink/).
|
||||
C# | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | | | |
|
||||
Objective C | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | | |
|
||||
Java | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | | | |
|
||||
Java | [dronefleet/mavlink](https://github.com/dronefleet/mavlink) | ✓ | ✓ | ✓ | *Idiomatic* Java SDK/API for MAVLink. Provides a gradle plugin for the code generator.
|
||||
JavaScript (Stable) | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | ✗ | Old mavgen JavaScript binding (has known bugs and no test suite).
|
||||
JavaScript (NextGen) | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | ✓ | New mavgen JavaScript library. Full test suite, resulting library produces binary compatible output compared to C bindings. Slightly incompatible with previous version, but not hard to migrate.
|
||||
TypeScript/JavaScript | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | ✗ | TypeScript classes which can be used with [node-mavlink](https://github.com/ifrunistuttgart/node-mavlink).
|
||||
Lua | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | ✗ | Lua library. Does not support zero trimming of MAVLink 2 messages.
|
||||
WLua (Wireshark Lua bindings)| [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | ✓ | NA | Allow MAVLink-aware packet inspection in Wireshark. Generated lua scripts should be copied to the Wireshark plugin directory (e.g. **wireshark/plugins/mavlink.lua**).
|
||||
Swift | [mavgen](getting_started/generate_libraries.md#mavgen) | ✓ | | |
|
||||
Clojure | [clj-mavlink](https://github.com/WickedShell/clj-mavlink) | ✓ | ✓ | ✓ | Clojure MAVLink Bindings.
|
||||
Go | [gomavlib](https://github.com/gswly/gomavlib) | ✓ | ✓ | ✓ | Go library with support for MAVLink 1, 2 and signing, test suite, and [documentation](https://pkg.go.dev/github.com/aler9/gomavlib)
|
||||
Go | [go-mavlink1](https://github.com/mgr9525/go-mavlink1) | ✓ | ✗| ✗ | Golang MAVLink v1
|
||||
Haskell | [HaskMavlink](https://github.com/SweeWarman/HaskMavlink)| ✗ | ✓ | ✗ |
|
||||
Rust | [rust-mavlink](https://github.com/mavlink/rust-mavlink)| ✓ | ✓ | | Rust MAVLink generated code. Has tests and minimal docs.
|
||||
|
||||
|
||||
## Prebuilt MAVLink C Libraries {#prebuilt_libraries}
|
||||
@@ -96,5 +98,3 @@ The MAVLink protocol is hosted under the governance of the [Dronecode Project](h
|
||||
<a href="https://www.dronecode.org/" style="padding:20px" ><img src="../assets/site/logo_dronecode.png" alt="Dronecode Logo" width="110px"/></a>
|
||||
<a href="https://www.linuxfoundation.org/projects" style="padding:20px;"><img src="../assets/site/logo_linux_foundation.png" alt="Linux Foundation Logo" width="80px" /></a>
|
||||
<div style="padding:10px"> </div>
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,13 @@ Generator Steps:
|
||||
> **Note** If using a custom dialect, first copy it into the above directory (if the dialect is dependent on **common.xml** it must be located in the same directory).
|
||||
1. Choose an output directory (e.g. **mavlink/include**).
|
||||
1. Select the target output programming language.
|
||||
|
||||

|
||||
|
||||
> **Note** There are three JavaScript options:
|
||||
- `JavaScript_Stable` is an older version that only supports MAVLink 1.0,
|
||||
- `JavaScript_NextGen` is a more recent version that supports MAVLink 1 and 2 along with signing.
|
||||
- `JavaScript` is a "proxy" for the recommended version. Currently this is `JavaScript_Stable`.
|
||||
1. Select the target MAVLink protocol version (ideally 2.0)
|
||||
> **Caution** Generation will fail if the protocol is not [supported](../README.md#supported_languages) by the selected programming language.
|
||||
1. Optionally check *Validate* and/or *Validate Units* (if checked validates XML specifications).
|
||||
@@ -46,8 +53,8 @@ Generator Steps:
|
||||
|
||||
## Mavgen (Command Line) {#mavgen}
|
||||
|
||||
**mavgen.py** is a command-line tool for generating MAVLink libraries for different programming languages.
|
||||
After the `mavlink` directory has been added to the `PYTHONPATH`, it can be run by executing from the command line.
|
||||
**mavgen.py** is a command-line tool for generating MAVLink libraries for different programming languages.
|
||||
After the `mavlink` directory has been added to the `PYTHONPATH`, it can be run by executing from the command line.
|
||||
|
||||
> **Tip** This is the backend used by [mavgenerate](#mavgenerate). The documentation below explains all the options for both tools.
|
||||
|
||||
@@ -63,7 +70,7 @@ python3 -m pymavlink.tools.mavgen --lang=C --wire-protocol=2.0 --output=generate
|
||||
The full syntax and options can be output by running *mavgen* with the `-h` flag (reproduced below):
|
||||
```
|
||||
usage: mavgen.py [-h] [-o OUTPUT]
|
||||
[--lang {C,CS,JavaScript,TypeScript,Python,WLua,ObjC,Swift,Java,C++11}]
|
||||
[--lang {C,CS,JavaScript,JavaScript_Stable,JavaScript_NextGen,TypeScript,Python,Lua,WLua,ObjC,Swift,Java,C++11}]
|
||||
[--wire-protocol {0.9,1.0,2.0}] [--no-validate]
|
||||
[--error-limit ERROR_LIMIT] [--strict-units]
|
||||
XML [XML ...]
|
||||
@@ -77,7 +84,7 @@ optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-o OUTPUT, --output OUTPUT
|
||||
output directory.
|
||||
--lang {C,CS,JavaScript,TypeScript,Python,WLua,ObjC,Swift,Java,C++11}
|
||||
--lang {C,CS,JavaScript,JavaScript_Stable,JavaScript_NextGen,TypeScript,Python,Lua,WLua,ObjC,Swift,Java,C++11}
|
||||
language of generated code [default: Python]
|
||||
--wire-protocol {0.9,1.0,2.0}
|
||||
MAVLink protocol version. [default: 1.0]
|
||||
|
||||
Reference in New Issue
Block a user