Dizel 26fc24ae0d Переписанная рабочая версия
Переделал код c++/cli на новый лад как в c# client
2025-04-09 15:49:27 +03:00

77 lines
1.4 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,
DataIMU = 1001, DataPos = 1002,
DataMotor4 = 2001, DataMotor6 = 2002
};
public value struct DataHead
{
public:
int Size;
DataMode Mode;
DataType Type;
static const int StrLen = sizeof(DataHead);
};
public value struct XYZ
{
public:
float X, Y, Z;
};
public value struct DataIMU
{
public:
DataHead Head;
XYZ Acc, Gyr, Mag;
static const int StrLen = sizeof(DataIMU);
};
public value struct DataPos
{
public:
DataHead Head;
XYZ Local;
float LiDAR;
static const int StrLen = sizeof(DataPos);
};
public value struct DataMotor4
{
public:
DataHead Head;
unsigned long long Count;
float UL, UR, DL, DR;
static const int StrLen = sizeof(DataMotor4);
};
public value struct DataMotor6
{
public:
DataHead Head;
unsigned long long Count;
float UL, UR, LL, RR, DL, DR;
static const int StrLen = sizeof(DataMotor6);
};
}