准备加ciallo电
This commit is contained in:
parent
5c8c1fc474
commit
a692457d79
@ -159,36 +159,45 @@ int8_t Aimbot_ParseCmdFromCAN(const Aimbot_Param_t *param,
|
||||
if (param == NULL || result == NULL) return DEVICE_ERR_NULL;
|
||||
|
||||
BSP_FDCAN_Message_t msg;
|
||||
int8_t ret = DEVICE_ERR;
|
||||
|
||||
if (BSP_FDCAN_GetMessage(param->can, param->cmd_id, &msg,
|
||||
BSP_FDCAN_TIMEOUT_IMMEDIATE) != 0) {
|
||||
return DEVICE_ERR;
|
||||
BSP_FDCAN_TIMEOUT_IMMEDIATE) == 0) {
|
||||
result->mode = msg.data[0];
|
||||
|
||||
/* 解析 yaw(高 28 位),符号扩展为 int32 */
|
||||
int32_t yaw_raw = (int32_t)(((uint32_t)msg.data[1] << 20u) |
|
||||
((uint32_t)msg.data[2] << 12u) |
|
||||
((uint32_t)msg.data[3] << 4u) |
|
||||
((uint32_t)(msg.data[4] >> 4u) & 0xFu));
|
||||
if (yaw_raw & 0x08000000) yaw_raw |= (int32_t)0xF0000000;
|
||||
result->gimbal_t.setpoint.yaw = (float)yaw_raw / AIMBOT_ANGLE_SCALE;
|
||||
|
||||
/* 解析 pit(低 28 位),符号扩展为 int32 */
|
||||
int32_t pit_raw = (int32_t)(((uint32_t)(msg.data[4] & 0xFu) << 24u) |
|
||||
((uint32_t)msg.data[5] << 16u) |
|
||||
((uint32_t)msg.data[6] << 8u) |
|
||||
(uint32_t)msg.data[7]);
|
||||
if (pit_raw & 0x08000000) pit_raw |= (int32_t)0xF0000000;
|
||||
result->gimbal_t.setpoint.pit = (float)pit_raw / AIMBOT_ANGLE_SCALE;
|
||||
ret = DEVICE_OK;
|
||||
}
|
||||
|
||||
result->mode = msg.data[0];
|
||||
if (BSP_FDCAN_GetMessage(param->can, param->cmd_id + 1, &msg,
|
||||
BSP_FDCAN_TIMEOUT_IMMEDIATE) == 0) {
|
||||
memcpy(&result->gimbal_t.vel.yaw, &msg.data[0], 4);
|
||||
memcpy(&result->gimbal_t.vel.pit, &msg.data[4], 4);
|
||||
ret = DEVICE_OK;
|
||||
}
|
||||
|
||||
/* 解析 yaw(高 28 位),符号扩展为 int32 */
|
||||
int32_t yaw_raw = (int32_t)(((uint32_t)msg.data[1] << 20u) |
|
||||
((uint32_t)msg.data[2] << 12u) |
|
||||
((uint32_t)msg.data[3] << 4u) |
|
||||
((uint32_t)(msg.data[4] >> 4u) & 0xFu));
|
||||
if (yaw_raw & 0x08000000) yaw_raw |= (int32_t)0xF0000000;
|
||||
result->gimbal_t.setpoint.yaw = (float)yaw_raw / AIMBOT_ANGLE_SCALE;
|
||||
if (BSP_FDCAN_GetMessage(param->can, param->cmd_id + 2, &msg,
|
||||
BSP_FDCAN_TIMEOUT_IMMEDIATE) == 0) {
|
||||
memcpy(&result->gimbal_t.accl.yaw, &msg.data[0], 4);
|
||||
memcpy(&result->gimbal_t.accl.pit, &msg.data[4], 4);
|
||||
ret = DEVICE_OK;
|
||||
}
|
||||
|
||||
/* 解析 pit(低 28 位),符号扩展为 int32 */
|
||||
int32_t pit_raw = (int32_t)(((uint32_t)(msg.data[4] & 0xFu) << 24u) |
|
||||
((uint32_t)msg.data[5] << 16u) |
|
||||
((uint32_t)msg.data[6] << 8u) |
|
||||
(uint32_t)msg.data[7]);
|
||||
if (pit_raw & 0x08000000) pit_raw |= (int32_t)0xF0000000;
|
||||
result->gimbal_t.setpoint.pit = (float)pit_raw / AIMBOT_ANGLE_SCALE;
|
||||
|
||||
/* 速度/加速度前馈由上层板另行扩展,此处置<E5A484>?*/
|
||||
result->gimbal_t.vel.yaw = 0.0f;
|
||||
result->gimbal_t.vel.pit = 0.0f;
|
||||
result->gimbal_t.accl.yaw = 0.0f;
|
||||
result->gimbal_t.accl.pit = 0.0f;
|
||||
|
||||
return DEVICE_OK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -217,6 +226,18 @@ void Aimbot_SendCmdOnCAN(const Aimbot_Param_t *param,
|
||||
frame.data[6] = (uint8_t)((pit >> 8) & 0xFF);
|
||||
frame.data[7] = (uint8_t)(pit & 0xFF);
|
||||
|
||||
BSP_FDCAN_TransmitStdDataFrame(param->can, &frame);
|
||||
|
||||
/* 第二帧:发速度 */
|
||||
frame.id = param->cmd_id + 1;
|
||||
memcpy(&frame.data[0], &cmd->gimbal_t.vel.yaw, 4);
|
||||
memcpy(&frame.data[4], &cmd->gimbal_t.vel.pit, 4);
|
||||
BSP_FDCAN_TransmitStdDataFrame(param->can, &frame);
|
||||
|
||||
/* 第三帧:发加速度 */
|
||||
frame.id = param->cmd_id + 2;
|
||||
memcpy(&frame.data[0], &cmd->gimbal_t.accl.yaw, 4);
|
||||
memcpy(&frame.data[4], &cmd->gimbal_t.accl.pit, 4);
|
||||
BSP_FDCAN_TransmitStdDataFrame(param->can, &frame);
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ static void CMD_PC_BuildGimbalCmd(CMD_t *ctx) {
|
||||
|
||||
/* 鼠标控制云台 */
|
||||
ctx->output.gimbal.cmd.delta_yaw = (float)-ctx->input.pc.mouse.x * ctx->timer.dt * sens->mouse_sens;
|
||||
ctx->output.gimbal.cmd.delta_pit = (float)ctx->input.pc.mouse.y * ctx->timer.dt * sens->mouse_sens * 1.5f;
|
||||
ctx->output.gimbal.cmd.delta_pit = (float)-ctx->input.pc.mouse.y * ctx->timer.dt * sens->mouse_sens * 1.5f;
|
||||
CMD_Behavior_ProcessAll(ctx, &ctx->input, &ctx->last_input, CMD_MODULE_GIMBAL);
|
||||
}
|
||||
#endif /* CMD_ENABLE_SRC_PC && CMD_ENABLE_MODULE_GIMBAL */
|
||||
@ -232,9 +232,6 @@ static void CMD_NUC_BuildShootCmd(CMD_t *ctx) {
|
||||
/* 根据AI模式决定射击行为 */
|
||||
switch (ctx->input.nuc.mode) {
|
||||
case 0:
|
||||
ctx->output.shoot.cmd.ready = false;
|
||||
ctx->output.shoot.cmd.firecmd = false;
|
||||
break;
|
||||
case 1:
|
||||
ctx->output.shoot.cmd.ready = true;
|
||||
ctx->output.shoot.cmd.firecmd = false;
|
||||
|
||||
@ -24,14 +24,10 @@ Config_RobotParam_t robot_config = {
|
||||
.width=1920,
|
||||
.height=1080,
|
||||
},
|
||||
.ai_param = {
|
||||
.can = BSP_FDCAN_2,
|
||||
.vision_id = 0x104,
|
||||
},
|
||||
.aimbot_param = {
|
||||
.can = BSP_FDCAN_2,
|
||||
.cmd_id = 0x520u,
|
||||
.fb_base_id = 0x521u,
|
||||
.cmd_id = 0x520, /* 上层板→下层板 AI指令帧ID (共3帧: 0x520~0x522) */
|
||||
.fb_base_id = 0x524, /* 下层板→上层板 反馈起始ID */
|
||||
},
|
||||
.imu_param = {
|
||||
.can=BSP_FDCAN_2,
|
||||
@ -202,6 +198,48 @@ Config_RobotParam_t robot_config = {
|
||||
.range = M_2PI,
|
||||
},
|
||||
},
|
||||
.aimbot = {
|
||||
.yaw_omega = {
|
||||
.k = 1.0f,//1
|
||||
.p = 1.0f,
|
||||
.i = 0.3f,
|
||||
.d = 0.0f,
|
||||
.i_limit = 1.0f,
|
||||
.out_limit = 1.0f,
|
||||
.d_cutoff_freq = -1.0f,
|
||||
.range = -1.0f,
|
||||
},
|
||||
.yaw_angle = {
|
||||
.k = 2.0f,
|
||||
.p = 5.0f,
|
||||
.i = 0.0f,
|
||||
.d = 0.0f,
|
||||
.i_limit = 0.0f,
|
||||
.out_limit = 10.0f,
|
||||
.d_cutoff_freq = -1.0f,
|
||||
.range = M_2PI,
|
||||
},
|
||||
.pit_omega = {
|
||||
.k = 1.0f,//0.4
|
||||
.p = 1.0f,
|
||||
.i = 0.0f,
|
||||
.d = 0.0f,
|
||||
.i_limit = 1.0f,
|
||||
.out_limit = 1.0f,
|
||||
.d_cutoff_freq = -1.0f,
|
||||
.range = -1.0f,
|
||||
},
|
||||
.pit_angle = {
|
||||
.k = 3.0f,
|
||||
.p = 2.0f,
|
||||
.i = 2.0f,
|
||||
.d = 0.0f,
|
||||
.i_limit = 2.0f,
|
||||
.out_limit = 10.0f,
|
||||
.d_cutoff_freq = -1.0f,
|
||||
.range = M_2PI,
|
||||
},
|
||||
},
|
||||
},
|
||||
.mech_zero = {
|
||||
.yaw = 0.0f,
|
||||
|
||||
@ -29,7 +29,6 @@ typedef struct {
|
||||
Track_Params_t track_param;
|
||||
CMD_Config_t cmd_param;
|
||||
GIMBAL_IMU_Param_t imu_param;
|
||||
AI_Param_t ai_param;
|
||||
Aimbot_Param_t aimbot_param; /* 下层板 ↔ 上层板 CAN 通信参数 */
|
||||
Referee_Screen_t ref_screen;
|
||||
} Config_RobotParam_t;
|
||||
|
||||
@ -16,7 +16,8 @@
|
||||
/* Private macro ------------------------------------------------------------ */
|
||||
/* Private variables -------------------------------------------------------- */
|
||||
/* Private function -------------------------------------------------------- */
|
||||
|
||||
#define GIMBAL_YAW_INERTIA 0.05f
|
||||
#define GIMBAL_PIT_INERTIA 0.03f
|
||||
/**
|
||||
* \brief 设置云台模式
|
||||
*
|
||||
@ -39,6 +40,10 @@ static int8_t Gimbal_SetMode(Gimbal_t *g, Gimbal_Mode_t mode) {
|
||||
PID_Reset(&g->pid.relative.yaw_omega);
|
||||
PID_Reset(&g->pid.relative.pit_angle);
|
||||
PID_Reset(&g->pid.relative.pit_omega);
|
||||
PID_Reset(&g->pid.aimbot.yaw_angle);
|
||||
PID_Reset(&g->pid.aimbot.yaw_omega);
|
||||
PID_Reset(&g->pid.aimbot.pit_angle);
|
||||
PID_Reset(&g->pid.aimbot.pit_omega);
|
||||
|
||||
LowPassFilter2p_Reset(&g->filter_out.yaw, 0.0f);
|
||||
LowPassFilter2p_Reset(&g->filter_out.pit, 0.0f);
|
||||
@ -103,6 +108,15 @@ int8_t Gimbal_Init(Gimbal_t *g, Gimbal_Params_t *param,
|
||||
PID_Init(&(g->pid.relative.pit_omega), KPID_MODE_CALC_D, target_freq,
|
||||
&(g->param->pid.relative.pit_omega));
|
||||
|
||||
PID_Init(&(g->pid.aimbot.yaw_angle), KPID_MODE_SET_D, target_freq,
|
||||
&(g->param->pid.aimbot.yaw_angle));
|
||||
PID_Init(&(g->pid.aimbot.yaw_omega), KPID_MODE_SET_D, target_freq,
|
||||
&(g->param->pid.aimbot.yaw_omega));
|
||||
PID_Init(&(g->pid.aimbot.pit_angle), KPID_MODE_SET_D, target_freq,
|
||||
&(g->param->pid.aimbot.pit_angle));
|
||||
PID_Init(&(g->pid.aimbot.pit_omega), KPID_MODE_SET_D, target_freq,
|
||||
&(g->param->pid.aimbot.pit_omega));
|
||||
|
||||
LowPassFilter2p_Init(&g->filter_out.yaw, target_freq,
|
||||
g->param->low_pass_cutoff_freq.out);
|
||||
LowPassFilter2p_Init(&g->filter_out.pit, target_freq,
|
||||
@ -287,30 +301,26 @@ int8_t Gimbal_Control(Gimbal_t *g, Gimbal_CMD_t *g_cmd) {
|
||||
break;
|
||||
|
||||
case GIMBAL_MODE_AI_CONTROL:
|
||||
/* 位置环 → 速度设定值 + 速度前馈 */
|
||||
yaw_omega_set_point = PID_Calc(&(g->pid.absolute.yaw_angle),
|
||||
g->setpoint.eulr.yaw,
|
||||
g->feedback.motor.yaw.rotor_abs_angle,
|
||||
0.0f, g->dt)
|
||||
+ g_cmd->ff_vel_yaw;
|
||||
|
||||
/* 速度环 + 加速度前馈 → yaw 输出 */
|
||||
g->out.yaw = PID_Calc(&(g->pid.absolute.yaw_omega), yaw_omega_set_point,
|
||||
g->feedback.imu.gyro.z, 0.0f, g->dt)
|
||||
+ g_cmd->ff_accl_yaw;
|
||||
|
||||
/* pit 位置环 → 速度设定值 + 速度前馈 */
|
||||
pit_omega_set_point = PID_Calc(&(g->pid.absolute.pit_angle),
|
||||
g->setpoint.eulr.pit,
|
||||
g->feedback.motor.pit.rotor_abs_angle,
|
||||
0.0f, g->dt)
|
||||
+ g_cmd->ff_vel_pit;
|
||||
|
||||
/* 速度环 + 加速度前馈 → pit 输出 */
|
||||
g->out.pit = PID_Calc(&(g->pid.absolute.pit_omega), pit_omega_set_point,
|
||||
g->feedback.imu.gyro.x, 0.0f, g->dt)
|
||||
+ g_cmd->ff_accl_pit;
|
||||
/* --- YAW --- */
|
||||
// 位置环: Kp * (pos_ref - pos_fdb)
|
||||
yaw_omega_set_point = PID_Calc(&(g->pid.aimbot.yaw_angle),
|
||||
g->setpoint.eulr.yaw,
|
||||
g->feedback.imu.eulr.yaw, 0.0f, g->dt);
|
||||
// 速度环: Kd * (vel_ref - vel_fdb),用上位机下发的 yaw_vel 作为前馈参考
|
||||
g->out.yaw = PID_Calc(&(g->pid.aimbot.yaw_omega),
|
||||
yaw_omega_set_point + g_cmd->ff_vel_yaw,
|
||||
g->feedback.imu.gyro.z, 0.0f, g->dt)
|
||||
+ g_cmd->ff_accl_yaw * GIMBAL_YAW_INERTIA; // 加速度前馈: J * acc
|
||||
|
||||
/* --- PITCH --- */
|
||||
pit_omega_set_point = PID_Calc(&(g->pid.aimbot.pit_angle),
|
||||
g->setpoint.eulr.pit,
|
||||
g->feedback.imu.eulr.pit, 0.0f, g->dt);
|
||||
g->out.pit = PID_Calc(&(g->pid.aimbot.pit_omega),
|
||||
pit_omega_set_point + g_cmd->ff_vel_pit,
|
||||
g->feedback.imu.gyro.x, 0.0f, g->dt)
|
||||
+ g_cmd->ff_accl_pit * GIMBAL_PIT_INERTIA; // 加速度前馈: J * acc
|
||||
break;
|
||||
/* 输出滤波 */
|
||||
g->out.yaw = LowPassFilter2p_Apply(&g->filter_out.yaw, g->out.yaw);
|
||||
g->out.pit = LowPassFilter2p_Apply(&g->filter_out.pit, g->out.pit);
|
||||
|
||||
@ -75,6 +75,13 @@ typedef struct {
|
||||
KPID_Params_t pit_omega; /* pitch轴角速度环PID参数 */
|
||||
KPID_Params_t pit_angle; /* pitch轴角位置环PID参数 */
|
||||
} relative;
|
||||
|
||||
struct {
|
||||
KPID_Params_t yaw_omega; /* yaw轴角速度环PID参数 */
|
||||
KPID_Params_t yaw_angle; /* yaw轴角位置环PID参数 */
|
||||
KPID_Params_t pit_omega; /* pitch轴角速度环PID参数 */
|
||||
KPID_Params_t pit_angle; /* pitch轴角位置环PID参数 */
|
||||
} aimbot;
|
||||
} pid;
|
||||
|
||||
/* 低通滤波器截止频率 */
|
||||
@ -145,6 +152,12 @@ typedef struct {
|
||||
KPID_t pit_angle; /* pitch轴角位置环PID */
|
||||
KPID_t pit_omega; /* pitch轴角速度环PID */
|
||||
} relative;
|
||||
struct {
|
||||
KPID_t yaw_angle; /* yaw轴角位置环PID */
|
||||
KPID_t yaw_omega; /* yaw轴角速度环PID */
|
||||
KPID_t pit_angle; /* pitch轴角位置环PID */
|
||||
KPID_t pit_omega; /* pitch轴角速度环PID */
|
||||
} aimbot;
|
||||
} pid;
|
||||
|
||||
struct {
|
||||
|
||||
@ -183,7 +183,7 @@ int8_t Shoot_CaluTargetRPM(Shoot_t *s, float target_speed)
|
||||
s->target_variable.fric_rpm=5000.0f;
|
||||
break;
|
||||
case SHOOT_PROJECTILE_42MM:
|
||||
s->target_variable.fric_rpm=6500.0f;//6500
|
||||
s->target_variable.fric_rpm=5000.0f;//6500
|
||||
break;
|
||||
}
|
||||
return SHOOT_OK;
|
||||
@ -966,7 +966,7 @@ int8_t Shoot_Control(Shoot_t *s, Shoot_CMD_t *cmd)
|
||||
s->timer.now = BSP_TIME_Get_us() / 1000000.0f;
|
||||
s->timer.dt = (BSP_TIME_Get_us() - s->timer.lask_wakeup) / 1000000.0f;
|
||||
s->timer.lask_wakeup = BSP_TIME_Get_us();
|
||||
Shoot_CaluTargetRPM(s,233);
|
||||
// Shoot_CaluTargetRPM(s,233);
|
||||
|
||||
/* 运行热量检测状态机 */
|
||||
// Shoot_HeatDetectionFSM(s);
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
/* USER INCLUDE BEGIN */
|
||||
#include "module/aimbot.h"
|
||||
#include "module/config.h"
|
||||
#include "module/vision_bridge.h"
|
||||
#include "module/gimbal.h"
|
||||
#include "module/shoot.h"
|
||||
#include "device/referee_proto_types.h"
|
||||
@ -29,7 +28,7 @@
|
||||
static Aimbot_Param_t aimbot_can; /* CAN 通信参数(从 config 拷贝) */
|
||||
static Aimbot_FeedbackData_t lower_board_fb; /* 打包好发给上层板的数据 */
|
||||
static Aimbot_AIResult_t ai_cmd_from_can; /* 上层板下发并传到底板的指令 */
|
||||
static AI_cmd_t ai_cmd_for_nuc; /* 转换后发往 cmd.nuc 的指令 */
|
||||
static AI_cmd_t for_cmdnuc; /* 转换后发往 cmd.nuc 的指令 */
|
||||
|
||||
static Referee_ForAI_t ai_ref; /* 裁判系统转发给 AI 的数据 */
|
||||
static Shoot_AI_t raw_shoot; /* 发射机构反馈 */
|
||||
@ -77,16 +76,16 @@ void Task_ai(void *argument) {
|
||||
/* 4. 解析上层板发来的 AI 指令(非阻塞提取) */
|
||||
if (Aimbot_ParseCmdFromCAN(&aimbot_can, &ai_cmd_from_can) == DEVICE_OK) {
|
||||
/* 将 Aimbot_AIResult_t 转换为 AI_cmd_t 并推送到 cmd.nuc 队列 */
|
||||
ai_cmd_for_nuc.mode = ai_cmd_from_can.mode;
|
||||
ai_cmd_for_nuc.gimbal.setpoint.yaw = ai_cmd_from_can.gimbal_t.setpoint.yaw;
|
||||
ai_cmd_for_nuc.gimbal.setpoint.pit = ai_cmd_from_can.gimbal_t.setpoint.pit;
|
||||
ai_cmd_for_nuc.gimbal.vel.yaw = ai_cmd_from_can.gimbal_t.vel.yaw;
|
||||
ai_cmd_for_nuc.gimbal.vel.pit = ai_cmd_from_can.gimbal_t.vel.pit;
|
||||
ai_cmd_for_nuc.gimbal.accl.yaw = ai_cmd_from_can.gimbal_t.accl.yaw;
|
||||
ai_cmd_for_nuc.gimbal.accl.pit = ai_cmd_from_can.gimbal_t.accl.pit;
|
||||
for_cmdnuc.mode = ai_cmd_from_can.mode;
|
||||
for_cmdnuc.gimbal.setpoint.yaw = ai_cmd_from_can.gimbal_t.setpoint.yaw;
|
||||
for_cmdnuc.gimbal.setpoint.pit = ai_cmd_from_can.gimbal_t.setpoint.pit;
|
||||
for_cmdnuc.gimbal.vel.yaw = ai_cmd_from_can.gimbal_t.vel.yaw;
|
||||
for_cmdnuc.gimbal.vel.pit = ai_cmd_from_can.gimbal_t.vel.pit;
|
||||
for_cmdnuc.gimbal.accl.yaw = ai_cmd_from_can.gimbal_t.accl.yaw;
|
||||
for_cmdnuc.gimbal.accl.pit = ai_cmd_from_can.gimbal_t.accl.pit;
|
||||
|
||||
osMessageQueueReset(task_runtime.msgq.cmd.nuc);
|
||||
osMessageQueuePut(task_runtime.msgq.cmd.nuc, &ai_cmd_for_nuc, 0, 0);
|
||||
osMessageQueuePut(task_runtime.msgq.cmd.nuc, &for_cmdnuc, 0, 0);
|
||||
}
|
||||
|
||||
/* USER CODE END */
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
#include "module/track.h"
|
||||
#include "module/cmd/cmd.h"
|
||||
#include "bsp/fdcan.h"
|
||||
#include "module/vision_bridge.h"
|
||||
//#define DEAD_AREA 0.05f
|
||||
/* USER INCLUDE END */
|
||||
|
||||
@ -59,7 +58,6 @@ void Task_cmd(void *argument) {
|
||||
uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */
|
||||
/* USER CODE INIT BEGIN */
|
||||
CMD_Init(&cmd, &Config_GetRobotParam()->cmd_param);
|
||||
AI_Init(&ai, &Config_GetRobotParam()->ai_param);
|
||||
/* 注册CAN接收ID */
|
||||
/* USER CODE INIT END */
|
||||
|
||||
@ -71,9 +69,7 @@ void Task_cmd(void *argument) {
|
||||
#elif CMD_RCTypeTable_Index == 1
|
||||
osMessageQueueGet(task_runtime.msgq.cmd.rc, &cmd_at9s, NULL, 0);
|
||||
#endif
|
||||
|
||||
/* 从CAN2接收AI命令 */
|
||||
AI_ParseCmdFromCan( &ai,&cmd_ai);
|
||||
osMessageQueueGet(task_runtime.msgq.cmd.nuc, &cmd_ai, NULL, 0);
|
||||
|
||||
#if CMD_ENABLE_SRC_REF
|
||||
/* 从裁判系统读取最新数据(非阻塞) */
|
||||
|
||||
@ -73,7 +73,7 @@ void Task_Init(void *argument) {
|
||||
/* AI */
|
||||
task_runtime.msgq.ai.rawdata_FromGimbal = osMessageQueueNew(2u, sizeof(Gimbal_Feedback_t), NULL);
|
||||
task_runtime.msgq.ai.rawdata_FromIMU = osMessageQueueNew(2u, sizeof(AHRS_Quaternion_t), NULL);
|
||||
// task_runtime.msgq.ai.rawdata_FromShoot = osMessageQueueNew(2u, sizeof(), NULL);
|
||||
task_runtime.msgq.ai.rawdata_FromShoot = osMessageQueueNew(2u, sizeof(Shoot_AI_t), NULL);
|
||||
/* cmd.nuc: AI task -> cmd task 的指令队列 */
|
||||
task_runtime.msgq.cmd.nuc = osMessageQueueNew(2u, sizeof(AI_cmd_t), NULL);
|
||||
/* 裁判系统 */
|
||||
|
||||
@ -78,7 +78,6 @@ typedef struct {
|
||||
}track;
|
||||
struct{
|
||||
osMessageQueueId_t rc;
|
||||
osMessageQueueId_t pc;
|
||||
osMessageQueueId_t nuc;
|
||||
osMessageQueueId_t ref;
|
||||
}cmd;
|
||||
|
||||
@ -1,22 +1,29 @@
|
||||
|
||||
|
||||
OpenDocument="referee_proto_types.h", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/device/referee_proto_types.h", Line=15
|
||||
GraphedExpression="((((gimbal).feedback).imu).eulr).pit", Color=#e56a6f
|
||||
GraphedExpression="((((gimbal).feedback).imu).eulr).yaw", Color=#35792b
|
||||
GraphedExpression="(((ai_cmd_from_can).gimbal_t).setpoint).yaw", Color=#769dda
|
||||
GraphedExpression="(((ai_cmd_from_can).gimbal_t).setpoint).pit", Color=#b14f0d
|
||||
OpenDocument="gimbal.h", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/module/gimbal.h", Line=57
|
||||
OpenDocument="ctrl_shoot.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/task/ctrl_shoot.c", Line=12
|
||||
OpenDocument="ahrs.h", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/component/ahrs/ahrs.h", Line=0
|
||||
OpenDocument="main.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/Core/Src/main.c", Line=60
|
||||
OpenDocument="ctrl_gimbal.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/task/ctrl_gimbal.c", Line=0
|
||||
OpenDocument="startup_stm32h723xx.s", FilePath="D:/CUBEMX/hero/god-yuan-hero/startup_stm32h723xx.s", Line=48
|
||||
OpenDocument="shoot.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/module/shoot.c", Line=33
|
||||
OpenDocument="ref_main.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/task/ref_main.c", Line=12
|
||||
OpenDocument="referee.h", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/device/referee.h", Line=0
|
||||
OpenDocument="referee.h", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/device/referee.h", Line=542
|
||||
OpenDocument="uart.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/bsp/uart.c", Line=111
|
||||
OpenDocument="supercap.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/device/supercap.c", Line=0
|
||||
OpenDocument="stm32h7xx_it.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/Core/Src/stm32h7xx_it.c", Line=351
|
||||
OpenDocument="cmsis_os2.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c", Line=515
|
||||
OpenDocument="config.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/module/config.c", Line=455
|
||||
OpenDocument="ctrl_shoot.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/task/ctrl_shoot.c", Line=0
|
||||
OpenDocument="ai.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/task/ai.c", Line=30
|
||||
OpenDocument="referee.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/device/referee.c", Line=21
|
||||
OpenDocument="cmd.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/task/cmd.c", Line=51
|
||||
OpenDocument="stm32h7xx_hal_fdcan.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_fdcan.c", Line=5367
|
||||
OpenDocument="track.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/module/track.c", Line=87
|
||||
OpenDocument="main.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/Core/Src/main.c", Line=60
|
||||
OpenDocument="referee_proto_types.h", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/device/referee_proto_types.h", Line=10
|
||||
OpenDocument="cmsis_gcc.h", FilePath="D:/CUBEMX/hero/god-yuan-hero/Drivers/CMSIS/Include/cmsis_gcc.h", Line=1193
|
||||
OpenDocument="cmd.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/module/cmd/cmd.c", Line=192
|
||||
OpenDocument="fdcan.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/bsp/fdcan.c", Line=98
|
||||
@ -38,14 +45,14 @@ OpenDocument="atti_esti.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/task/att
|
||||
OpenDocument="fdcan.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/Core/Src/fdcan.c", Line=0
|
||||
OpenDocument="time.c", FilePath="D:/CUBEMX/hero/god-yuan-hero/User/bsp/time.c", Line=17
|
||||
OpenToolbar="Debug", Floating=0, x=0, y=0
|
||||
OpenWindow="Registers 1", DockArea=RIGHT, x=0, y=1, w=728, h=589, TabPos=1, TopOfStack=0, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, FilteredItems=[], RefreshRate=1
|
||||
OpenWindow="Registers 1", DockArea=RIGHT, x=0, y=1, w=728, h=584, TabPos=1, TopOfStack=0, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, FilteredItems=[], RefreshRate=1
|
||||
OpenWindow="Source Files", DockArea=LEFT, x=0, y=0, w=328, h=930, TabPos=0, TopOfStack=1, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
|
||||
OpenWindow="Disassembly", DockArea=RIGHT, x=0, y=0, w=728, h=340, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
|
||||
OpenWindow="Disassembly", DockArea=RIGHT, x=0, y=0, w=728, h=345, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
|
||||
OpenWindow="Memory 1", DockArea=BOTTOM, x=0, y=0, w=239, h=544, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0xFFFF5088
|
||||
OpenWindow="Watched Data 1", DockArea=RIGHT, x=0, y=1, w=728, h=589, TabPos=0, TopOfStack=1, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
|
||||
OpenWindow="Watched Data 1", DockArea=RIGHT, x=0, y=1, w=728, h=584, TabPos=0, TopOfStack=1, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
|
||||
OpenWindow="Functions", DockArea=LEFT, x=0, y=0, w=328, h=930, TabPos=1, TopOfStack=0, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
|
||||
OpenWindow="Data Sampling", DockArea=BOTTOM, x=2, y=0, w=866, h=525, TabPos=0, TopOfStack=1, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0
|
||||
OpenWindow="Timeline", DockArea=BOTTOM, x=1, y=0, w=1453, h=544, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=0, CodePaneShown=0, PinCursor="Cursor Movable", TimePerDiv="5 s / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="21;187", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=0, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="1157;-69", CodeGraphLegendShown=0, CodeGraphLegendPosition="1164;0"
|
||||
OpenWindow="Timeline", DockArea=BOTTOM, x=1, y=0, w=1453, h=544, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=0, CodePaneShown=0, PinCursor="Cursor Movable", TimePerDiv="5 s / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="21;187", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=0, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="1238;0", CodeGraphLegendShown=0, CodeGraphLegendPosition="1254;0"
|
||||
OpenWindow="Console", DockArea=BOTTOM, x=2, y=0, w=866, h=525, TabPos=1, TopOfStack=0, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
|
||||
SmartViewPlugin="", Page="", Toolbar="Hidden", Window="SmartView 1"
|
||||
TableHeader="Registers 1", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Value";"Description"], ColWidths=[120;144;464]
|
||||
@ -54,8 +61,8 @@ TableHeader="Power Sampling", SortCol="None", SortOrder="ASCENDING", VisibleCols
|
||||
TableHeader="RegisterSelectionDialog", SortCol="None", SortOrder="ASCENDING", VisibleCols=[], ColWidths=[]
|
||||
TableHeader="Source Files", SortCol="File", SortOrder="ASCENDING", VisibleCols=["File";"Status";"Size";"#Insts";"Path"], ColWidths=[215;100;100;100;1022]
|
||||
TableHeader="Watched Data 1", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Value";"Location";"Refresh"], ColWidths=[298;229;145;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=[118;100;100;100;100;100;110;126;126]
|
||||
TableHeader="Data Sampling Table", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time";" ((((gimbal).feedback).imu).eulr).pit";" ((((gimbal).feedback).imu).eulr).yaw";" (((ai_cmd_from_can).gimbal_t).setpoint).yaw";" (((ai_cmd_from_can).gimbal_t).setpoint).pit"], ColWidths=[100;100;100;100;100;100]
|
||||
TableHeader="Data Sampling Setup", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Type";"Value";"Min";"Max";"Average";"# Changes";"Min. Change";"Max. Change"], ColWidths=[118;100;134;134;134;144;110;144;134]
|
||||
TableHeader="TargetExceptionDialog", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Value";"Address";"Description"], ColWidths=[200;100;100;340]
|
||||
WatchedExpression="cmd", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="bmi088", RefreshRate=5, Window=Watched Data 1
|
||||
@ -73,4 +80,8 @@ WatchedExpression="imu_to_can", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="ref", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="rxbuf", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="shoot_ref", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="gimbal_cmd", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="gimbal_cmd", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="for_cmdnuc", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="ai_cmd_from_can", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="raw_shoot", RefreshRate=5, Window=Watched Data 1
|
||||
WatchedExpression="shoot_forai", RefreshRate=5, Window=Watched Data 1
|
||||
Loading…
Reference in New Issue
Block a user