修改弹速

This commit is contained in:
RB 2025-03-16 23:02:55 +08:00
parent fe7d4bd705
commit 1b0ed78b10
13 changed files with 12175 additions and 12169 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -37,45 +37,9 @@ Note: source file '..\User\task\ai.c' - object file renamed from 'DevC\ai.o' to
Note: source file '..\User\task\can.c' - object file renamed from 'DevC\can.o' to 'DevC\can_3.o'.
Note: source file '..\User\task\cap.c' - object file renamed from 'DevC\cap.o' to 'DevC\cap_1.o'.
Note: source file '..\User\task\referee.c' - object file renamed from 'DevC\referee.o' to 'DevC\referee_1.o'.
compiling ballistics.c...
compiling freertos.c...
compiling ahrs.c...
compiling capacity.c...
compiling crc16.c...
compiling cmd.c...
compiling filter.c...
compiling mixer.c...
compiling pid.c...
compiling user_math.c...
compiling bmi088.c...
compiling ui.c...
compiling can.c...
compiling dr16.c...
compiling ist8310.c...
compiling ai.c...
compiling cap.c...
compiling referee.c...
compiling config.c...
compiling chassis.c...
compiling gimbal.c...
compiling shoot.c...
compiling ai.c...
compiling atti_esti.c...
compiling can.c...
compiling cap.c...
compiling cli.c...
compiling command.c...
compiling ctrl_chassis.c...
compiling ctrl_gimbal.c...
compiling ctrl_shoot.c...
compiling info.c...
compiling init.c...
compiling monitor.c...
compiling rc.c...
compiling referee.c...
compiling user_task.c...
linking...
Program Size: Code=149536 RO-data=6928 RW-data=1104 ZI-data=43832
Program Size: Code=149584 RO-data=6928 RW-data=1104 ZI-data=43832
FromELF: creating hex file...
"DevC\DevC.axf" - 0 Error(s), 0 Warning(s).
@ -91,7 +55,7 @@ Package Vendor: Keil
C:\Users\lvzucheng\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.15.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
<h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:08
Build Time Elapsed: 00:00:02
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
<title>Static Call Graph - [DevC\DevC.axf]</title></head>
<body><HR>
<H1>Static Call Graph for image DevC\DevC.axf</H1><HR>
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6160001: Last Updated: Sun Mar 16 10:24:19 2025
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6160001: Last Updated: Sun Mar 16 23:01:30 2025
<BR><P>
<H3>Maximum Stack Usage = 632 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
Call chain for Maximum Stack Depth:</H3>
@ -1353,7 +1353,7 @@ Global Symbols
<BR>[Called By]<UL><LI><a href="#[268]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;Referee_Parse
</UL>
<P><STRONG><a name="[280]"></a>CalculateRpm</STRONG> (Thumb, 284 bytes, Stack size 20 bytes, user_math.o(.text.CalculateRpm))
<P><STRONG><a name="[280]"></a>CalculateRpm</STRONG> (Thumb, 320 bytes, Stack size 20 bytes, user_math.o(.text.CalculateRpm))
<BR><BR>[Stack]<UL><LI>Max Depth = 20<LI>Call Chain = CalculateRpm
</UL>
<BR>[Called By]<UL><LI><a href="#[27c]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;Shoot_Control

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -107,6 +107,7 @@ inline float CalculateRpm(float bullet_speed, float fric_radius, bool is17mm) {
if (is17mm) {
if (bullet_speed == 15.0f) return 4670.f;
if (bullet_speed == 18.0f) return 5200.f;
if (bullet_speed == 30.0f) return 6600.f;
if (bullet_speed == 30.0f) return 7350.f;
} else {
if (bullet_speed == 10.0f) return 4450.f;

View File

@ -2,21 +2,21 @@
*
*/
#include "config.h"
#include "config.h"
#include <stdint.h>
#include <string.h>
#include <stdint.h>
#include <string.h>
#include "bsp/flash.h"
#include "bsp/flash.h"
#define CONFIG_BASE_ADDRESS (ADDR_FLASH_SECTOR_11)
#define CONFIG_BASE_ADDRESS (ADDR_FLASH_SECTOR_11)
/* clang-format off */
#ifdef DEBUG
Config_RobotParam_t param_default = {
#else
static const Config_RobotParam_t param_default = {
#endif
/* clang-format off */
#ifdef DEBUG
Config_RobotParam_t param_default = {
#else
static const Config_RobotParam_t param_default = {
#endif
.model = ROBOT_MODEL_INFANTRY,
.chassis = { /* 底盘模块参数 */
@ -58,25 +58,25 @@ static const Config_RobotParam_t param_default = {
.gimbal = { /* 云台模块参数 */
.pid = {
{
// /* GIMBAL_PID_YAW_OMEGA_IDX */
// .k = 0.25f,
// .p = 1.0f,
// .i = 1.0f,
// .d = 0.0f,
// .i_limit = 1.0f,
// .out_limit = 1.0f,
// .d_cutoff_freq = -1.0f,
// .range = -1.0f,
// }, {
// /* GIMBAL_PID_YAW_ANGLE_IDX */
// .k = 12.0f,
// .p = 1.0f,
// .i = 0.0f,
// .d = 0.05f,
// .i_limit = 0.0f,
// .out_limit = 10.0f,
// .d_cutoff_freq = -1.0f,
// .range = M_2PI,
// /* GIMBAL_PID_YAW_OMEGA_IDX */
// .k = 0.25f,
// .p = 1.0f,
// .i = 1.0f,
// .d = 0.0f,
// .i_limit = 1.0f,
// .out_limit = 1.0f,
// .d_cutoff_freq = -1.0f,
// .range = -1.0f,
// }, {
// /* GIMBAL_PID_YAW_ANGLE_IDX */
// .k = 12.0f,
// .p = 1.0f,
// .i = 0.0f,
// .d = 0.05f,
// .i_limit = 0.0f,
// .out_limit = 10.0f,
// .d_cutoff_freq = -1.0f,
// .range = M_2PI,
/* GIMBAL_PID_YAW_OMEGA_IDX */
.k = 0.24f,
.p = 1.0f,
@ -97,25 +97,25 @@ static const Config_RobotParam_t param_default = {
.d_cutoff_freq = -1.0f,
.range = M_2PI,
}, {
// /* GIMBAL_PID_PIT_OMEGA_IDX */
// .k = 0.35f,
// .p = 1.0f,
// .i = 0.f,
// .d = 0.003f,
// .i_limit = 1.0f,
// .out_limit = 1.0f,
// .d_cutoff_freq = -1.0f,
// .range = -1.0f,
// }, {
// /* GIMBAL_PID_PIT_ANGLE_IDX */
// .k = 15.0f,
// .p = 1.0f,
// .i = 0.0f,
// .d = 0.0f,
// .i_limit = 0.0f,
// .out_limit = 10.0f,
// .d_cutoff_freq = -1.0f,
// .range = M_2PI,
// /* GIMBAL_PID_PIT_OMEGA_IDX */
// .k = 0.35f,
// .p = 1.0f,
// .i = 0.f,
// .d = 0.003f,
// .i_limit = 1.0f,
// .out_limit = 1.0f,
// .d_cutoff_freq = -1.0f,
// .range = -1.0f,
// }, {
// /* GIMBAL_PID_PIT_ANGLE_IDX */
// .k = 15.0f,
// .p = 1.0f,
// .i = 0.0f,
// .d = 0.0f,
// .i_limit = 0.0f,
// .out_limit = 10.0f,
// .d_cutoff_freq = -1.0f,
// .range = M_2PI,
/* GIMBAL_PID_PIT_OMEGA_IDX */
.k = 0.25f,
.p = 1.0f,
@ -198,9 +198,9 @@ static const Config_RobotParam_t param_default = {
.shoot = BSP_CAN_2,
.cap = BSP_CAN_1,
}, /* can */
}; /* param_default */
}; /* param_default */
static const Config_RobotParam_t param_hero = {
static const Config_RobotParam_t param_hero = {
.model = ROBOT_MODEL_HERO,
.chassis = { /* 底盘模块参数 */
@ -343,13 +343,13 @@ static const Config_RobotParam_t param_hero = {
.shoot = BSP_CAN_2,
.cap = BSP_CAN_1,
}, /* can */
}; /* param_hero */
}; /* param_hero */
#ifdef DEBUG
Config_RobotParam_t param_sentry = {
#else
static const Config_RobotParam_t param_sentry = {
#endif
#ifdef DEBUG
Config_RobotParam_t param_sentry = {
#else
static const Config_RobotParam_t param_sentry = {
#endif
.model = ROBOT_MODEL_SENTRY,
.chassis = { /* 底盘模块参数 */
@ -413,8 +413,8 @@ static const Config_RobotParam_t param_sentry = {
}, {
/* GIMBAL_PID_PIT_OMEGA_IDX */
.k = 0.3f,
.p = 1.5f,
.k = 0.2f,
.p = 0.8f,
.i = 0.0f,
.d = 0.0f,
.i_limit = 1.0f,
@ -494,11 +494,11 @@ static const Config_RobotParam_t param_sentry = {
.shoot = BSP_CAN_2,
.cap = BSP_CAN_1,
}, /* can */
}; /* param_sentry_left */
}; /* param_sentry_left */
/* static const Config_RobotParam_t param_xxx; */
/* static const Config_RobotParam_t param_xxx; */
static const Config_PilotCfg_t cfg_qs = {
static const Config_PilotCfg_t cfg_qs = {
.param = {
.sens_mouse = 0.06f,
.sens_rc = 10.0f,
@ -526,9 +526,9 @@ static const Config_PilotCfg_t cfg_qs = {
.width = 1920,
},
},
};
};
static const Config_PilotCfg_t cfg_zyma = {
static const Config_PilotCfg_t cfg_zyma = {
.param = {
.sens_mouse = 0.06f,
.sens_rc = 6.0f,
@ -552,13 +552,13 @@ static const Config_PilotCfg_t cfg_zyma = {
.move_slow_sense = 1.6f,
},
},
};
};
/* static const Config_PilotCfg_t cfg_xx; */
/* static const Config_PilotCfg_t cfg_xx; */
/* clang-format on */
/* clang-format on */
static const Config_RobotParamMap_t robot_param_map[] = {
static const Config_RobotParamMap_t robot_param_map[] = {
{"default", &param_default},
{"infantry", &param_default},
{"hero", &param_hero},
@ -568,21 +568,21 @@ static const Config_RobotParamMap_t robot_param_map[] = {
// {"sentry_right" &param_sentry_right},
/* {"xxx", &param_xxx}, */
{NULL, NULL},
};
};
static const Config_PilotCfgMap_t pilot_cfg_map[] = {
static const Config_PilotCfgMap_t pilot_cfg_map[] = {
{"qs", &cfg_qs},
{"zyma", &cfg_zyma},
/* {"xx", &cfg_xx}, */
{NULL, NULL},
};
};
/**
/**
* \brief Flash读取配置信息
*
* \param cfg
*/
void Config_Get(Config_t *cfg) {
void Config_Get(Config_t *cfg) {
BSP_Flash_ReadBytes(CONFIG_BASE_ADDRESS, (uint8_t *)cfg, sizeof(*cfg));
cfg->pilot_cfg = Config_GetPilotCfg(cfg->pilot_cfg_name);
cfg->robot_param = Config_GetRobotParam(cfg->robot_param_name);
@ -593,27 +593,27 @@ void Config_Get(Config_t *cfg) {
if ((uint32_t)(cfg->robot_param) == UINT32_MAX)
cfg->robot_param = &param_default;
if ((uint32_t)(cfg->pilot_cfg) == UINT32_MAX) cfg->pilot_cfg = &cfg_qs;
}
}
/**
/**
* \brief Flash
*
* \param cfg
*/
void Config_Set(Config_t *cfg) {
void Config_Set(Config_t *cfg) {
osKernelLock();
BSP_Flash_EraseSector(11);
BSP_Flash_WriteBytes(CONFIG_BASE_ADDRESS, (uint8_t *)cfg, sizeof(*cfg));
osKernelUnlock();
}
}
/**
/**
* @brief
*
* @param robot_param_name
* @return const Config_RobotParam_t*
*/
const Config_RobotParam_t *Config_GetRobotParam(const char *robot_param_name) {
const Config_RobotParam_t *Config_GetRobotParam(const char *robot_param_name) {
if (robot_param_name == NULL) return NULL;
for (size_t j = 0; robot_param_map[j].name != NULL; j++) {
if (strcmp(robot_param_map[j].name, robot_param_name) == 0) {
@ -621,15 +621,15 @@ const Config_RobotParam_t *Config_GetRobotParam(const char *robot_param_name) {
}
}
return NULL; /* No match. */
}
}
/**
/**
* @brief
*
* @param pilot_cfg_name
* @return const Config_PilotCfg_t*
*/
const Config_PilotCfg_t *Config_GetPilotCfg(const char *pilot_cfg_name) {
const Config_PilotCfg_t *Config_GetPilotCfg(const char *pilot_cfg_name) {
if (pilot_cfg_name == NULL) return NULL;
for (size_t j = 0; pilot_cfg_map[j].name != NULL; j++) {
if (strcmp(pilot_cfg_map[j].name, pilot_cfg_name) == 0) {
@ -637,12 +637,13 @@ const Config_PilotCfg_t *Config_GetPilotCfg(const char *pilot_cfg_name) {
}
}
return NULL; /* No match. */
}
}
const Config_PilotCfgMap_t *Config_GetPilotNameMap(void) {
const Config_PilotCfgMap_t *Config_GetPilotNameMap(void) {
return pilot_cfg_map;
}
}
const Config_RobotParamMap_t *Config_GetRobotNameMap(void) {
const Config_RobotParamMap_t *Config_GetRobotNameMap(void) {
return robot_param_map;
}
}

View File

@ -15,7 +15,7 @@
#define HEAT_INCREASE_17MM (10.f) /* 每发射一颗17mm弹丸增加10热量 */
#define BULLET_SPEED_LIMIT_42MM (16.0)
#define BULLET_SPEED_LIMIT_17MM (30.0)
#define BULLET_SPEED_LIMIT_17MM (25.0)
/* Private macro ------------------------------------------------------------ */
/* Private variables -------------------------------------------------------- */