2025-04-11 21:59:06 +03:00

117 lines
2.0 KiB
C++

#pragma once
#include <Windows.h>
#include <vcclr.h>
using namespace System;
using namespace System::Runtime::InteropServices;
namespace DroneData {
public enum class DataMode : unsigned short
{
None = 0, Response = 1, Request = 2
};
public enum class DataType : unsigned short
{
None = 0, Head = 1,
// Output
DataAcc = 1001, DataGyr = 1002, DataMag = 1003, DataRange = 1004, DataLocal = 1005,
// Input
DataMotor4 = 2001, DataMotor6 = 2002
};
public value struct DataHead
{
public:
long Size;
DataMode Mode;
DataType Type;
unsigned long Time;
static const int StrLen = sizeof(DataHead);
};
public value struct XYZ
{
public:
float X, Y, Z;
};
public value struct DataAcc
{
public:
DataHead Head;
XYZ Acc;
unsigned long Time;
static const int StrLen = sizeof(DataAcc);
};
public value struct DataGyr
{
public:
DataHead Head;
XYZ Gyr;
unsigned long Time;
static const int StrLen = sizeof(DataGyr);
};
public value struct DataMag
{
public:
DataHead Head;
XYZ Mag;
unsigned long Time;
static const int StrLen = sizeof(DataMag);
};
public value struct DataRange
{
public:
DataHead Head;
float LiDAR;
unsigned long Time;
static const int StrLen = sizeof(DataRange);
};
public value struct DataLocal
{
public:
DataHead Head;
XYZ Local;
unsigned long Time;
static const int StrLen = sizeof(DataLocal);
};
public value struct DataMotor4
{
public:
DataHead Head;
float UL, UR, DL, DR;
static const int StrLen = sizeof(DataMotor4);
};
public value struct DataMotor6
{
public:
DataHead Head;
float UL, UR, LL, RR, DL, DR;
static const int StrLen = sizeof(DataMotor6);
};
}