拨盘参数校准,超级电容代码,RGB,调试成功

This commit is contained in:
zyxxj 2024-04-24 15:59:11 +08:00
parent 353e54589e
commit d38dd9573d
25 changed files with 6985 additions and 6888 deletions

View File

@ -50,9 +50,10 @@ static Chassis_Ctrl_Cmd_s Chassis_Power_Mx;
const static float CHASSIS_ACCEL_X_NUM=0.1f; const static float CHASSIS_ACCEL_X_NUM=0.1f;
const static float CHASSIS_ACCEL_Y_NUM=0.1f; const static float CHASSIS_ACCEL_Y_NUM=0.1f;
// 超级电容
SuperCapInstance *cap; // 超级电容全局
float power_set; // 超级电容功率设置
static SuperCapInstance *cap; // 超级电容
static DJIMotorInstance *motor_lf, *motor_rf, *motor_lb, *motor_rb; // left right forward back static DJIMotorInstance *motor_lf, *motor_rf, *motor_lb, *motor_rb; // left right forward back
/* 用于自旋变速策略的时间变量 */ /* 用于自旋变速策略的时间变量 */
@ -115,16 +116,17 @@ void ChassisInit() {
//超级电容 //超级电容
SuperCap_Init_Config_s cap_conf = { SuperCap_Init_Config_s cap_conf = {
.can_config = { .can_config = {
.can_handle = &hcan2, .can_handle = &hcan1,
.tx_id = 0x210, .tx_id = 0x210,
.rx_id = 0x211, .rx_id = 0x211,
}}; }};
cap = SuperCapInit(&cap_conf); // 超级电容初始化 cap = SuperCapInit(&cap_conf); // 超级电容初始化
power_set = 70;
SuperCapSetPower(cap,power_set); // 超级电容限制功率
//用一阶滤波代替斜波函数生成 //用一阶滤波代替斜波函数生成
first_order_filter_init(&vx_filter, 0.002f, &CHASSIS_ACCEL_X_NUM); first_order_filter_init(&vx_filter, 0.002f, &CHASSIS_ACCEL_X_NUM);
first_order_filter_init(&vy_filter, 0.002f, &CHASSIS_ACCEL_Y_NUM); first_order_filter_init(&vy_filter, 0.002f, &CHASSIS_ACCEL_Y_NUM);
// PowerMeter_Init_Config_s
// 发布订阅初始化,如果为双板,则需要can comm来传递消息 // 发布订阅初始化,如果为双板,则需要can comm来传递消息
#ifdef CHASSIS_BOARD #ifdef CHASSIS_BOARD
@ -225,8 +227,6 @@ static void LimitChassisOutput()
DJIMotorSetRef(motor_rb, vt_rb); DJIMotorSetRef(motor_rb, vt_rb);
} }
} }
/** /**
@ -320,7 +320,8 @@ void ChassisTask() {
//chassis_feedback_data.enemy_color = !referee_data->referee_id.Robot_Color; //chassis_feedback_data.enemy_color = !referee_data->referee_id.Robot_Color;
// 当前只做了17mm热量的数据获取,后续根据robot_def中的宏切换双枪管和英雄42mm的情况 // 当前只做了17mm热量的数据获取,后续根据robot_def中的宏切换双枪管和英雄42mm的情况
//chassis_feedback_data.bullet_speed = referee_data->GameRobotState.shooter_id1_17mm_speed_limit; //chassis_feedback_data.bullet_speed = referee_data->GameRobotState.shooter_id1_17mm_speed_limit;
// chassis_feedback_data.rest_heat = referee_data->PowerHeatData.shooter_heat0; //chassis_feedback_data.rest_heat = referee_data->PowerHeatData.shooter_heat0;
chassis_feedback_data.cap_power = cap->cap_msg.cap_vol;
// 推送反馈消息 // 推送反馈消息
#ifdef ONE_BOARD #ifdef ONE_BOARD
@ -329,4 +330,4 @@ void ChassisTask() {
#ifdef CHASSIS_BOARD #ifdef CHASSIS_BOARD
CANCommSend(chasiss_can_comm, (void *)&chassis_feedback_data); CANCommSend(chasiss_can_comm, (void *)&chassis_feedback_data);
#endif // CHASSIS_BOARD #endif // CHASSIS_BOARD
} }

View File

@ -9,6 +9,7 @@
#include "general_def.h" #include "general_def.h"
#include "dji_motor.h" #include "dji_motor.h"
#include "auto_aim.h" #include "auto_aim.h"
#include "super_cap.h"
// bsp // bsp
#include "bsp_dwt.h" #include "bsp_dwt.h"
#include "bsp_log.h" #include "bsp_log.h"
@ -30,17 +31,17 @@ static Subscriber_t *chassis_feed_sub; // 底盘反馈信息订阅者
static Chassis_Ctrl_Cmd_s chassis_cmd_send; // 发送给底盘应用的信息,包括控制信息和UI绘制相关 static Chassis_Ctrl_Cmd_s chassis_cmd_send; // 发送给底盘应用的信息,包括控制信息和UI绘制相关
static Chassis_Upload_Data_s chassis_fetch_data; // 从底盘应用接收的反馈信息信息,底盘功率枪口热量与底盘运动状态等 static Chassis_Upload_Data_s chassis_fetch_data; // 从底盘应用接收的反馈信息信息,底盘功率枪口热量与底盘运动状态等
extern SuperCapInstance *cap; // 超级电容
static RC_ctrl_t *rc_data; // 遥控器数据,初始化时返回 static RC_ctrl_t *rc_data; // 遥控器数据,初始化时返回
//static Vision_Recv_s *vision_recv_data; // 视觉接收数据指针,初始化时返回 //static Vision_Recv_s *vision_recv_data; // 视觉接收数据指针,初始化时返回
//static Vision_Send_s vision_send_data; // 视觉发送数据 //static Vision_Send_s vision_send_data; // 视觉发送数据
static RecievePacket_t *vision_recv_data; // 视觉接收数据指针,初始化时返回 static RecievePacket_t *vision_recv_data; // 视觉接收数据指针,初始化时返回
static SendPacket_t vision_send_data; // 视觉发送数据 static SendPacket_t vision_send_data; // 视觉发送数据
//自瞄相关信息 //自瞄相关信息
static Trajectory_Type_t trajectory_cal; static Trajectory_Type_t trajectory_cal;
static Aim_Select_Type_t aim_select; static Aim_Select_Type_t aim_select;
static uint32_t no_find_cnt; // 未发现目标计数 static uint32_t no_find_cnt; // 未发现目标计数
static uint8_t auto_aim_flag = 0; //辅助瞄准标志位 视野内有目标开启 目标丢失关闭 static uint8_t auto_aim_flag = 0; //辅助瞄准标志位 视野内有目标开启 目标丢失关闭
static Publisher_t *gimbal_cmd_pub; // 云台控制消息发布者 static Publisher_t *gimbal_cmd_pub; // 云台控制消息发布者
@ -129,6 +130,7 @@ static void update_ui_data() {
ui_data.aim_fire = aim_select.suggest_fire; ui_data.aim_fire = aim_select.suggest_fire;
ui_data.Chassis_Power_Data.chassis_power_mx = referee_data->GameRobotState.chassis_power_limit; ui_data.Chassis_Power_Data.chassis_power_mx = referee_data->GameRobotState.chassis_power_limit;
ui_data.Chassis_Power_Data.cap_power = chassis_fetch_data.cap_power;
} }
static void auto_aim_mode() { static void auto_aim_mode() {
@ -356,14 +358,13 @@ static void MouseKeySet() {
break; break;
} }
switch (rc_data[TEMP].key[KEY_PRESS].shift) // 待添加 按shift允许超功率 消耗缓冲能量 switch (rc_data[TEMP].key[KEY_PRESS].shift) //按shift允许消耗超级电容能量
{ {
case 1: case 0:
SuperCapSetPower(cap,40);
break; break;
default: default:
SuperCapSetPower(cap,70);
break; break;
} }

View File

@ -83,8 +83,8 @@ void GimbalInit() {
// PITCH // PITCH
Motor_Init_Config_s pitch_config = { Motor_Init_Config_s pitch_config = {
.can_init_config = { .can_init_config = {
.can_handle = &hcan1, .can_handle = &hcan2,
.tx_id = 2, .tx_id = 1,
}, },
.controller_param_init_config = { .controller_param_init_config = {
.angle_PID = { .angle_PID = {

View File

@ -26,7 +26,7 @@
/* 机器人重要参数定义,注意根据不同机器人进行修改,浮点数需要以.0或f结尾,无符号以u结尾 */ /* 机器人重要参数定义,注意根据不同机器人进行修改,浮点数需要以.0或f结尾,无符号以u结尾 */
// 云台参数 // 云台参数
#define YAW_CHASSIS_ALIGN_ECD 6822 // 云台和底盘对齐指向相同方向时的电机编码器值,若对云台有机械改动需要修改 #define YAW_CHASSIS_ALIGN_ECD 1371 // 云台和底盘对齐指向相同方向时的电机编码器值,若对云台有机械改动需要修改
#define YAW_ECD_GREATER_THAN_4096 0 // ALIGN_ECD值是否大于4096,是为1,否为0;用于计算云台偏转角度 #define YAW_ECD_GREATER_THAN_4096 0 // ALIGN_ECD值是否大于4096,是为1,否为0;用于计算云台偏转角度
#define PITCH_HORIZON_ECD 4422 // 云台处于水平位置时编码器值,若对云台有机械改动需要修改 #define PITCH_HORIZON_ECD 4422 // 云台处于水平位置时编码器值,若对云台有机械改动需要修改
#define PITCH_MAX_ANGLE 18 // 云台竖直方向最大角度 (注意反馈如果是陀螺仪,则填写陀螺仪的角度) #define PITCH_MAX_ANGLE 18 // 云台竖直方向最大角度 (注意反馈如果是陀螺仪,则填写陀螺仪的角度)
@ -130,10 +130,9 @@ typedef enum
// 功率限制,从裁判系统获取,是否有必要保留? // 功率限制,从裁判系统获取,是否有必要保留?
typedef struct typedef struct
{ // 功率控制 {
uint16_t chassis_power_mx; uint16_t chassis_power_mx; // 功率控制
uint16_t last_power_mx; float cap_power; // 超级电容功率控制
} Chassis_Power_Data_s; } Chassis_Power_Data_s;
/* ----------------CMD应用发布的控制数据,应当由gimbal/chassis/shoot订阅---------------- */ /* ----------------CMD应用发布的控制数据,应当由gimbal/chassis/shoot订阅---------------- */
@ -200,7 +199,8 @@ typedef struct
uint8_t rest_heat; // 剩余枪口热量 uint8_t rest_heat; // 剩余枪口热量
Bullet_Speed_e bullet_speed; // 弹速限制 Bullet_Speed_e bullet_speed; // 弹速限制
Enemy_Color_e enemy_color; // 0 for red, 1 for blue Enemy_Color_e enemy_color; // 0 for red, 1 for blue
Chassis_Power_Data_s chassis_power_mx; uint16_t chassis_power_mx;
float cap_power;
} Chassis_Upload_Data_s; } Chassis_Upload_Data_s;

