#uav #drones #parser #mav-link

bin+lib mavinspect

MAVInspect is a CLI tool and a library to parse and inspect MAVLink protocol XML definitions

1 unstable release

0.1.0-alpha2 Nov 13, 2023
0.1.0-alpha1 Nov 6, 2023

#99 in Robotics

Download history 47/week @ 2023-11-04 26/week @ 2023-11-11 6/week @ 2023-11-18 6/week @ 2023-11-25

85 downloads per month

MIT/Apache

4.5MB
29K SLoC

Python 17K SLoC // 0.3% comments JavaScript 4.5K SLoC // 0.3% comments Rust 3.5K SLoC // 0.0% comments Swift 766 SLoC // 0.3% comments C# 761 SLoC // 0.1% comments Java 592 SLoC // 0.2% comments C 456 SLoC // 0.1% comments Shell 368 SLoC // 0.2% comments Ada 322 SLoC // 0.0% comments XSL 316 SLoC C++ 169 SLoC // 0.1% comments Visual Studio Project 91 SLoC PHP 44 SLoC // 0.3% comments INI 41 SLoC // 0.1% comments Processing 36 SLoC // 0.2% comments Visual Studio Solution 20 SLoC

Contains (Cab file, 16KB) testmav.suo

MAVInspect

MAVLink Inspector is a CLI tool and a library to parse MAVLink protocol XML definitions.

WARNING!!!

This project is intended to be used with other Mavka tools. For now its API will be extremely unstable. Once the library will be successfully consumed by these projects, API will be stabilised.

Examples

use mavinspect::parser::MAVInspector;

fn main() {
  // Instantiate inspector and load list of XML definitions
  let inspector = MAVInspector::new("./message_definitions").unwrap();
  // Parse all XML definitions
  let protocol = inspector.parse().unwrap();
  
  // Get `minimal` dialect
  let minimal = protocol.dialects().get("minimal").unwrap();
  // Get heartbit message
  let heartbeat_message = minimal.messages().get(&0u32).unwrap();
  
  assert_eq!(heartbeat_message.name(), "HEARTBEAT");
  println!("`HEARTBEAT` message: {:?}", heartbeat_message);
}

Docs

Documentation can be found here.

CLI Interface

List dialects:

mavinspect [--src <PATH TO MESSAGE DEINITIONS>] ls

Parse dialects:

mavinspect [--src <PATH TO MESSAGE DEINITIONS>] parse [--dst <PATH TO DESTINATION DIRECTORY>]

Start gRPC server to serve MAVLink definitions:

mavinspect [--src <PATH TO MESSAGE DEINITIONS>] serve

Roadmap

Basics (required before publishing non-alpha version)

  • Load and deserialize from JSON for server.
  • Add examples to docs.

DevOps

  • Release mavinspect binary.
  • Release mavinspect for ARM64 and other architectures.

Next release (for v0.2.0)

  • Multiple folders for XML definitions.

Planned improvements

  • Watch message definitions and reload server on changes.
  • Add standalone examples.

License

Here we simply comply with the suggested dual licensing according to Rust API Guidelines (C-PERMISSIVE).

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~5–16MB
~197K SLoC