libs/kaptan-mavlink: add MAVLink library
Signed-off-by: Onur Özkan <work@onurozkan.dev>
This commit is contained in:
1 parent
63f6c24557
commit
06327c694a
7 files changed
+265
-4
No files matched your search
@@ -0,0 +1,25 @@
|
||||
[package]
|
||||
name = "kaptan-mavlink"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
version.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
default = ["dialect-kaptan"]
|
||||
dialect-kaptan = []
|
||||
|
||||
[dependencies]
|
||||
mavlink = { version = "0.18", default-features = false, features = ["embedded", "dialect-common"] }
|
||||
mavlink-core = { version = "0.18", default-features = false, features = ["embedded"] }
|
||||
bitflags = "2"
|
||||
num-derive = "0.4"
|
||||
num-traits = "0.2"
|
||||
|
||||
[build-dependencies]
|
||||
kaptan-spec = { path = "../kaptan-spec", features = ["std"] }
|
||||
mavlink-bindgen = "0.18"
|
||||
@@ -0,0 +1,16 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
kaptan_spec::validate_package();
|
||||
|
||||
let manifest_directory = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
|
||||
let dialect = manifest_directory.join("definitions/kaptan.xml");
|
||||
let output_directory = std::env::var("OUT_DIR").unwrap();
|
||||
let generated = mavlink_bindgen::generate(
|
||||
mavlink_bindgen::XmlDefinitions::Files(vec![dialect]),
|
||||
output_directory,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
mavlink_bindgen::emit_cargo_build_messages(&generated);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<mavlink>
|
||||
<version>3</version>
|
||||
<dialect>0</dialect>
|
||||
|
||||
<!-- Special enums and messages for Kaptan. -->
|
||||
<enums/>
|
||||
<messages/>
|
||||
</mavlink>
|
||||
@@ -0,0 +1,11 @@
|
||||
//! MAVLink support for Kaptan.
|
||||
|
||||
#![no_std]
|
||||
|
||||
/// Supported MAVLink message types for Kaptan.
|
||||
pub mod message {
|
||||
pub use mavlink::MAVLinkV2MessageRaw;
|
||||
pub use mavlink::dialects::common::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/mod.rs"));
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# --- version: 0.1.0 ---
|
||||
|
||||
---
|
||||
title: MAVLink Support for Kaptan
|
||||
status: in-progress
|
||||
owners:
|
||||
- Onur Özkan <work@onurozkan.dev>
|
||||
---
|
||||
|
||||
## TODO
|
||||
Reference in new issue
Block a user