sili
This commit is contained in:
parent
eea0a5a3d3
commit
da7f4d6ea9
@ -69,7 +69,7 @@ static void CMD_RC_BuildGimbalCmd(CMD_t *ctx) {
|
||||
#if CMD_ENABLE_SRC_RC && CMD_ENABLE_MODULE_SHOOT
|
||||
static void CMD_RC_BuildShootCmd(CMD_t *ctx) {
|
||||
if (ctx->input.online[CMD_SRC_RC]) {
|
||||
ctx->output.shoot.cmd.mode = SHOOT_MODE_SINGLE;
|
||||
ctx->output.shoot.cmd.mode = SHOOT_MODE_CONTINUE;
|
||||
} else {
|
||||
ctx->output.shoot.cmd.mode = SHOOT_MODE_SAFE;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ Config_RobotParam_t robot_config = {
|
||||
.fric_num=2,
|
||||
.extra_deceleration_ratio=1.0f,
|
||||
.num_trig_tooth=8,
|
||||
.shot_freq=18.0f,
|
||||
.shot_freq=15.0f,
|
||||
.shot_burst_num=3,
|
||||
.ratio_multilevel = {1.0f},
|
||||
},
|
||||
@ -152,7 +152,7 @@ Config_RobotParam_t robot_config = {
|
||||
.heatControl={
|
||||
.enable=true,
|
||||
.safe_shots=5, // 安全出弹余量
|
||||
.nmax=18.0f, // 最大射频 Hz
|
||||
.nmax=15.0f, // 最大射频 Hz
|
||||
.Hwarn=200.0f, // 热量预警值
|
||||
.Hsatu=100.0f, // 热量饱和值
|
||||
.Hthres=50.0f, // 热量阈值
|
||||
@ -542,10 +542,10 @@ Config_RobotParam_t robot_config = {
|
||||
#endif
|
||||
#if CMD_ENABLE_MODULE_BALANCE_CHASSIS
|
||||
.balance_sw_up = CHASSIS_MODE_RELAX,
|
||||
.balance_sw_mid = CHASSIS_MODE_RELAX,
|
||||
.balance_sw_down = CHASSIS_MODE_RELAX,
|
||||
// .balance_sw_mid = CHASSIS_MODE_WHELL_LEG_BALANCE,
|
||||
// .balance_sw_down = CHASSIS_MODE_BALANCE_ROTOR,
|
||||
// .balance_sw_mid = CHASSIS_MODE_RELAX,
|
||||
// .balance_sw_down = CHASSIS_MODE_RELAX,
|
||||
.balance_sw_mid = CHASSIS_MODE_LEG_TEST,
|
||||
.balance_sw_down = CHASSIS_MODE_WHELL_LEG_BALANCE,
|
||||
#endif
|
||||
},
|
||||
},
|
||||
|
||||
2031
User/module/shoot.c
2031
User/module/shoot.c
File diff suppressed because it is too large
Load Diff
@ -102,6 +102,7 @@ typedef struct {
|
||||
}Shoot_JamDetection_t;
|
||||
|
||||
typedef struct {
|
||||
bool ref_online; /* 裁判系统数据是否在线 */
|
||||
/* 从裁判系统读取的常量 */
|
||||
float Hmax; // 热量上限
|
||||
float Hcd; // 热量冷却速度
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
/* Includes ----------------------------------------------------------------- */
|
||||
#include "cmsis_os.h"
|
||||
#include "task/user_task.h"
|
||||
/* USER INCLUDE BEGIN */
|
||||
#include "device/mrobot.h"
|
||||
@ -20,6 +21,7 @@
|
||||
Shoot_t shoot;
|
||||
Shoot_CMD_t shoot_cmd;
|
||||
Referee_ForShoot_t shoot_ref;
|
||||
Shoot_AI_t shoot_forai;
|
||||
/* USER STRUCT END */
|
||||
|
||||
/* Private function --------------------------------------------------------- */
|
||||
@ -71,11 +73,17 @@ void Task_ctrl_shoot(void *argument) {
|
||||
osMessageQueueGet(task_runtime.msgq.shoot.cmd, &shoot_cmd, NULL, 0);
|
||||
osMessageQueueGet(task_runtime.msgq.shoot.ref, &shoot_ref, NULL, 0);
|
||||
|
||||
|
||||
Shoot_DumpAI(&shoot, &shoot_forai);
|
||||
osMessageQueuePut(task_runtime.msgq.ai.rawdata_FromShoot, &shoot_forai, 0, 0);
|
||||
if (shoot_ref.ref_status == REF_STATUS_RUNNING) {
|
||||
shoot.heatcontrol.ref_online = true;
|
||||
shoot.heatcontrol.Hmax = (float)shoot_ref.robot_status.shooter_barrel_heat_limit;
|
||||
shoot.heatcontrol.Hcd = (float)shoot_ref.robot_status.shooter_barrel_cooling_value;
|
||||
shoot.heatcontrol.Hnow = (float)shoot_ref.power_heat.shooter_42mm_barrel_heat;
|
||||
shoot.heatcontrol.Hgen = 10.0f; /* 42mm弹丸每发产生热量 */
|
||||
} else {
|
||||
shoot.heatcontrol.ref_online = false;
|
||||
}
|
||||
Shoot_UpdateFeedback(&shoot);
|
||||
Shoot_SetMode(&shoot,shoot_cmd.mode);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user