#pragma once #ifdef __cplusplus extern "C" { #endif /* Includes ----------------------------------------------------------------- */ #include "component\user_math.h" #include "remote_control.h" struct __attribute__((packed)) GimbalToVision { uint8_t head[2]; uint8_t mode; // 0: 空闲, 1: 自瞄, 2: 小符, 3: 大符 float q[4]; // wxyz顺序 /q4,q0,q1,q2/ float yaw; float yaw_vel; float pitch; float pitch_vel; float bullet_speed; uint16_t bullet_count; // 子弹累计发送次数 uint16_t crc16; }; struct __attribute__((packed)) VisionToGimbal { uint8_t head[2]; uint8_t mode; // 0: 不控制, 1: 控制云台但不开火,2: 控制云台且开火 float yaw; float yaw_vel; float yaw_acc; float pitch; float pitch_vel; float pitch_acc; uint16_t crc16; }; typedef struct __attribute__((packed)) { uint8_t mode; struct{ // Gimbal_CMD_t g_cmd; struct{ float yaw; float pit; }setpoint; struct{ float pit; float yaw; }accl; struct{ float pit; float yaw; }vel; }gimbal_t; }AI_cmd_t; typedef struct __attribute__((packed)) { struct GimbalToVision TX; struct VisionToGimbal RX; }AI_t; #ifdef __cplusplus } #endif