feat:增加避障时间可调参数

This commit is contained in:
2024-07-13 19:10:00 +08:00
parent b88aaf47e5
commit f7b52d9d2e
4 changed files with 6 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ int temp_min_s;
int temp_max_s;
int barrier_begin_flag = 0;
int barrier_count = 0;
float barrirer_time=500.f;
void CheckBarrier()
{
if (barrier_type == BARRIER_NONE && Lpt0_found_barrier_in && !Lpt1_found_barrier_in && is_straight1) {
@@ -33,7 +33,7 @@ void RunBarrier()
}
if (barrier_type == BARRIER_LEFT_RUNNING)
{
if (timer_get(TIM_2) >= 500)
if (timer_get(TIM_2) >= barrirer_time)
{
barrier_type = BARRIER_NONE;
timer_stop(TIM_2);
@@ -126,7 +126,7 @@ void RunBarrier()
}
if (barrier_type == BARRIER_RIGHT_RUNNING)
{
if (timer_get(TIM_2) >= 500)
if (timer_get(TIM_2) >= barrirer_time)
{
barrier_type = BARRIER_NONE;
timer_stop(TIM_2);

View File

@@ -30,7 +30,7 @@ extern float (*mid_track_s)[2];
extern int32_t mid_track_count_s;
extern int temp_min_s;
extern int temp_max_s;
extern float barrirer_time;
void CheckBarrier(void);
void Check_s(void);
void RunBarrier(void);

View File

@@ -30,6 +30,7 @@ void jj_param_eeprom_init(void)
PARAM_REG(aim_turn, &turn_aim, EFLOAT, 1, "tur:");
PARAM_REG(baoguang, &FIX_BINTHRESHOLD, EFLOAT, 1, "bao:");
PARAM_REG(auto_exp_param, &auto_exp, EFLOAT, 1, "exp:");
PARAM_REG(barr_time, &barrirer_time, EFLOAT, 1, "bar:");
jj_param_read(); // 注冊
}
/**

View File

@@ -30,6 +30,7 @@ typedef enum {
// 第二页参数
baoguang = Page2_head,
auto_exp_param,
barr_time,
Page3_head,
DATA_IN_FLASH_NUM,