mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 03:27:45 +08:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # .vscode/launch.json # application/gimbal/gimbal.c # application/robot.c # bsp/usart/bsp_usart.c # bsp/usart/bsp_usart.h # modules/master_machine/master_process.c # modules/master_machine/seasky_protocol.c
This commit is contained in:
@@ -16,10 +16,16 @@
|
||||
#include "dji_motor.h"
|
||||
#include "super_cap.h"
|
||||
#include "message_center.h"
|
||||
|
||||
// referee需要移动到module层
|
||||
/////////////////////////
|
||||
#include "referee.h"
|
||||
#include "rm_referee.h"
|
||||
/////////////////////////
|
||||
|
||||
#include "general_def.h"
|
||||
#include "bsp_dwt.h"
|
||||
|
||||
#include "referee_UI.h"
|
||||
#include "arm_math.h"
|
||||
|
||||
/* 根据robot_def.h中的macro自动计算的参数 */
|
||||
@@ -41,7 +47,7 @@ static Subscriber_t *chassis_sub; // 用于订阅底盘的控
|
||||
static Chassis_Ctrl_Cmd_s chassis_cmd_recv; // 底盘接收到的控制命令
|
||||
static Chassis_Upload_Data_s chassis_feedback_data; // 底盘回传的反馈数据
|
||||
|
||||
static referee_info_t *referee_data; // 裁判系统的数据
|
||||
// static referee_info_t *referee_data; // 裁判系统相关数据
|
||||
static SuperCapInstance *cap; // 超级电容
|
||||
static DJIMotorInstance *motor_lf; // left right forward back
|
||||
static DJIMotorInstance *motor_rf;
|
||||
@@ -103,7 +109,11 @@ void ChassisInit()
|
||||
chassis_motor_config.controller_setting_init_config.motor_reverse_flag = MOTOR_DIRECTION_REVERSE;
|
||||
motor_rb = DJIMotorInit(&chassis_motor_config);
|
||||
|
||||
referee_data = RefereeInit(&huart6); // 裁判系统初始化
|
||||
// referee_data = RefereeInit(&huart6); // 裁判系统初始化
|
||||
|
||||
// while (referee_data->GameRobotState.robot_id ==0);
|
||||
// Referee_Interactive_init(referee_data);
|
||||
|
||||
|
||||
SuperCap_Init_Config_s cap_conf = {
|
||||
.can_config = {
|
||||
@@ -240,12 +250,12 @@ void ChassisTask()
|
||||
// 根据电机的反馈速度和IMU(如果有)计算真实速度
|
||||
EstimateSpeed();
|
||||
|
||||
// 获取裁判系统数据
|
||||
// 我方颜色id小于7是红色,大于7是蓝色,注意这里发送的是对方的颜色, 0:blue , 1:red
|
||||
chassis_feedback_data.enemy_color = referee_data->GameRobotStat.robot_id > 7 ? 1 : 0;
|
||||
// 当前只做了17mm热量的数据获取,后续根据robot_def中的宏切换双枪管和英雄42mm的情况
|
||||
chassis_feedback_data.bullet_speed = referee_data->GameRobotStat.shooter_id1_17mm_speed_limit;
|
||||
chassis_feedback_data.rest_heat = referee_data->PowerHeatData.shooter_heat0;
|
||||
// // 获取裁判系统数据 建议将裁判系统与底盘分离,所以此处数据应使用消息中心发送
|
||||
// // 我方颜色id小于7是红色,大于7是蓝色,注意这里发送的是对方的颜色, 0:blue , 1:red
|
||||
// chassis_feedback_data.enemy_color = referee_data->GameRobotState.robot_id > 7 ? 1 : 0;
|
||||
// // 当前只做了17mm热量的数据获取,后续根据robot_def中的宏切换双枪管和英雄42mm的情况
|
||||
// chassis_feedback_data.bullet_speed = referee_data->GameRobotState.shooter_id1_17mm_speed_limit;
|
||||
// chassis_feedback_data.rest_heat = referee_data->PowerHeatData.shooter_heat0;
|
||||
|
||||
// 推送反馈消息
|
||||
#ifdef ONE_BOARD
|
||||
|
||||
Reference in New Issue
Block a user