feat:增加避障时间可调参数
This commit is contained in:
@@ -10,7 +10,7 @@ int temp_min_s;
|
|||||||
int temp_max_s;
|
int temp_max_s;
|
||||||
int barrier_begin_flag = 0;
|
int barrier_begin_flag = 0;
|
||||||
int barrier_count = 0;
|
int barrier_count = 0;
|
||||||
|
float barrirer_time=500.f;
|
||||||
void CheckBarrier()
|
void CheckBarrier()
|
||||||
{
|
{
|
||||||
if (barrier_type == BARRIER_NONE && Lpt0_found_barrier_in && !Lpt1_found_barrier_in && is_straight1) {
|
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 (barrier_type == BARRIER_LEFT_RUNNING)
|
||||||
{
|
{
|
||||||
if (timer_get(TIM_2) >= 500)
|
if (timer_get(TIM_2) >= barrirer_time)
|
||||||
{
|
{
|
||||||
barrier_type = BARRIER_NONE;
|
barrier_type = BARRIER_NONE;
|
||||||
timer_stop(TIM_2);
|
timer_stop(TIM_2);
|
||||||
@@ -126,7 +126,7 @@ void RunBarrier()
|
|||||||
}
|
}
|
||||||
if (barrier_type == BARRIER_RIGHT_RUNNING)
|
if (barrier_type == BARRIER_RIGHT_RUNNING)
|
||||||
{
|
{
|
||||||
if (timer_get(TIM_2) >= 500)
|
if (timer_get(TIM_2) >= barrirer_time)
|
||||||
{
|
{
|
||||||
barrier_type = BARRIER_NONE;
|
barrier_type = BARRIER_NONE;
|
||||||
timer_stop(TIM_2);
|
timer_stop(TIM_2);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ extern float (*mid_track_s)[2];
|
|||||||
extern int32_t mid_track_count_s;
|
extern int32_t mid_track_count_s;
|
||||||
extern int temp_min_s;
|
extern int temp_min_s;
|
||||||
extern int temp_max_s;
|
extern int temp_max_s;
|
||||||
|
extern float barrirer_time;
|
||||||
void CheckBarrier(void);
|
void CheckBarrier(void);
|
||||||
void Check_s(void);
|
void Check_s(void);
|
||||||
void RunBarrier(void);
|
void RunBarrier(void);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ void jj_param_eeprom_init(void)
|
|||||||
PARAM_REG(aim_turn, &turn_aim, EFLOAT, 1, "tur:");
|
PARAM_REG(aim_turn, &turn_aim, EFLOAT, 1, "tur:");
|
||||||
PARAM_REG(baoguang, &FIX_BINTHRESHOLD, EFLOAT, 1, "bao:");
|
PARAM_REG(baoguang, &FIX_BINTHRESHOLD, EFLOAT, 1, "bao:");
|
||||||
PARAM_REG(auto_exp_param, &auto_exp, EFLOAT, 1, "exp:");
|
PARAM_REG(auto_exp_param, &auto_exp, EFLOAT, 1, "exp:");
|
||||||
|
PARAM_REG(barr_time, &barrirer_time, EFLOAT, 1, "bar:");
|
||||||
jj_param_read(); // 注冊
|
jj_param_read(); // 注冊
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ typedef enum {
|
|||||||
// 第二页参数
|
// 第二页参数
|
||||||
baoguang = Page2_head,
|
baoguang = Page2_head,
|
||||||
auto_exp_param,
|
auto_exp_param,
|
||||||
|
barr_time,
|
||||||
Page3_head,
|
Page3_head,
|
||||||
DATA_IN_FLASH_NUM,
|
DATA_IN_FLASH_NUM,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user