View File

@ -113,6 +113,7 @@ CMakeFiles/basic_framework.elf.dir/application/cmd/robot_cmd.c.obj: \
D:\zhandui\cqdm\bubing_9\modules\motor/motor_def.h \ D:\zhandui\cqdm\bubing_9\modules\motor/motor_def.h \
D:\zhandui\cqdm\bubing_9\modules\daemon/daemon.h \ D:\zhandui\cqdm\bubing_9\modules\daemon/daemon.h \
D:\zhandui\cqdm\bubing_9\modules\auto_aim/auto_aim.h \ D:\zhandui\cqdm\bubing_9\modules\auto_aim/auto_aim.h \
D:\zhandui\cqdm\bubing_9\modules\super_cap/super_cap.h \
D:\zhandui\cqdm\bubing_9\modules\referee/referee_task.h \ D:\zhandui\cqdm\bubing_9\modules\referee/referee_task.h \
D:\zhandui\cqdm\bubing_9\modules\referee/rm_referee.h \ D:\zhandui\cqdm\bubing_9\modules\referee/rm_referee.h \
D:\zhandui\cqdm\bubing_9\modules\referee/referee_protocol.h \ D:\zhandui\cqdm\bubing_9\modules\referee/referee_protocol.h \

View File

@ -4283,6 +4283,7 @@ CMakeFiles/basic_framework.elf.dir/application/cmd/robot_cmd.c.obj
D:/zhandui/cqdm/bubing_9/modules/motor/motor_def.h D:/zhandui/cqdm/bubing_9/modules/motor/motor_def.h
D:/zhandui/cqdm/bubing_9/modules/daemon/daemon.h D:/zhandui/cqdm/bubing_9/modules/daemon/daemon.h
D:/zhandui/cqdm/bubing_9/modules/auto_aim/auto_aim.h D:/zhandui/cqdm/bubing_9/modules/auto_aim/auto_aim.h
D:/zhandui/cqdm/bubing_9/modules/super_cap/super_cap.h
D:/zhandui/cqdm/bubing_9/modules/referee/referee_task.h D:/zhandui/cqdm/bubing_9/modules/referee/referee_task.h
D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.h D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.h
D:/zhandui/cqdm/bubing_9/modules/referee/referee_protocol.h D:/zhandui/cqdm/bubing_9/modules/referee/referee_protocol.h
@ -8225,6 +8226,10 @@ CMakeFiles/basic_framework.elf.dir/modules/referee/referee_task.c.obj
D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/queue.h D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/queue.h
D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h
D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/timers.h D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/timers.h
D:/zhandui/cqdm/bubing_9/application/chassis/chassis.h
D:/zhandui/cqdm/bubing_9/modules/super_cap/super_cap.h
D:/zhandui/cqdm/bubing_9/bsp/can/bsp_can.h
D:/zhandui/cqdm/bubing_9/Inc/can.h
CMakeFiles/basic_framework.elf.dir/modules/referee/rm_referee.c.obj CMakeFiles/basic_framework.elf.dir/modules/referee/rm_referee.c.obj
D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.c D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.c

