mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 03:27:45 +08:00
添加裁判系统串口,修复关节复位bug
This commit is contained in:
@@ -88,16 +88,16 @@ typedef enum
|
||||
/* 命令码数据段长,根据官方协议来定义长度,还有自定义数据长度 */
|
||||
typedef enum
|
||||
{
|
||||
LEN_game_state = 3, // 0x0001
|
||||
LEN_game_state = 11, // 0x0001
|
||||
LEN_game_result = 1, // 0x0002
|
||||
LEN_game_robot_HP = 2, // 0x0003
|
||||
LEN_game_robot_HP = 32, // 0x0003
|
||||
LEN_event_data = 4, // 0x0101
|
||||
LEN_supply_projectile_action = 4, // 0x0102
|
||||
LEN_game_robot_state = 27, // 0x0201
|
||||
LEN_power_heat_data = 14, // 0x0202
|
||||
LEN_game_robot_state = 13, // 0x0201
|
||||
LEN_power_heat_data = 16, // 0x0202
|
||||
LEN_game_robot_pos = 16, // 0x0203
|
||||
LEN_buff_musk = 1, // 0x0204
|
||||
LEN_aerial_robot_energy = 1, // 0x0205
|
||||
LEN_buff_musk = 6, // 0x0204
|
||||
LEN_aerial_robot_energy = 2, // 0x0205
|
||||
LEN_robot_hurt = 1, // 0x0206
|
||||
LEN_shoot_data = 7, // 0x0207
|
||||
LEN_receive_data = 6 + Communicate_Data_LEN, // 0x0301
|
||||
@@ -107,12 +107,13 @@ typedef enum
|
||||
/****************************接收数据的详细说明****************************/
|
||||
/****************************接收数据的详细说明****************************/
|
||||
|
||||
/* ID: 0x0001 Byte: 3 比赛状态数据 */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t game_type : 4;
|
||||
uint8_t game_progress : 4;
|
||||
uint16_t stage_remain_time;
|
||||
/* ID: 0x0001 Byte: 11 比赛状态数据 */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t game_type : 4;
|
||||
uint8_t game_progress : 4;
|
||||
uint16_t stage_remain_time;
|
||||
uint64_t SyncTimeStamp;
|
||||
} ext_game_state_t;
|
||||
|
||||
/* ID: 0x0002 Byte: 1 比赛结果数据 */
|
||||
@@ -157,37 +158,31 @@ typedef struct
|
||||
uint8_t supply_projectile_num;
|
||||
} ext_supply_projectile_action_t;
|
||||
|
||||
/* ID: 0X0201 Byte: 27 机器人状态数据 */
|
||||
/* ID: 0X0201 Byte: 13 机器人状态数据 */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t robot_id;
|
||||
uint8_t robot_level;
|
||||
uint16_t remain_HP;
|
||||
uint16_t max_HP;
|
||||
uint16_t shooter_id1_17mm_cooling_rate;
|
||||
uint16_t shooter_id1_17mm_cooling_limit;
|
||||
uint16_t shooter_id1_17mm_speed_limit;
|
||||
uint16_t shooter_id2_17mm_cooling_rate;
|
||||
uint16_t shooter_id2_17mm_cooling_limit;
|
||||
uint16_t shooter_id2_17mm_speed_limit;
|
||||
uint16_t shooter_id1_42mm_cooling_rate;
|
||||
uint16_t shooter_id1_42mm_cooling_limit;
|
||||
uint16_t shooter_id1_42mm_speed_limit;
|
||||
uint16_t chassis_power_limit;
|
||||
uint8_t mains_power_gimbal_output : 1;
|
||||
uint8_t mains_power_chassis_output : 1;
|
||||
uint8_t mains_power_shooter_output : 1;
|
||||
uint8_t robot_id;
|
||||
uint8_t robot_level;
|
||||
uint16_t current_HP;
|
||||
uint16_t maximum_HP;
|
||||
uint16_t shooter_barrel_cooling_value;
|
||||
uint16_t shooter_barrel_heat_limit;
|
||||
uint16_t chassis_power_limit;
|
||||
uint8_t power_management_gimbal_output : 1;
|
||||
uint8_t power_management_chassis_output : 1;
|
||||
uint8_t power_management_shooter_output : 1;
|
||||
} ext_game_robot_state_t;
|
||||
|
||||
/* ID: 0X0202 Byte: 14 实时功率热量数据 */
|
||||
/* ID: 0X0202 Byte: 16 实时功率热量数据 */
|
||||
typedef struct
|
||||
{
|
||||
uint16_t chassis_volt;
|
||||
uint16_t chassis_current;
|
||||
float chassis_power; // 瞬时功率
|
||||
uint16_t chassis_power_buffer; // 60焦耳缓冲能量
|
||||
uint16_t shooter_heat0; // 17mm
|
||||
uint16_t shooter_heat1;
|
||||
uint16_t chassis_voltage;
|
||||
uint16_t chassis_current;
|
||||
float chassis_power;
|
||||
uint16_t buffer_energy;
|
||||
uint16_t shooter_17mm_1_barrel_heat;
|
||||
uint16_t shooter_17mm_2_barrel_heat;
|
||||
uint16_t shooter_42mm_barrel_heat;
|
||||
} ext_power_heat_data_t;
|
||||
|
||||
/* ID: 0x0203 Byte: 16 机器人位置数据 */
|
||||
@@ -199,16 +194,21 @@ typedef struct
|
||||
float yaw;
|
||||
} ext_game_robot_pos_t;
|
||||
|
||||
/* ID: 0x0204 Byte: 1 机器人增益数据 */
|
||||
/* ID: 0x0204 Byte: 6 机器人增益数据 */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t power_rune_buff;
|
||||
uint8_t recovery_buff;
|
||||
uint8_t cooling_buff;
|
||||
uint8_t defence_buff;
|
||||
uint8_t vulnerability_buff;
|
||||
uint16_t attack_buff;
|
||||
} ext_buff_musk_t;
|
||||
|
||||
/* ID: 0x0205 Byte: 1 空中机器人能量状态数据 */
|
||||
/* ID: 0x0205 Byte: 2 空中机器人能量状态数据 */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t attack_time;
|
||||
uint8_t airforce_status;
|
||||
uint8_t time_remain;
|
||||
} aerial_robot_energy_t;
|
||||
|
||||
/* ID: 0x0206 Byte: 1 伤害状态数据 */
|
||||
|
||||
Reference in New Issue
Block a user