对抗赛版本

This commit is contained in:
zyx 2024-05-26 11:29:21 +08:00
parent dbb0042275
commit 332ff6d739
17 changed files with 7476 additions and 7506 deletions

View File

@ -107,14 +107,14 @@ void ChassisInit() {
//左前 //左前
chassis_motor_config.can_init_config.tx_id = 2; chassis_motor_config.can_init_config.tx_id = 2;
chassis_motor_config.controller_setting_init_config.motor_reverse_flag = MOTOR_DIRECTION_NORMAL; chassis_motor_config.controller_setting_init_config.motor_reverse_flag = MOTOR_DIRECTION_NORMAL;
chassis_motor_config.controller_param_init_config.speed_PID.Kp = 4.5f; chassis_motor_config.controller_param_init_config.speed_PID.Kp = 5.0f;
chassis_motor_config.controller_param_init_config.speed_PID.Ki = 0.01f; chassis_motor_config.controller_param_init_config.speed_PID.Ki = 0.01f;
chassis_motor_config.controller_param_init_config.speed_PID.Kd = 0.002f; chassis_motor_config.controller_param_init_config.speed_PID.Kd = 0.002f;
motor_lf = DJIMotorInit(&chassis_motor_config); motor_lf = DJIMotorInit(&chassis_motor_config);
//左后 //左后
chassis_motor_config.can_init_config.tx_id = 3; chassis_motor_config.can_init_config.tx_id = 3;
chassis_motor_config.controller_setting_init_config.motor_reverse_flag = MOTOR_DIRECTION_NORMAL; chassis_motor_config.controller_setting_init_config.motor_reverse_flag = MOTOR_DIRECTION_NORMAL;
chassis_motor_config.controller_param_init_config.speed_PID.Kp = 4.5f; chassis_motor_config.controller_param_init_config.speed_PID.Kp = 5.5f;
chassis_motor_config.controller_param_init_config.speed_PID.Ki = 0.01f; chassis_motor_config.controller_param_init_config.speed_PID.Ki = 0.01f;
chassis_motor_config.controller_param_init_config.speed_PID.Kd = 0.002f; chassis_motor_config.controller_param_init_config.speed_PID.Kd = 0.002f;
motor_lb = DJIMotorInit(&chassis_motor_config); motor_lb = DJIMotorInit(&chassis_motor_config);
@ -276,7 +276,8 @@ static void EstimateSpeed() {
// chassis_feedback_data.vx vy wz = // chassis_feedback_data.vx vy wz =
// ... // ...
} }
static chassis_mode_e last_chassis_mode;
static float rotate_speed = 80000;
/* 机器人底盘控制核心任务 */ /* 机器人底盘控制核心任务 */
void ChassisTask() { void ChassisTask() {
// 后续增加没收到消息的处理(双板的情况) // 后续增加没收到消息的处理(双板的情况)
@ -306,20 +307,24 @@ void ChassisTask() {
chassis_cmd_recv.wz = 0; chassis_cmd_recv.wz = 0;
break; break;
case CHASSIS_FOLLOW_GIMBAL_YAW: // 跟随云台,不单独设置pid,以误差角度平方为速度输出 case CHASSIS_FOLLOW_GIMBAL_YAW: // 跟随云台,不单独设置pid,以误差角度平方为速度输出
chassis_cmd_recv.wz = 10.0f * chassis_cmd_recv.offset_angle * abs(chassis_cmd_recv.offset_angle); chassis_cmd_recv.wz = 40.0f * chassis_cmd_recv.offset_angle * abs(chassis_cmd_recv.offset_angle);
LIMIT_MIN_MAX(chassis_cmd_recv.wz,-30000,30000); LIMIT_MIN_MAX(chassis_cmd_recv.wz,-40000,40000);
break; break;
case CHASSIS_SIDEWAYS: // 侧向,不单独设置pid,以误差角度平方为速度输出 case CHASSIS_SIDEWAYS: // 侧向,不单独设置pid,以误差角度平方为速度输出
chassis_cmd_recv.wz = 10.0f * (chassis_cmd_recv.offset_angle - 45)* abs(chassis_cmd_recv.offset_angle - 45); chassis_cmd_recv.wz = 40.0f * (chassis_cmd_recv.offset_angle - 45)* abs(chassis_cmd_recv.offset_angle - 45);
LIMIT_MIN_MAX(chassis_cmd_recv.wz,-30000,30000); LIMIT_MIN_MAX(chassis_cmd_recv.wz,-40000,40000);
break; break;
case CHASSIS_ROTATE: // 自旋,同时保持全向机动;当前wz维持定值,后续增加不规则的变速策略 case CHASSIS_ROTATE: // 自旋,同时保持全向机动;当前wz维持定值,后续增加不规则的变速策略
chassis_cmd_recv.wz = 30000; if(last_chassis_mode != CHASSIS_ROTATE){
rotate_speed = -rotate_speed;
}
chassis_cmd_recv.wz = rotate_speed;
break; break;
default: default:
break; break;
} }
last_chassis_mode = chassis_cmd_recv.chassis_mode;
// 根据云台和底盘的角度offset将控制量映射到底盘坐标系上 // 根据云台和底盘的角度offset将控制量映射到底盘坐标系上
// 底盘逆时针旋转为角度正方向;云台命令的方向以云台指向的方向为x,采用右手系(x指向正北时y在正东) // 底盘逆时针旋转为角度正方向;云台命令的方向以云台指向的方向为x,采用右手系(x指向正北时y在正东)
static float sin_theta, cos_theta; static float sin_theta, cos_theta;

View File

@ -127,12 +127,22 @@ static void CalcOffsetAngle() {
//功能:死亡后清除小陀螺的状态 //功能:死亡后清除小陀螺的状态
static void death_check() static void death_check()
{ {
if(referee_data->GameRobotState.current_HP <= 0) if(referee_data->GameRobotState.current_HP <= 0 || referee_data->GameRobotState.power_management_chassis_output == 0)
{ {
rc_data[TEMP].key_count[KEY_PRESS][Key_E] = 0; rc_data[TEMP].key_count[KEY_PRESS][Key_E] = 0;
gimbal_cmd_send.yaw = gimbal_fetch_data.gimbal_imu_data.YawTotalAngle;
} }
} }
//功能:等级提升弹频提高
static void shoot_rate_improve()
{
if(referee_data->GameRobotState.robot_level <= 5)
shoot_cmd_send.shoot_rate = 18;
if(referee_data->GameRobotState.robot_level >= 5)
shoot_cmd_send.shoot_rate = 25;
}
static void update_ui_data() { static void update_ui_data() {
ui_data.chassis_mode = chassis_cmd_send.chassis_mode; ui_data.chassis_mode = chassis_cmd_send.chassis_mode;
//ui_data.gimbal_mode = gimbal_cmd_send.gimbal_mode; //ui_data.gimbal_mode = gimbal_cmd_send.gimbal_mode;
@ -270,7 +280,7 @@ static void RemoteControlSet() {
// } // }
// 射频控制,固定每秒1发,后续可以根据左侧拨轮的值大小切换射频, // 射频控制,固定每秒1发,后续可以根据左侧拨轮的值大小切换射频,
shoot_cmd_send.shoot_rate = 18;// 小 18 shoot_cmd_send.shoot_rate = 18;
if(shoot_fetch_data.stalled_flag ==1) if(shoot_fetch_data.stalled_flag ==1)
shoot_cmd_send.loader_mode = LOAD_REVERSE; shoot_cmd_send.loader_mode = LOAD_REVERSE;
@ -286,8 +296,8 @@ static void hand_aim_mode() {
* *
*/ */
static void MouseKeySet() { static void MouseKeySet() {
chassis_cmd_send.vy = rc_data[TEMP].key[KEY_PRESS].w * 3000 - rc_data[TEMP].key[KEY_PRESS].s * 3000; // 系数待测 chassis_cmd_send.vy = rc_data[TEMP].key[KEY_PRESS].w * 10000 - rc_data[TEMP].key[KEY_PRESS].s * 10000; // 系数待测
chassis_cmd_send.vx = rc_data[TEMP].key[KEY_PRESS].a * 3000 - rc_data[TEMP].key[KEY_PRESS].d * 3000; chassis_cmd_send.vx = rc_data[TEMP].key[KEY_PRESS].a * 10000 - rc_data[TEMP].key[KEY_PRESS].d * 10000;
gimbal_cmd_send.yaw -= (float) rc_data[TEMP].mouse.x / 660 * 4; // 系数待测 gimbal_cmd_send.yaw -= (float) rc_data[TEMP].mouse.x / 660 * 4; // 系数待测
gimbal_cmd_send.pitch += (float) rc_data[TEMP].mouse.y / 660 * 6; gimbal_cmd_send.pitch += (float) rc_data[TEMP].mouse.y / 660 * 6;
@ -368,29 +378,6 @@ static void MouseKeySet() {
shoot_cmd_send.lid_mode = LID_OPEN; shoot_cmd_send.lid_mode = LID_OPEN;
break; break;
} }
// switch (rc_data[TEMP].key_count[KEY_PRESS][Key_E] % 2) // E键开关小陀螺
// {
// case 0:
// chassis_cmd_send.chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW;
// gimbal_cmd_send.gimbal_mode = GIMBAL_FREE_MODE;
// break;
// default:
// chassis_cmd_send.chassis_mode = CHASSIS_ROTATE;
// gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE;
// break;
// }
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_Q] % 2) // Q键开关热控
{
case 0:
shoot_cmd_send.heat_mode = HEAT_OPEN;
break;
default:
shoot_cmd_send.heat_mode = HEAT_CLOSE;
break;
}
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_C] % 2) // C键侧向
{
case 0:
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_E] % 2) // E键开关小陀螺 switch (rc_data[TEMP].key_count[KEY_PRESS][Key_E] % 2) // E键开关小陀螺
{ {
case 0: case 0:
@ -402,9 +389,13 @@ static void MouseKeySet() {
gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE; gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE;
break; break;
} }
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_Q] % 2) // Q键开关热控
{
case 0:
shoot_cmd_send.heat_mode = HEAT_OPEN;
break; break;
case 1: default:
chassis_cmd_send.chassis_mode = CHASSIS_SIDEWAYS; shoot_cmd_send.heat_mode = HEAT_CLOSE;
break; break;
} }
// switch (rc_data[TEMP].key_count[KEY_PRESS][Key_G] % 3) // G键切换发射模式 // switch (rc_data[TEMP].key_count[KEY_PRESS][Key_G] % 3) // G键切换发射模式
@ -425,11 +416,12 @@ static void MouseKeySet() {
chassis_cmd_send.buffer_supercap = 5; chassis_cmd_send.buffer_supercap = 5;
break; break;
case 1: case 1:
chassis_cmd_send.buffer_supercap = 195; chassis_cmd_send.buffer_supercap = 200;
chassis_cmd_send.vx = rc_data[TEMP].key[KEY_PRESS].a * 15000 - rc_data[TEMP].key[KEY_PRESS].d * 15000;
break; break;
} }
shoot_cmd_send.shoot_rate = 25; shoot_rate_improve();
if(shoot_fetch_data.stalled_flag ==1) if(shoot_fetch_data.stalled_flag ==1)
shoot_cmd_send.loader_mode = LOAD_REVERSE; shoot_cmd_send.loader_mode = LOAD_REVERSE;
@ -443,8 +435,8 @@ static void MouseKeySet() {
*/ */
static void VTMouseKeySet() static void VTMouseKeySet()
{ {
chassis_cmd_send.vy = vt_data[TEMP].key[KEY_PRESS].w * 6000 - vt_data[TEMP].key[KEY_PRESS].s * 6000; // 系数待测 小 3000 3000 chassis_cmd_send.vy = vt_data[TEMP].key[KEY_PRESS].w * 10000 - vt_data[TEMP].key[KEY_PRESS].s * 10000; // 系数待测 小 3000 3000
chassis_cmd_send.vx = vt_data[TEMP].key[KEY_PRESS].a * 3000 - vt_data[TEMP].key[KEY_PRESS].d * 3000; chassis_cmd_send.vx = vt_data[TEMP].key[KEY_PRESS].a * 10000 - vt_data[TEMP].key[KEY_PRESS].d * 10000;
gimbal_cmd_send.yaw -= (float) vt_data[TEMP].mouse.x / 660 * 4; // 系数待测 gimbal_cmd_send.yaw -= (float) vt_data[TEMP].mouse.x / 660 * 4; // 系数待测
gimbal_cmd_send.pitch += (float) vt_data[TEMP].mouse.y / 660 * 6; gimbal_cmd_send.pitch += (float) vt_data[TEMP].mouse.y / 660 * 6;
@ -521,20 +513,6 @@ static void VTMouseKeySet()
shoot_cmd_send.lid_mode = LID_OPEN; shoot_cmd_send.lid_mode = LID_OPEN;
break; break;
} }
// switch (vt_data[TEMP].key_count[KEY_PRESS][Key_E] % 2) // E键开关小陀螺
// {
// case 0:
// chassis_cmd_send.chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW;
// gimbal_cmd_send.gimbal_mode = GIMBAL_FREE_MODE;
// break;
// default:
// chassis_cmd_send.chassis_mode = CHASSIS_ROTATE;
// gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE;
// break;
// }
switch (vt_data[TEMP].key_count[KEY_PRESS][Key_C] % 2) // C键侧向
{
case 0:
switch (vt_data[TEMP].key_count[KEY_PRESS][Key_E] % 2) // E键开关小陀螺 switch (vt_data[TEMP].key_count[KEY_PRESS][Key_E] % 2) // E键开关小陀螺
{ {
case 0: case 0:
@ -546,11 +524,6 @@ static void VTMouseKeySet()
gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE; gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE;
break; break;
} }
break;
case 1:
chassis_cmd_send.chassis_mode = CHASSIS_SIDEWAYS;
break;
}
switch (vt_data[TEMP].key_count[KEY_PRESS][Key_Q] % 2) // Q键开关热控 switch (vt_data[TEMP].key_count[KEY_PRESS][Key_Q] % 2) // Q键开关热控
{ {
case 0: case 0:
@ -578,11 +551,12 @@ static void VTMouseKeySet()
chassis_cmd_send.buffer_supercap = 5; chassis_cmd_send.buffer_supercap = 5;
break; break;
case 1: case 1:
chassis_cmd_send.buffer_supercap = 195; chassis_cmd_send.buffer_supercap = 200;
chassis_cmd_send.vx = rc_data[TEMP].key[KEY_PRESS].a * 15000 - rc_data[TEMP].key[KEY_PRESS].d * 15000;
break; break;
} }
shoot_cmd_send.shoot_rate = 25; shoot_rate_improve();
if(shoot_fetch_data.stalled_flag ==1) if(shoot_fetch_data.stalled_flag ==1)
shoot_cmd_send.loader_mode = LOAD_REVERSE; shoot_cmd_send.loader_mode = LOAD_REVERSE;
@ -614,6 +588,7 @@ static void EmergencyHandler() {
if (switch_is_up(rc_data[TEMP].rc.switch_right)) { if (switch_is_up(rc_data[TEMP].rc.switch_right)) {
robot_state = ROBOT_READY; robot_state = ROBOT_READY;
shoot_cmd_send.shoot_mode = SHOOT_ON; shoot_cmd_send.shoot_mode = SHOOT_ON;
gimbal_cmd_send.yaw = gimbal_fetch_data.gimbal_imu_data.YawTotalAngle;
LOGINFO("[CMD] reinstate, robot ready"); LOGINFO("[CMD] reinstate, robot ready");
} }
} }
@ -632,6 +607,8 @@ void RobotCMDTask() {
update_ui_data(); update_ui_data();
// 根据gimbal的反馈值计算云台和底盘正方向的夹角,不需要传参,通过static私有变量完成 // 根据gimbal的反馈值计算云台和底盘正方向的夹角,不需要传参,通过static私有变量完成
CalcOffsetAngle(); CalcOffsetAngle();
EmergencyHandler(); // 处理模块离线和遥控器急停等紧急情况
if (robot_state != ROBOT_STOP ){
// 根据遥控器左侧开关,确定当前使用的控制模式为遥控器调试还是键鼠 // 根据遥控器左侧开关,确定当前使用的控制模式为遥控器调试还是键鼠
if (switch_is_down(rc_data[TEMP].rc.switch_left) || if (switch_is_down(rc_data[TEMP].rc.switch_left) ||
switch_is_mid(rc_data[TEMP].rc.switch_left)) // 遥控器左侧开关状态为[下],[中],遥控器控制 switch_is_mid(rc_data[TEMP].rc.switch_left)) // 遥控器左侧开关状态为[下],[中],遥控器控制
@ -642,8 +619,7 @@ void RobotCMDTask() {
else if (switch_is_up(rc_data[TEMP].rc.switch_left) && else if (switch_is_up(rc_data[TEMP].rc.switch_left) &&
switch_is_up(rc_data[TEMP].rc.switch_right)) // 遥控器左侧开关状态为[上],键盘控制,遥控器右侧开关状态为[上],图传链路通道 switch_is_up(rc_data[TEMP].rc.switch_right)) // 遥控器左侧开关状态为[上],键盘控制,遥控器右侧开关状态为[上],图传链路通道
VTMouseKeySet(); VTMouseKeySet();
}
EmergencyHandler(); // 处理模块离线和遥控器急停等紧急情况
// 设置视觉发送数据,还需增加加速度和角速度数据 // 设置视觉发送数据,还需增加加速度和角速度数据
VisionSetFlag(!referee_data->referee_id.Robot_Color); VisionSetFlag(!referee_data->referee_id.Robot_Color);
@ -657,6 +633,17 @@ void RobotCMDTask() {
shoot_cmd_send.heat_limit = referee_data->GameRobotState.shooter_barrel_heat_limit; shoot_cmd_send.heat_limit = referee_data->GameRobotState.shooter_barrel_heat_limit;
shoot_cmd_send.heat_cool = referee_data->GameRobotState.shooter_barrel_cooling_value; shoot_cmd_send.heat_cool = referee_data->GameRobotState.shooter_barrel_cooling_value;
if(referee_data->GameRobotState.power_management_chassis_output == 0){
chassis_cmd_send.chassis_mode = CHASSIS_ZERO_FORCE;
}
if(referee_data->GameRobotState.power_management_gimbal_output == 0){
gimbal_cmd_send.gimbal_mode = GIMBAL_ZERO_FORCE;
}
if (referee_data->GameRobotState.power_management_shooter_output == 0){
shoot_cmd_send.shoot_mode = SHOOT_OFF;
}
death_check();
// 推送消息,双板通信,视觉通信等 // 推送消息,双板通信,视觉通信等
// 其他应用所需的控制数据在remotecontrolsetmode和mousekeysetmode中完成设置 // 其他应用所需的控制数据在remotecontrolsetmode和mousekeysetmode中完成设置
#ifdef ONE_BOARD #ifdef ONE_BOARD
@ -667,5 +654,5 @@ void RobotCMDTask() {
#endif // GIMBAL_BOARD #endif // GIMBAL_BOARD
PubPushMessage(shoot_cmd_pub, (void *) &shoot_cmd_send); PubPushMessage(shoot_cmd_pub, (void *) &shoot_cmd_send);
PubPushMessage(gimbal_cmd_pub, (void *) &gimbal_cmd_send); PubPushMessage(gimbal_cmd_pub, (void *) &gimbal_cmd_send);
VisionSend(&vision_send_data);
} }

View File

@ -26,7 +26,7 @@
/* 机器人重要参数定义,注意根据不同机器人进行修改,浮点数需要以.0或f结尾,无符号以u结尾 */ /* 机器人重要参数定义,注意根据不同机器人进行修改,浮点数需要以.0或f结尾,无符号以u结尾 */
// 云台参数 // 云台参数
#define YAW_CHASSIS_ALIGN_ECD 2053 // 小 1443 大2053 // 云台和底盘对齐指向相同方向时的电机编码器值,若对云台有机械改动需要修改 #define YAW_CHASSIS_ALIGN_ECD 1393 // 小 1443 大2053 // 云台和底盘对齐指向相同方向时的电机编码器值,若对云台有机械改动需要修改
#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 25 // 云台竖直方向最大角度 (注意反馈如果是陀螺仪,则填写陀螺仪的角度) #define PITCH_MAX_ANGLE 25 // 云台竖直方向最大角度 (注意反馈如果是陀螺仪,则填写陀螺仪的角度)
@ -162,6 +162,7 @@ typedef struct
uint16_t chassis_power_limit; uint16_t chassis_power_limit;
uint16_t buffer_energy; uint16_t buffer_energy;
uint16_t buffer_supercap; uint16_t buffer_supercap;
uint8_t chassic_flag;
// UI部分 // UI部分
// ... // ...

View File

@ -254,8 +254,8 @@ void ShootTask()
// DJIMotorSetRef(friction_r, 0); // DJIMotorSetRef(friction_r, 0);
// break; // break;
//default: // 当前为了调试设定的默认值4000,因为还没有加入裁判系统无法读取弹速. //default: // 当前为了调试设定的默认值4000,因为还没有加入裁判系统无法读取弹速.
DJIMotorSetRef(friction_l, 39000); DJIMotorSetRef(friction_l, 40000);
DJIMotorSetRef(friction_r, 39000); DJIMotorSetRef(friction_r, 40000);
// break; // break;
// } // }
} }
@ -268,7 +268,7 @@ void ShootTask()
// 开关弹舱盖 // 开关弹舱盖
if (shoot_cmd_recv.lid_mode == LID_CLOSE) if (shoot_cmd_recv.lid_mode == LID_CLOSE)
{ {
Servo_Motor_FreeAngle_Set(lid,107); Servo_Motor_FreeAngle_Set(lid,107);// 小107 大115
} }
else if (shoot_cmd_recv.lid_mode == LID_OPEN) else if (shoot_cmd_recv.lid_mode == LID_OPEN)
{ {
@ -278,7 +278,7 @@ void ShootTask()
// 开关热控 // 开关热控
if(shoot_cmd_recv.heat_mode == HEAT_OPEN) if(shoot_cmd_recv.heat_mode == HEAT_OPEN)
{ {
if(shoot_cmd_recv.heat>=(0.9*shoot_cmd_recv.heat_limit)) if(shoot_cmd_recv.heat>=(0.75*shoot_cmd_recv.heat_limit))
{ {
DJIMotorStop(loader); DJIMotorStop(loader);
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -162,7 +162,7 @@ void INS_Task(void) {
INS.YawTotalAngle = QEKF_INS.YawTotalAngle; INS.YawTotalAngle = QEKF_INS.YawTotalAngle;
//VisionSetAltitude(INS.Yaw, INS.Pitch, INS.Roll); //VisionSetAltitude(INS.Yaw, INS.Pitch, INS.Roll);
VisionSetAltitude(INS.Yaw * PI / 180, -INS.Roll * PI / 180); VisionSetAltitude(INS.Yaw * PI / 180, -INS.Roll * PI / 180);// 小-INS.Roll 大INS.Roll
} }
// temperature control // temperature control

View File

@ -97,8 +97,6 @@ void MyUIInit()
UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[4]); UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[4]);
UICharDraw(&UI_State_sta[5], "ss5", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 10, 600, "Q.heat:"); UICharDraw(&UI_State_sta[5], "ss5", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 10, 600, "Q.heat:");
UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[5]); UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[5]);
UICharDraw(&UI_State_sta[6], "ss6", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 10, 800, "C.ce:");
UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[6]);
// UICharDraw(&UI_State_sta[5], "ss5", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 150, 800, "load:"); // UICharDraw(&UI_State_sta[5], "ss5", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 150, 800, "load:");
// UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[5]); // UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[5]);
@ -107,10 +105,11 @@ void MyUIInit()
UICharRefresh(&referee_recv_info->referee_id, UI_prompt_sta[0]); UICharRefresh(&referee_recv_info->referee_id, UI_prompt_sta[0]);
UICharDraw(&UI_prompt_sta[1], "ss9", UI_Graph_ADD, 8,UI_Color_Pink, 30, 4, 1650, 800, "zhi hui"); UICharDraw(&UI_prompt_sta[1], "ss9", UI_Graph_ADD, 8,UI_Color_Pink, 30, 4, 1650, 800, "zhi hui");
UICharRefresh(&referee_recv_info->referee_id, UI_prompt_sta[1]); UICharRefresh(&referee_recv_info->referee_id, UI_prompt_sta[1]);
UICharDraw(&UI_prompt_sta[2], "ss10", UI_Graph_ADD, 8,UI_Color_Pink, 30, 4, 1650, 600, "bie ji");
UICharRefresh(&referee_recv_info->referee_id, UI_prompt_sta[2]);
// 底盘功率显示,静态 // 底盘功率显示,静态
UICharDraw(&UI_State_sta[6], "ss6", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 620, 230, "MAX:"); // UICharDraw(&UI_State_sta[6], "ss6", UI_Graph_ADD, 8, UI_Color_Green, 18, 2, 620, 230, "MAX:");
UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[6]); // UICharRefresh(&referee_recv_info->referee_id, UI_State_sta[6]);
// 绘制车辆状态标志,动态 // 绘制车辆状态标志,动态
// 由于初始化时xxx_last_mode默认为0所以此处对应UI也应该设为0时对应的UI防止模式不变的情况下无法置位flag导致UI无法刷新 // 由于初始化时xxx_last_mode默认为0所以此处对应UI也应该设为0时对应的UI防止模式不变的情况下无法置位flag导致UI无法刷新
@ -124,10 +123,8 @@ void MyUIInit()
UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[3]); UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[3]);
UICharDraw(&UI_State_dyn[4], "sd4", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 170, 650, "off"); UICharDraw(&UI_State_dyn[4], "sd4", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 170, 650, "off");
UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[4]); UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[4]);
UICharDraw(&UI_State_dyn[5], "sd5", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 170, 600, "on"); UICharDraw(&UI_State_dyn[5], "sd5", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 170, 600, "on ");
UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[5]); UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[5]);
UICharDraw(&UI_State_dyn[6], "sd6", UI_Graph_ADD, 8, UI_Color_Pink, 20, 2, 170, 800, "off");
UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[6]);
// UICharDraw(&UI_State_dyn[5], "sd5", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 270, 800, "999"); // UICharDraw(&UI_State_dyn[5], "sd5", UI_Graph_ADD, 8, UI_Color_Pink, 15, 2, 270, 800, "999");
// UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[5]); // UICharRefresh(&referee_recv_info->referee_id, UI_State_dyn[5]);
@ -167,7 +164,7 @@ static void MyUIRefresh(referee_info_t *referee_recv_info, Referee_Interactive_i
UICharDraw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 20, 2, 170, 750, "on "); UICharDraw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 20, 2, 170, 750, "on ");
break; break;
case CHASSIS_SIDEWAYS: case CHASSIS_SIDEWAYS:
UICharDraw(&UI_State_dyn[6], "sd6", UI_Graph_Change, 8, UI_Color_Pink, 20, 2, 170, 800, _Interactive_data->chassis_mode == CHASSIS_SIDEWAYS ? "on " : "off"); UICharDraw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 20, 2, 170, 750, "off");
break; break;
case CHASSIS_NO_FOLLOW: case CHASSIS_NO_FOLLOW:
UICharDraw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 20, 2, 170, 750, "off"); UICharDraw(&UI_State_dyn[0], "sd0", UI_Graph_Change, 8, UI_Color_Main, 20, 2, 170, 750, "off");

