Files
Gimbal/application/robot_def.h
T
SkyLiCoder 9b52a9ec64 refactor: rename opencv module to master_machine, remove old master_process
- Delete modules/master_machine/ (old seasky protocol vision module)
- Rename modules/opencv/ → modules/master_machine/
- Rename opencv.h/c → master_machine.h/c
- Remove master_process.h include from robot_def.h and ins_task.c
- Remove VisionSetAltitude() call from ins_task.c (send not needed)
- Update all #include paths and CMakeLists.txt
2026-05-29 23:52:27 +08:00

68 lines
1.3 KiB
C

#pragma once
#ifndef ROBOT_DEF_H
#define ROBOT_DEF_H
#include "ins_task.h"
#include "stdint.h"
/* 开发板类型定义 */
#define ONE_BOARD // 单板控制整车
//#define VISION_USE_VCP // 使用虚拟串口发送视觉数据
#define VISION_USE_UART // 使用串口发送视觉数据
/* 云台参数 */
#define YAW_CHASSIS_ALIGN_ECD 2711
#define PITCH_HORIZON_ECD 3412
#define PITCH_MAX_ANGLE 0
#define PITCH_MIN_ANGLE 0
/* IMU->云台方向 */
#define GYRO2GIMBAL_DIR_YAW 1
#define GYRO2GIMBAL_DIR_PITCH 1
#define GYRO2GIMBAL_DIR_ROLL 1
#pragma pack(1)
/* 机器人状态 */
typedef enum
{
ROBOT_STOP = 0,
ROBOT_READY,
} Robot_Status_e;
/* 应用状态 */
typedef enum
{
APP_OFFLINE = 0,
APP_ONLINE,
APP_ERROR,
} App_Status_e;
/* 云台模式 */
typedef enum
{
GIMBAL_ZERO_FORCE = 0,
GIMBAL_GYRO_MODE,
} gimbal_mode_e;
/* ---- CMD 发布给 gimbal 的控制数据 ---- */
typedef struct
{
float yaw; // yaw 目标角度 (degrees, multi-turn)
float pitch; // pitch 目标角度 (degrees)
gimbal_mode_e gimbal_mode;
} Gimbal_Ctrl_Cmd_s;
/* ---- gimbal 发布给 CMD 的反馈数据 ---- */
typedef struct
{
attitude_t gimbal_imu_data;
uint16_t yaw_motor_single_round_angle;
uint8_t gimbal_power;
} Gimbal_Upload_Data_s;
#pragma pack()
#endif // !ROBOT_DEF_H