View File

@ -4209,6 +4209,7 @@ CMakeFiles/basic_framework.elf.dir/application/cmd/robot_cmd.c.obj: D:/zhandui/c
D:/zhandui/cqdm/bubing_9/modules/motor/motor_def.h \ D:/zhandui/cqdm/bubing_9/modules/motor/motor_def.h \
D:/zhandui/cqdm/bubing_9/modules/daemon/daemon.h \ D:/zhandui/cqdm/bubing_9/modules/daemon/daemon.h \
D:/zhandui/cqdm/bubing_9/modules/auto_aim/auto_aim.h \ D:/zhandui/cqdm/bubing_9/modules/auto_aim/auto_aim.h \
D:/zhandui/cqdm/bubing_9/modules/super_cap/super_cap.h \
D:/zhandui/cqdm/bubing_9/modules/referee/referee_task.h \ D:/zhandui/cqdm/bubing_9/modules/referee/referee_task.h \
D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.h \ D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.h \
D:/zhandui/cqdm/bubing_9/modules/referee/referee_protocol.h \ D:/zhandui/cqdm/bubing_9/modules/referee/referee_protocol.h \
@ -8104,7 +8105,11 @@ CMakeFiles/basic_framework.elf.dir/modules/referee/referee_task.c.obj: D:/zhandu
D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h \ D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h \
D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/queue.h \ D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/queue.h \
D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h \ D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h \
D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/timers.h D:/zhandui/cqdm/bubing_9/Middlewares/Third_Party/FreeRTOS/Source/include/timers.h \
D:/zhandui/cqdm/bubing_9/application/chassis/chassis.h \
D:/zhandui/cqdm/bubing_9/modules/super_cap/super_cap.h \
D:/zhandui/cqdm/bubing_9/bsp/can/bsp_can.h \
D:/zhandui/cqdm/bubing_9/Inc/can.h
CMakeFiles/basic_framework.elf.dir/modules/referee/rm_referee.c.obj: D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.c \ CMakeFiles/basic_framework.elf.dir/modules/referee/rm_referee.c.obj: D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.c \
D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.h \ D:/zhandui/cqdm/bubing_9/modules/referee/rm_referee.h \