View File

@ -4,8 +4,8 @@
* www.segger.com * * www.segger.com *
********************************************************************** **********************************************************************
File : D:/zhandui/cqdm/basic_framework/xs.jdebug File : D:/zhandui/cqdm/xiaojing/xs.jdebug
Created : 20 Mar 2024 21:43 Created : 18 May 2024 01:04
Ozone Version : V3.32a Ozone Version : V3.32a
*/ */
@ -22,19 +22,17 @@ void OnProjectLoad (void) {
// //
// Dialog-generated settings // Dialog-generated settings
// //
Project.AddPathSubstitute ("D:/zhandui/cqdm/xiaojing", "$(ProjectDir)");
Project.AddPathSubstitute ("d:/zhandui/cqdm/xiaojing", "$(ProjectDir)");
Project.SetDevice ("STM32F407IG"); Project.SetDevice ("STM32F407IG");
Project.SetHostIF ("USB", "17935099"); Project.SetHostIF ("USB", "17935099");
Project.SetTargetIF ("SWD"); Project.SetTargetIF ("SWD");
Project.SetTIFSpeed ("4 MHz"); Project.SetTIFSpeed ("4 MHz");
Project.AddPathSubstitute ("D:/zhandui/cqdm/basic_framework", "$(ProjectDir)");
Project.AddPathSubstitute ("d:/zhandui/cqdm/basic_framework", "$(ProjectDir)");
Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M4F.svd"); Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M4F.svd");
Project.AddSvdFile ("D:/Ozone/Ozone/Config/Peripherals/STM32F407IG.svd"); Project.AddSvdFile ("D:/Ozone/Ozone/Config/Peripherals/STM32F407IG.svd");
// //
// User settings // User settings
// //
Edit.SysVar (VAR_HSS_SPEED, FREQ_200_HZ);
Project.SetOSPlugin ("FreeRTOSPlugin_CM4");
File.Open ("$(ProjectDir)/cmake-build-debug/basic_framework.elf"); File.Open ("$(ProjectDir)/cmake-build-debug/basic_framework.elf");
} }

