Added handler for turreted drones to share multiple camera components to UAS Tool

This commit is contained in:
2026-05-09 11:58:44 -03:00
parent 3c37185c1a
commit dcc9e1d469
12 changed files with 1200 additions and 139 deletions
+18 -3
View File
@@ -1,6 +1,4 @@
use super::constants::{
MAV_TYPE_FIXED_WING, MAV_TYPE_HELICOPTER, MAV_TYPE_QUADROTOR,
};
use super::constants::{MAV_TYPE_FIXED_WING, MAV_TYPE_HELICOPTER, MAV_TYPE_QUADROTOR};
pub(crate) fn map_vehicle_type(vehicle_type: u8) -> u8 {
match vehicle_type {
@@ -25,6 +23,23 @@ pub(crate) fn stable_system_id(entity_uuid: &str) -> u8 {
((hash % 250) as u8) + 1
}
pub(crate) fn stable_mavlink_identity(callsign: &str, entity_uuid: &str) -> String {
let mut identity = callsign.trim().to_string();
for suffix in [" [ON]", " [OFF]"] {
if identity.ends_with(suffix) {
identity.truncate(identity.len() - suffix.len());
break;
}
}
if identity.is_empty() {
entity_uuid.trim().to_string()
} else {
identity
}
}
fn uuid16(entity_uuid: &str) -> [u8; 16] {
let hex = entity_uuid.replace('-', "");
let mut bytes = [0u8; 16];