View File

@ -116,4 +116,8 @@ CMakeFiles/basic_framework.elf.dir/modules/referee/referee_task.c.obj: \
D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/semphr.h \ D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/semphr.h \
D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/queue.h \ D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/queue.h \
D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/event_groups.h \ D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/event_groups.h \
D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/timers.h D:\zhandui\cqdm\bubing_9\Middlewares\Third_Party\FreeRTOS\Source\include/timers.h \
D:\zhandui\cqdm\bubing_9\application\chassis/chassis.h \
D:\zhandui\cqdm\bubing_9\modules\super_cap/super_cap.h \
D:\zhandui\cqdm\bubing_9\bsp\can/bsp_can.h \
D:\zhandui\cqdm\bubing_9\Inc/can.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,10 @@
#include "referee_UI.h" #include "referee_UI.h"
#include "string.h" #include "string.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#include "chassis.h"
#include "super_cap.h"
extern SuperCapInstance *cap; // 超级电容
static Referee_Interactive_info_t *Interactive_data; // UI绘制需要的机器人状态数据 static Referee_Interactive_info_t *Interactive_data; // UI绘制需要的机器人状态数据
static referee_info_t *referee_recv_info; // 接收到的裁判系统数据 static referee_info_t *referee_recv_info; // 接收到的裁判系统数据
Referee_Interactive_info_t ui_data; Referee_Interactive_info_t ui_data;
@ -109,17 +112,19 @@ void MyUIInit()
UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[5]); UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[5]);
// 能量条框 // 能量条框
// UIRectangleDraw(&UI_Energy[0], "ss6", UI_Graph_ADD, 7, UI_Color_Green, 2, 720, 140, 1220, 180); UIRectangleDraw(&UI_Energy[0], "ss6", UI_Graph_ADD, 7, UI_Color_Green, 2, 720, 140, 1220, 180);
// UIGraphRefresh(&referee_recv_info->referee_id, 1, UI_Energy[0]); UIGraphRefresh(&referee_recv_info->referee_id, 1, UI_Energy[0]);
// 底盘功率显示,动态 // 底盘功率显示,动态
UIFloatDraw(&UI_Energy[1], "sd5", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 2, 850, 230, referee_recv_info->GameRobotState.chassis_power_limit*1000); UIFloatDraw(&UI_Energy[1], "sd5", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 2, 850, 230, referee_recv_info->GameRobotState.chassis_power_limit*1000);
// 能量条初始状态
//UILineDraw(&UI_Energy[2], "sd6", UI_Graph_ADD, 8, UI_Color_Pink, 30, 720, 160, 1020, 160);
//UIIntDraw(&UI_Energy[3],"sd7",UI_Graph_ADD,8,UI_Color_Pink,18,2,1000,300,referee_recv_info->GameRobotState.chassis_power_limit);
//UIFloatDraw(&UI_Energy[3], "sd7", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 2, 1000, 1000, referee_recv_info->GameRobotState.chassis_power_limit);
UIGraphRefresh(&referee_recv_info->referee_id, 1, UI_Energy[1]); UIGraphRefresh(&referee_recv_info->referee_id, 1, UI_Energy[1]);
// 能量条初始状态
UILineDraw(&UI_Energy[2], "sd6", UI_Graph_ADD, 8, UI_Color_Pink, 30, 720, 160, 1020, 160);
//超级电容电压
UIIntDraw(&UI_Energy[3],"sd7",UI_Graph_ADD,8,UI_Color_Pink,18,2,1000,300,cap->cap_msg.cap_vol);
UIGraphRefresh(&referee_recv_info->referee_id, 1, UI_Energy[3]);
} }
// 测试用函数,实现模式自动变化,用于检查该任务和裁判系统是否连接正常 // 测试用函数,实现模式自动变化,用于检查该任务和裁判系统是否连接正常
@ -253,7 +258,7 @@ static void MyUIRefresh(referee_info_t *referee_recv_info, Referee_Interactive_i
if (_Interactive_data->Referee_Interactive_Flag.Power_flag == 1) if (_Interactive_data->Referee_Interactive_Flag.Power_flag == 1)
{ {
UIFloatDraw(&UI_Energy[1], "sd5", UI_Graph_Change, 8, UI_Color_Green, 18, 2, 2, 850, 230, _Interactive_data->Chassis_Power_Data.chassis_power_mx * 1000); UIFloatDraw(&UI_Energy[1], "sd5", UI_Graph_Change, 8, UI_Color_Green, 18, 2, 2, 850, 230, _Interactive_data->Chassis_Power_Data.chassis_power_mx * 1000);
//UILineDraw(&UI_Energy[2], "sd6", UI_Graph_Change, 8, UI_Color_Pink, 30, 720, 160, (uint32_t)750 + _Interactive_data->Chassis_Power_Data.chassis_power_mx * 30, 160); UILineDraw(&UI_Energy[2], "sd6", UI_Graph_Change, 8, UI_Color_Pink, 30, 720, 160, (uint32_t)750 + cap->cap_msg.cap_vol * 30, 160);
UIGraphRefresh(&referee_recv_info->referee_id, 2, UI_Energy[1], UI_Energy[2]); UIGraphRefresh(&referee_recv_info->referee_id, 2, UI_Energy[1], UI_Energy[2]);
_Interactive_data->Referee_Interactive_Flag.Power_flag = 0; _Interactive_data->Referee_Interactive_Flag.Power_flag = 0;
} }
@ -303,10 +308,16 @@ static void UIChangeCheck(Referee_Interactive_info_t *_Interactive_data)
_Interactive_data->lid_last_mode = _Interactive_data->lid_mode; _Interactive_data->lid_last_mode = _Interactive_data->lid_mode;
} }
if (_Interactive_data->Chassis_Power_Data.chassis_power_mx != _Interactive_data->Chassis_last_Power_Data.last_power_mx) if (_Interactive_data->Chassis_Power_Data.chassis_power_mx != _Interactive_data->Chassis_last_Power_Data.chassis_power_mx)
{ {
_Interactive_data->Referee_Interactive_Flag.Power_flag = 1; _Interactive_data->Referee_Interactive_Flag.Power_flag = 1;
_Interactive_data->Chassis_last_Power_Data.last_power_mx = _Interactive_data->Chassis_Power_Data.chassis_power_mx; _Interactive_data->Chassis_last_Power_Data.chassis_power_mx = _Interactive_data->Chassis_Power_Data.chassis_power_mx;
}
if (_Interactive_data->Chassis_Power_Data.cap_power != _Interactive_data->Chassis_last_Power_Data.cap_power)
{
_Interactive_data->Referee_Interactive_Flag.cap_flag = 1;
_Interactive_data->Chassis_last_Power_Data.cap_power = _Interactive_data->Chassis_Power_Data.cap_power;
} }
if (_Interactive_data->aim_fire != _Interactive_data->aim_last_fire) if (_Interactive_data->aim_fire != _Interactive_data->aim_last_fire)

