pymavlink

repository·master·Indexed 20 days ago

https://github.com/ardupilot/pymavlink

A Python implementation of the MAVLink protocol used for communicating with drones and autonomous vehicles. It supports MAVLink revisions 1.0 and 2.0 and includes a protocol generator, tools for flight log analysis, and various example scripts for tasks such as message encoding/decoding, bandwidth testing, and accelerometer calibration.

Tokens
7.5K
Snippets
31
Records
45
Agent score
72%

What's inside pymavlink

  1. Overview of pymavlink examples

    master
    The pymavlink repository provides several example scripts for testing, monitoring, and manipulating MAVLink data. These examples cover a range of tasks from low-level message encoding/decoding to high-level data extraction and hardware testing.
  2. Use the Javascript MAVLink implementation

    master

    DEPRECATION WARNING

    As of November 2020, this 'stable' implementation is deprecated. It is recommended to use the 'nextgen' implementation found in the ../javascript/ folder for new projects. This version has known issues with packet attribute conflicts (e.g., packet.id, packet.format) and incorrect packet packing.

    Overview

    This implementation generates npm modules for Node.js based on MAVLink XML manifests. It provides a MAVLink parser that emits events when valid messages are encountered. It is considered 'pre-beta' with a rough API.

  3. Understand the modified status of jspack and long packages

    master

    The jspack and long packages located in generator/javascript/local_modules/ are locally modified copies of the original Node/npm packages. They have been tweaked to ensure compatibility with the requirements of this project.

    When using these packages, be aware that their behavior may differ from the upstream npm versions. For original functionality and documentation, refer to the respective README.md files within the jspack and long folders.

  4. Configure byte order in jspack format strings

    master

    By default, jspack uses network (big-endian) byte order. You can specify a different byte order by using one of the following characters as the first character of your format string:

    • <: little-endian
    • >: big-endian
    • !: network (big-endian) — this is the default if no other character is provided.

    If the first character is not one of these, ! is assumed.

  5. Install pymavlink for users

    master

    The recommended way to install pymavlink is via PyPI using pip. This method ensures that required dependencies are automatically installed.

    Note: pymavlink supports Python 3. Python 2 support has been removed.

    sudo python3 -m pip install --upgrade pymavlink
  6. Install a generated MAVLink module into a Node.js project

    master

    After running the generator, you must manually copy the desired MAVLink protocol version into your project's node_modules folder and install its dependencies.

    Example for mavlink_ardupilotmega_v1.0:

    1. Copy the implementation to your project's node_modules.
    2. Navigate to that directory and run npm install.
    cp -R javascript/implementations/mavlink_ardupilotmega_v1.0 /path/to/my/project/node_modules/
    cd /path/to/my/project/node_modules/mavlink_ardupilotmega_v1.0 && npm install