Extend AeroAlign with mixed CoG planning and telemetry base

This commit is contained in:
2026-03-11 23:14:33 +01:00
parent 538c3081bf
commit 56890272a0
28 changed files with 1631 additions and 1332 deletions
+46
View File
@@ -0,0 +1,46 @@
// SkyLogic AeroAlign - Shared telemetry protocol
//
// Common ESP-NOW payload format shared by Master and all remote devices.
#ifndef TELEMETRY_PROTOCOL_H
#define TELEMETRY_PROTOCOL_H
#include <Arduino.h>
enum DeviceType : uint8_t {
DEVICE_TYPE_UNKNOWN = 0x00,
DEVICE_TYPE_IMU = 0x01,
DEVICE_TYPE_COG_SCALE = 0x02,
DEVICE_TYPE_HYBRID = 0x03,
};
inline const char* deviceTypeToString(DeviceType device_type) {
switch (device_type) {
case DEVICE_TYPE_IMU:
return "IMU";
case DEVICE_TYPE_COG_SCALE:
return "CoG Scale";
case DEVICE_TYPE_HYBRID:
return "Hybrid";
default:
return "Unknown";
}
}
// ESP-NOW packet structure shared across all node types.
// IMU nodes use pitch/roll/yaw normally.
// CoG Scale nodes map:
// pitch -> front support weight (g)
// roll -> rear support weight (g)
// yaw -> computed CoG position (mm)
struct __attribute__((packed)) ESPNowPacket {
uint8_t node_id;
uint8_t device_type;
float pitch;
float roll;
float yaw;
uint8_t battery;
uint8_t checksum;
};
#endif // TELEMETRY_PROTOCOL_H