View File

@ -1,43 +1,25 @@
GraphedExpression="P_max", Color=#e56a6f, Show=0 OpenDocument="tasks.c", FilePath="D:/zhandui/cqdm/xiaojing/Middlewares/Third_Party/FreeRTOS/Source/tasks.c", Line=3418
OpenDocument="chassis.c", FilePath="D:/zhandui/cqdm/xiaojing/application/chassis/chassis.c", Line=243 OpenDocument="gimbal.c", FilePath="D:/zhandui/cqdm/xiaojing/application/gimbal/gimbal.c", Line=0
OpenDocument="robot_cmd.c", FilePath="D:/zhandui/cqdm/xiaojing/application/cmd/robot_cmd.c", Line=396 OpenDocument="chassis.c", FilePath="D:/zhandui/cqdm/xiaojing/application/chassis/chassis.c", Line=21
OpenDocument="main.c", FilePath="D:/zhandui/cqdm/xiaojing/Src/main.c", Line=65 OpenDocument="main.c", FilePath="D:/zhandui/cqdm/xiaojing/Src/main.c", Line=65
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=735, h=499, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Source Files", DockArea=LEFT, x=0, y=0, w=735, h=496, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Memory 1", DockArea=BOTTOM, x=3, y=0, w=435, h=384, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0x30A3D70C OpenWindow="Memory 1", DockArea=BOTTOM, x=3, y=0, w=438, h=384, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0x30A3D70C
OpenWindow="Watched Data 1", DockArea=LEFT, x=0, y=1, w=735, h=537, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Watched Data 1", DockArea=LEFT, x=0, y=1, w=735, h=540, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Terminal", DockArea=BOTTOM, x=0, y=0, w=581, h=384, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Terminal", DockArea=BOTTOM, x=0, y=0, w=817, h=384, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Data Sampling", DockArea=BOTTOM, x=2, y=0, w=1023, h=384, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0 OpenWindow="Data Sampling", DockArea=BOTTOM, x=2, y=0, w=1029, h=384, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0
OpenWindow="Timeline", DockArea=RIGHT, x=0, y=0, w=1123, h=1037, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=0, CodePaneShown=0, PinCursor="Cursor Movable", TimePerDiv="2 s / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="0;822", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=0, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="896;-69", CodeGraphLegendShown=0, CodeGraphLegendPosition="912;0" OpenWindow="Timeline", DockArea=RIGHT, x=0, y=0, w=1127, h=1037, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=1, CodePaneShown=1, PinCursor="Cursor Movable", TimePerDiv="1 ns / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="900;-69", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=1, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="900;-69", CodeGraphLegendShown=1, CodeGraphLegendPosition="851;0"
OpenWindow="Console", DockArea=BOTTOM, x=1, y=0, w=518, h=384, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Console", DockArea=BOTTOM, x=1, y=0, w=273, h=384, 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";" P_max"], ColWidths=[100;100;100] TableHeader="Data Sampling Table", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time"], ColWidths=[100;100]
TableHeader="Data Sampling Setup", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Type";"Value";"Min";"Max";"Average";"# Changes";"Min. Change";"Max. Change"], ColWidths=[438;100;100;154;164;100;110;126;126] TableHeader="Data Sampling Setup", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Type";"Value";"Min";"Max";"Average";"# Changes";"Min. Change";"Max. Change"], ColWidths=[438;100;100;100;100;100;110;126;126]
TableHeader="Power Sampling", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time";"Ch 0"], ColWidths=[100;100;100] TableHeader="Power Sampling", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time";"Ch 0"], ColWidths=[100;100;100]
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;149;104;244] TableHeader="Watched Data 1", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Value";"Location";"Refresh"], ColWidths=[238;149;104;244]
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="wz_flag", RefreshRate=2, Window=Watched Data 1
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="motor_rf", RefreshRate=2, Window=Watched Data 1
WatchedExpression="motor_lf", RefreshRate=2, Window=Watched Data 1
WatchedExpression="motor_lb", RefreshRate=2, Window=Watched Data 1
WatchedExpression="motor_rb", RefreshRate=2, Window=Watched Data 1
WatchedExpression="referee_data", RefreshRate=2, Window=Watched Data 1
WatchedExpression="chassis_cmd_recv", RefreshRate=2, Window=Watched Data 1
WatchedExpression="vx_filter", 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="loader", RefreshRate=2, Window=Watched Data 1
WatchedExpression="cap", RefreshRate=2, Window=Watched Data 1
WatchedExpression="shoot_cmd_recv", RefreshRate=5, Window=Watched Data 1
WatchedExpression="gimba_IMU_data", RefreshRate=2, Window=Watched Data 1 WatchedExpression="gimba_IMU_data", RefreshRate=2, Window=Watched Data 1
WatchedExpression="vt_data", RefreshRate=2, Window=Watched Data 1
WatchedExpression="ui_data", RefreshRate=2, Window=Watched Data 1
WatchedExpression="Interactive_data", RefreshRate=2, Window=Watched Data 1
WatchedExpression="chassis_cmd_send", Window=Watched Data 1
WatchedExpression="P_max", RefreshRate=2, Window=Watched Data 1
WatchedExpression="cap", RefreshRate=2, Window=Watched Data 1