View File

@ -7,6 +7,8 @@
#include "bsp_usart.h" #include "bsp_usart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
extern uint8_t UI_Seq; extern uint8_t UI_Seq;
#pragma pack(1) #pragma pack(1)
@ -55,6 +57,7 @@ typedef struct
uint32_t friction_flag : 1; uint32_t friction_flag : 1;
uint32_t Power_flag : 1; uint32_t Power_flag : 1;
uint32_t aim_flag : 1; uint32_t aim_flag : 1;
uint32_t cap_flag : 1;
} Referee_Interactive_Flag_t; } Referee_Interactive_Flag_t;
// 此结构体包含UI绘制与机器人车间通信的需要的其他非裁判系统数据 // 此结构体包含UI绘制与机器人车间通信的需要的其他非裁判系统数据
@ -70,6 +73,7 @@ typedef struct
Chassis_Power_Data_s Chassis_Power_Data; // 功率控制 Chassis_Power_Data_s Chassis_Power_Data; // 功率控制
uint8_t aim_fire; // 开火建议 uint8_t aim_fire; // 开火建议
// 上一次的模式用于flag判断 // 上一次的模式用于flag判断
chassis_mode_e chassis_last_mode; chassis_mode_e chassis_last_mode;
gimbal_mode_e gimbal_last_mode; gimbal_mode_e gimbal_last_mode;

