修改热量控制

This commit is contained in:
RB
2025-03-16 22:40:45 +08:00
parent 740dc38e96
commit 6d581c4c04
6 changed files with 8727 additions and 8701 deletions

View File

@@ -103,6 +103,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 == 25.0f) return 6600.f;
if (bullet_speed == 30.0f) return 7350.f;
} else {
if (bullet_speed == 10.0f) return 4450.f;

View File

@@ -188,7 +188,7 @@ static const Config_RobotParam_t param_default = {
.cover_open_duty = 0.10f,
.cover_close_duty = 0.050f,
.model = SHOOT_MODEL_17MM,
.bullet_speed = 30.f,
.bullet_speed = 25.f,
.min_shoot_delay = (uint32_t)(1000.0f / 10.0f),
}, /* shoot */

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 -------------------------------------------------------- */
@@ -84,7 +84,7 @@ static int8_t Shoot_HeatLimit(Shoot_t *s, Referee_ForShoot_t *s_ref) {
/* 检测热量更新后,计算可发射弹丸 */
if ((hc->heat != hc->last_heat) || (hc->heat == 0)) {
hc->available_shot =
(uint32_t)floorf((hc->heat_limit - hc->heat) / hc->heat_increase);
(uint32_t)floorf((hc->heat_limit - hc->heat) / hc->heat_increase) - 2;
hc->last_heat = hc->heat;
}
/* 计算已发射弹丸 */