GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mavlink/rust-mavlink: MAVLink implementation written in Rust

BranchesTags
Open more actions menu

Latest commit

 

History

609 Commits
609 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
mavlink-bindgen
mavlink-bindgen
 
 
mavlink-core
mavlink-core
 
 
mavlink
mavlink
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE-APACHE
LICENSE-APACHE
 
 
LICENSE-MIT
LICENSE-MIT
 
 
MAINTAINERS.md
MAINTAINERS.md
 
 
README.md
README.md
 
 

Repository files navigation

rust-mavlink

Crate info Crate downloads MSRV License Build status Documentation

Pure Rust implementation of the MAVLink UAV messaging protocol. Provides strongly typed message bindings, frame encode/decode and connection APIs for serial, UDP, TCP, file connection protocols with a rich set of features.

What rust-mavlink provides

  • Rust bindings for MAVLink dialects
  • Read/write support for MAVLink v1 and v2
  • TCP, UDP, Serial and File connection support.
  • Signing support.
  • Blocking and async support.
  • std and embedded support.
  • Codegen tool mavlink-bindgen for creating Rust bindings from MAVLink XML dialect definitions.

Workspace crates

Crate Purpose
mavlink Main crate with generated dialect modules and high-level APIs
mavlink-core Core protocol types, parser/serializer, and connection traits
mavlink-bindgen XML-to-Rust code generator used by mavlink

Quick start

Add the crate:

[dependencies]
mavlink = "0.21"

Simple code example:

use mavlink::{dialects::ardupilotmega, MavConnection};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let conn = mavlink::connect::<ardupilotmega::MavMessage>("udpin:0.0.0.0:14550")?;

    let heartbeat = ardupilotmega::MavMessage::HEARTBEAT(ardupilotmega::HEARTBEAT_DATA {
        custom_mode: 0,
        mavtype: ardupilotmega::MavType::MAV_TYPE_QUADROTOR,
        autopilot: ardupilotmega::MavAutopilot::MAV_AUTOPILOT_ARDUPILOTMEGA,
        base_mode: ardupilotmega::MavModeFlag::empty(),
        system_status: ardupilotmega::MavState::MAV_STATE_STANDBY,
        mavlink_version: 3,
    });

    conn.send(&mavlink::MavHeader::default(), &heartbeat)?;
    let (header, message) = conn.recv()?;

    println!(
        "received from sys={}, comp={}: {message:?}",
        header.system_id, header.component_id
    );

    Ok(())
}

Supported address formats

  • tcpin:<addr>:<port>: TCP server
  • tcpout:<addr>:<port>: TCP client
  • udpin:<addr>:<port>: UDP listener
  • udpout:<addr>:<port>: UDP sender
  • udpbcast:<addr>:<port>: UDP broadcast sender
  • serial:<port>:<baudrate>: serial port connection
  • file:<path>: read MAVLink frames from a file

Dialects

Compile-time dialects

Features such as dialect-ardupilotmega and dialect-common generate strongly typed Rust messages from XML definitions during the build. Use these when the message set is known at compile time. Changing the definitions requires rebuilding the application.

Runtime dialects

The dialect-dynamic feature loads dialect XML definitions at runtime.

Runtime dialects are required when an application takes its dialect at runtime (e.g. from user configuration) and rebuilding the application for each custom dialect is not possible.

See the runtime-dialect example for usage and testing it.

Feature flags

Transport and runtime:

  • embedded
  • std
  • tokio
  • transport-direct-serial
  • transport-tcp
  • transport-udp

Protocol and code generation:

  • arbitrary
  • format-generated-code
  • mav2-message-extensions
  • mav2-message-signing
  • serde
  • ts-rs
  • wip-messages

Dialects:

  • dialect-all
  • dialect-ardupilotmega
  • dialect-asluav
  • dialect-avssuas
  • dialect-common
  • dialect-csairlink
  • dialect-cubepilot
  • dialect-development
  • dialect-dynamic (unlike the generated dialects, loads dialects at runtime)
  • dialect-icarous
  • dialect-loweheiser
  • dialect-marsh
  • dialect-minimal
  • dialect-paparazzi
  • dialect-python_array_test
  • dialect-standard
  • dialect-stemstudios
  • dialect-storm32
  • dialect-test
  • dialect-ualberta
  • dialect-uavionix

Note that std and embedded features are mutually exclusive.

Examples

See mavlink/examples/ for runnable examples.

Maintainers

See MAINTAINERS.md for active maintainers, release managers and contact details.

License

Licensed under either of:

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.

About

MAVLink implementation written in Rust

mavlink.github.io/rust-mavlink/mavlink/

Topics

hacktoberfestmavlinkrust

Resources

Readme
Activity
Custom properties

Stars

299 stars

Watchers

25 watching

Forks

118 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.