View File

@ -1,14 +1,8 @@
/*
* @Descripttion:
* @version:
* @Author: Chenfu
* @Date: 2022-12-02 21:32:47
* @LastEditTime: 2022-12-05 15:29:49
*/
#include "super_cap.h" #include "super_cap.h"
#include "memory.h" #include "memory.h"
#include "stdlib.h" #include "stdlib.h"
static SuperCapInstance *super_cap_instance = NULL; // 可以由app保存此指针 static SuperCapInstance *super_cap_instance = NULL; // 可以由app保存此指针
static void SuperCapRxCallback(CANInstance *_instance) static void SuperCapRxCallback(CANInstance *_instance)

View File

@ -1,10 +1,3 @@
/*
* @Descripttion:
* @version:
* @Author: Chenfu
* @Date: 2022-12-02 21:32:47
* @LastEditTime: 2022-12-05 15:25:46
*/
#ifndef SUPER_CAP_H #ifndef SUPER_CAP_H
#define SUPER_CAP_H #define SUPER_CAP_H

View File

@ -2,17 +2,19 @@
Breakpoint=D:/zhandui/cqdm/bubing_9/application/shoot/shoot.c:183:5, State=BP_STATE_DISABLED Breakpoint=D:/zhandui/cqdm/bubing_9/application/shoot/shoot.c:183:5, State=BP_STATE_DISABLED
OpenDocument="super_cap.c", FilePath="D:/zhandui/cqdm/bubing_9/modules/super_cap/super_cap.c", Line=0
OpenDocument="chassis.c", FilePath="D:/zhandui/cqdm/bubing_9/application/chassis/chassis.c", Line=81
OpenDocument="shoot.c", FilePath="D:/zhandui/cqdm/bubing_9/application/shoot/shoot.c", Line=63 OpenDocument="shoot.c", FilePath="D:/zhandui/cqdm/bubing_9/application/shoot/shoot.c", Line=63
OpenDocument="main.c", FilePath="D:/zhandui/cqdm/bubing_9/Src/main.c", Line=64 OpenDocument="main.c", FilePath="D:/zhandui/cqdm/bubing_9/Src/main.c", Line=64
OpenToolbar="Debug", Floating=0, x=0, y=0 OpenToolbar="Debug", Floating=0, x=0, y=0
OpenWindow="Source Files", DockArea=LEFT, x=0, y=0, w=556, h=283, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Source Files", DockArea=LEFT, x=0, y=0, w=556, h=292, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Disassembly", DockArea=RIGHT, x=0, y=0, w=935, h=193, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Disassembly", DockArea=RIGHT, x=0, y=0, w=935, h=205, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Memory 1", DockArea=BOTTOM, x=3, y=0, w=800, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0x30A3D70C OpenWindow="Memory 1", DockArea=BOTTOM, x=3, y=0, w=800, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0x30A3D70C
OpenWindow="Watched Data 1", DockArea=LEFT, x=0, y=1, w=556, h=809, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Watched Data 1", DockArea=LEFT, x=0, y=1, w=556, h=800, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Terminal", DockArea=BOTTOM, x=0, y=0, w=405, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Terminal", DockArea=BOTTOM, x=0, y=0, w=650, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Data Sampling", DockArea=BOTTOM, x=2, y=0, w=979, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0 OpenWindow="Data Sampling", DockArea=BOTTOM, x=2, y=0, w=979, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0
OpenWindow="Timeline", DockArea=RIGHT, x=0, y=1, w=935, h=899, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=0, CodePaneShown=0, PinCursor="Cursor Movable", TimePerDiv="1 s / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="0;0", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=0, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="70;20", CodeGraphLegendShown=0, CodeGraphLegendPosition="80;20" OpenWindow="Timeline", DockArea=RIGHT, x=0, y=1, w=935, h=887, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=0, CodePaneShown=0, PinCursor="Cursor Movable", TimePerDiv="1 s / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="0;0", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=0, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="601;0", CodeGraphLegendShown=0, CodeGraphLegendPosition="608;0"
OpenWindow="Console", DockArea=BOTTOM, x=1, y=0, w=373, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Console", DockArea=BOTTOM, x=1, y=0, w=128, h=328, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
SmartViewPlugin="", Page="", Toolbar="Hidden", Window="SmartView 1" SmartViewPlugin="", Page="", Toolbar="Hidden", Window="SmartView 1"
TableHeader="Source Files", SortCol="File", SortOrder="ASCENDING", VisibleCols=["File";"Status";"Size";"#Insts";"Path"], ColWidths=[263;100;100;100;950] TableHeader="Source Files", SortCol="File", SortOrder="ASCENDING", VisibleCols=["File";"Status";"Size";"#Insts";"Path"], ColWidths=[263;100;100;100;950]
TableHeader="Data Sampling Table", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time"], ColWidths=[100;100] TableHeader="Data Sampling Table", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time"], ColWidths=[100;100]
@ -21,6 +23,7 @@ TableHeader="Power Sampling", SortCol="None", SortOrder="ASCENDING", VisibleCols
TableHeader="Task List", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Name";"Run Count";"Priority";"Status";"Timeout";"Stack Info";"ID";"Mutex Count";"Notified Value";"Notify State"], ColWidths=[110;110;110;110;110;110;110;110;110;110] TableHeader="Task List", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Name";"Run Count";"Priority";"Status";"Timeout";"Stack Info";"ID";"Mutex Count";"Notified Value";"Notify State"], ColWidths=[110;110;110;110;110;110;110;110;110;110]
TableHeader="Watched Data 1", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Value";"Location";"Refresh"], ColWidths=[238;100;104;114] TableHeader="Watched Data 1", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Value";"Location";"Refresh"], ColWidths=[238;100;104;114]
TableHeader="RegisterSelectionDialog", SortCol="None", SortOrder="ASCENDING", VisibleCols=[], ColWidths=[] TableHeader="RegisterSelectionDialog", SortCol="None", SortOrder="ASCENDING", VisibleCols=[], ColWidths=[]
TableHeader="TargetExceptionDialog", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Value";"Address";"Description"], ColWidths=[27;27;27;26]
WatchedExpression="yaw_motor", RefreshRate=2, Window=Watched Data 1 WatchedExpression="yaw_motor", RefreshRate=2, Window=Watched Data 1
WatchedExpression="pitch_motor", RefreshRate=2, Window=Watched Data 1 WatchedExpression="pitch_motor", RefreshRate=2, Window=Watched Data 1
WatchedExpression="motor_rf", RefreshRate=2, Window=Watched Data 1 WatchedExpression="motor_rf", RefreshRate=2, Window=Watched Data 1
@ -31,4 +34,5 @@ WatchedExpression="chassis_cmd_recv", RefreshRate=2, Window=Watched Data 1
WatchedExpression="vx_filter", RefreshRate=2, Window=Watched Data 1 WatchedExpression="vx_filter", RefreshRate=2, Window=Watched Data 1
WatchedExpression="loader", RefreshRate=2, Window=Watched Data 1 WatchedExpression="loader", RefreshRate=2, Window=Watched Data 1
WatchedExpression="shoot.c::shoot_cmd_recv", RefreshRate=2, Window=Watched Data 1 WatchedExpression="shoot.c::shoot_cmd_recv", RefreshRate=2, Window=Watched Data 1
WatchedExpression="loader", RefreshRate=2, Window=Watched Data 1 WatchedExpression="loader", RefreshRate=2, Window=Watched Data 1
WatchedExpression="cap", RefreshRate=2, Window=Watched Data 1