fix: 避障bug修复

This commit is contained in:
2024-03-30 11:43:43 +08:00
parent 77558d2a31
commit 9e23f1968d
7 changed files with 32 additions and 33 deletions

View File

@@ -20,7 +20,7 @@ void RunBarrier()
if (Lpt0_found) {
Lpt0_found_count++;
}
if (Lpt0_found_count >= 1 && time_barrier >= 5000) {
if (Lpt0_found_count >= 1) {
Lpt0_found_count = 0;
barrier_type = BARRIER_LEFT_RUNNING;
track_type = TRACK_RIGHT;
@@ -30,7 +30,7 @@ void RunBarrier()
} else if (barrier_type == BARRIER_LEFT_RUNNING) {
track_type = TRACK_RIGHT;
time_barrier = timer_get(TIM_3);
if (time_barrier >= 5000) {
if (time_barrier >= 1000) {
barrier_type = BARRIER_NONE;
track_type = TRACK_RIGHT;
timer_start(TIM_3);
@@ -53,7 +53,7 @@ void RunBarrier()
} else if (barrier_type == BARRIER_RIGHT_RUNNING) {
track_type = TRACK_LEFT;
time_barrier = timer_get(TIM_3);
if (time_barrier >= 5000) {
if (time_barrier >= 1000) {
timer_start(TIM_3);
timer_clear(TIM_3);
barrier_type = BARRIER_NONE;