From dc874bf6f198cb0bd45c611c0de6ec2db8ae2470 Mon Sep 17 00:00:00 2001 From: Glz <354338225@qq.com> Date: Mon, 8 Jul 2024 17:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E9=9A=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gl_barrier.c | 37 ++++++++++++++++++++++++++++++++++--- app/gl_garage.c | 2 +- app/gl_tracking.c | 5 +++++ 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/app/gl_barrier.c b/app/gl_barrier.c index 4830c2a..28e7130 100644 --- a/app/gl_barrier.c +++ b/app/gl_barrier.c @@ -46,7 +46,8 @@ void RunBarrier() // } // } // } - + if (pts_resample_left_count >= 5) + { if (Lpt0_found) { Lpt0_found_count++; } @@ -66,6 +67,30 @@ void RunBarrier() } } } + else{ + track_type = TRACK_RIGHT; + barrier_type = BARRIER_NONE; + } + + // if (Lpt0_found) { + // Lpt0_found_count++; + // } + // if (Lpt0_found_count >= 1 && barrier_type == BARRIER_LEFT_BEGIN) { + // Lpt0_found_count = 0; + // barrier_type = BARRIER_LEFT_RUNNING; + // track_type = TRACK_RIGHT; + // timer_clear(TIM_2); + // timer_start(TIM_2); + // } else if (barrier_type == BARRIER_LEFT_RUNNING) { + // track_type = TRACK_RIGHT; + // if (timer_get(TIM_2) >= 500) { + // barrier_type = BARRIER_NONE; + // track_type = TRACK_RIGHT; + // timer_stop(TIM_2); + // timer_clear(TIM_2); + // } + // } + } if (barrier_type == BARRIER_RIGHT_BEGIN||barrier_type == BARRIER_RIGHT_RUNNING) { track_type = TRACK_LEFT; @@ -90,8 +115,9 @@ void RunBarrier() // } // } // } - - if (Lpt1_found) { + if (pts_resample_right_count >= 5) + { + if (Lpt1_found) { Lpt1_found_count++; } if (Lpt1_found_count >= 1 && barrier_type == BARRIER_RIGHT_BEGIN) { @@ -109,6 +135,11 @@ void RunBarrier() track_type = TRACK_LEFT; } } + } + else{ + track_type = TRACK_LEFT; + barrier_type = BARRIER_NONE; + } } } diff --git a/app/gl_garage.c b/app/gl_garage.c index afd144a..68bd14c 100644 --- a/app/gl_garage.c +++ b/app/gl_garage.c @@ -44,7 +44,7 @@ void CheckGarage() int banmaxian_hangshu = 0;//斑马线行数 //从下往上扫描 - for (int y = BEGINH_L - 6; y >= BEGINH_L - 9; y--) + for (int y = BEGINH_L + 2; y >= BEGINH_L - 2; y--) { int banmaxian_kuandu=0; //int banmaxian_hangshu=0; diff --git a/app/gl_tracking.c b/app/gl_tracking.c index 6682ea8..606d10e 100644 --- a/app/gl_tracking.c +++ b/app/gl_tracking.c @@ -309,6 +309,11 @@ void MidLineTrack() // pure_angle_half = last_pure_angle_half; } } + if (garage_type == GARAGE_FOUND) + { + pure_angle = 0.f; + } + // if (barrier_type == BARRIER_LEFT_BEGIN) { // // dx_near = mid_track[aim_idx_near][1] - cx + barrier_offset;