Skip to main content

Parsers for UAV/Aerial Drone-related formats like MavLink and DataFlash

Project description

Test UAVReaders

UAVReaders

Parsers for UAV-related formats like DataFlash and Mavlink

Installation and Usage

This package is available from PyPI. You can install it by doing something like this: pip install UAVReaders.

Currently, prebuilt wheels are available for the majority of Linux distributions and no other operating systems at all.

Example

Here is an example of using data_flash_reader in a script.

import UAVReaders as u 

dfreader = u.data_flash_reader("test_data/dataflash_test.bin")

for packet in dfreader():
    # do something with the packet, which is a dict containing 
	# the values of each field in the original packet.

I would advise you not to keep the packets around for much longer than necessary. Do not save them into a Python list, for example; it will probably take too much memory if your DataFlash file is large. Expect a 50x memory penalty. A 1GB DataFlash file might take up 50GB when each packet is simultaneously in memory because of duplicating packet field names.

Usage from Python by cloning this repository

It is also easy to clone and use this repository as part of a larger project, for example by adding it as a git submodule. There are a few build-time dependencies that you need to install before building the package.

  • regex, install with conda install regex
  • future, install with conda install future
  • cython, also available through conda with conda install cython
  • A working Linux-ish C++ toolchain with make. GCC is what I have been using. It should technically be possible to build natively on windows, but I would just use WSL.

Now, you have to make sure that Git has pulled all the submodules this project requires by running git submodule update --init --recursive.

After that, just cd into the directory and run make pypackage. Import uavreaders.UAVReaders to load it into your python. This provides access to UAVReaders.data_flash_reader, UAVReaders.mavlink_reader, and a few auxiliary functions not needed during normal usage.

Commandline Usage

Running make alone will generate both the python package and two binaries that can be used to transform DataFlash or Mavlink files to JSON. They are called dataflashreader and mavlinkreader and are written to /bin under the project root.

They both have the same interface. They take data through stdin write to stdout and stderr, so you should use them through input redirection. To use dataflashreader under Bash, run something like this:

$ ./bin/dataflashreader <test_data/dataflash_test.bin | gzip >output.json.gz

This reads dataflash packets from testdata/dataflash_test.bin and compresses the output JSON, storing it in output.json.gz. JSON representations of MavLink and Dataflash packets are very large; you will almost always want to compress the output. A one-gigabyte DataFlash .bin file might expand by as much as 50 times on parsing to JSON.

Testing

Run make test to test the functionality of the DataFlash and Mavlink parsers. This compiles the command-line parsing utilities and compares their output against a known-good state.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uavreaders-1.0.4.tar.gz (1.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

uavreaders-1.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

uavreaders-1.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

uavreaders-1.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

uavreaders-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

uavreaders-1.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

UAVReaders-1.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file uavreaders-1.0.4.tar.gz.

File metadata

  • Download URL: uavreaders-1.0.4.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for uavreaders-1.0.4.tar.gz
Algorithm Hash digest
SHA256 f7c11d4e1ddf5a8b845ea3a77aee2904db68102f98f87860906327430c42a745
MD5 2c7aa70b37a048e65ed3f34ebdc70cf1
BLAKE2b-256 bcb883463fbe64575021c7d6223047c3979a0f72a98fca09becff83b28850e0c

See more details on using hashes here.

File details

Details for the file uavreaders-1.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for uavreaders-1.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 912109285d28affa4b7ab98d64add7cab00821641421084c7c975d9e8de661ad
MD5 9cdad8578bc8f1e265cfdef051240310
BLAKE2b-256 7419710a6ff684ee920e17bc34512f80756ffdb3c7093d8414ecbee637d903fd

See more details on using hashes here.

File details

Details for the file uavreaders-1.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for uavreaders-1.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b61e91a5b013337f61cc9beef8290ef0ca1862962d965896c95728c522e48255
MD5 e38f91630e5c251f74d07e8a4a9c9487
BLAKE2b-256 0f57cc155506f5aaf29285a66fd202eaa84ad5dfee4b2e647daa4103ae61daa8

See more details on using hashes here.

File details

Details for the file uavreaders-1.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for uavreaders-1.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 acd59fded57fde5a10d8a96ddc4bc7fd317c60ac48279729203e36006492f866
MD5 267480b9710cd76657ffd6c51eb3ab89
BLAKE2b-256 c2c0dc077e94984d1a1e30c8057b1920c91f3ac66c95329e8dfe9f7ac975d18b

See more details on using hashes here.

File details

Details for the file uavreaders-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for uavreaders-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b8e746bfaeea5d6aa943be60977dac1e335d1d326b92d4af629afd98bc679f85
MD5 682cba5c2ea0c2eb4673eda3f5052fad
BLAKE2b-256 514fd35b707284e063531608b0a99d9f686b47353d27c3c6cc88a409b3f4c845

See more details on using hashes here.

File details

Details for the file uavreaders-1.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for uavreaders-1.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 66d453685b66af7d785b1eae6bd2ed34c20e59b46afe75529d85351f160ebd01
MD5 7a24f083050c87d1ecb13d3a72b760b0
BLAKE2b-256 e843f83dc839bbe7da29417e30e2c77e082a014b63dd75c4c924c093b68d3802

See more details on using hashes here.

File details

Details for the file UAVReaders-1.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for UAVReaders-1.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67c2b1887d5ca11c256b2330cd39c387a1704b3820643bb8f75bc4e0cb2c4e94
MD5 ac39986ef7b51d9518e655ca53a5e1d5
BLAKE2b-256 e78849fde9fa3be570e5ef575e29b16149e1ccd640b13c22147cedd41daa34d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page