From 07b520985386c4d0b516d73707750aca2d919af9 Mon Sep 17 00:00:00 2001 From: Glz <354338225@qq.com> Date: Sat, 23 Mar 2024 09:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E8=A7=92=E7=82=B9=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E4=B8=8E=E5=B8=B8=E8=A7=84=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gl_cross.c | 8 ++++---- app/gl_data.c | 4 ++++ app/gl_data.h | 4 ++++ app/gl_get_corners.c | 17 ++++++++++++++++- app/gl_tracking.c | 5 +++++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/gl_cross.c b/app/gl_cross.c index 497ffe9..ed53ec2 100644 --- a/app/gl_cross.c +++ b/app/gl_cross.c @@ -69,9 +69,9 @@ void cross_farline(){ } } /*如果一行全为白色没写*/ - if (far_x1 <= 40) + if (far_x1 <= 30) { - far_x1 = 40; + far_x1 = 30; } for (; h1 > 0; h1--) { @@ -98,9 +98,9 @@ void cross_farline(){ } } /*如果一行全为白色没写*/ - if (far_x2 >= 140) + if (far_x2 >= 120) { - far_x2 = 140; + far_x2 = 120; } for (; h2 > 0; h2--) { diff --git a/app/gl_data.c b/app/gl_data.c index 07cf8d5..2e9479c 100644 --- a/app/gl_data.c +++ b/app/gl_data.c @@ -80,6 +80,8 @@ bool Lpt0_found; bool Lpt1_found; bool Lpt0_found_barrier; bool Lpt1_found_barrier; +bool Lpt0_found_barrier_in; +bool Lpt1_found_barrier_in; int Lpt1[2]; int Lpt0[2]; int far_Lpt1[2]; @@ -91,6 +93,8 @@ bool Lpt_in0_found; bool Lpt_in1_found; int Lpt_in1[2]; int Lpt_in0[2]; +int Lpt0_found_barrier_in_id; +int Lpt1_found_barrier_in_id; bool is_straight0; bool is_straight1; diff --git a/app/gl_data.h b/app/gl_data.h index 4d53dd7..55c4bc8 100644 --- a/app/gl_data.h +++ b/app/gl_data.h @@ -107,6 +107,10 @@ extern bool is_straight0; extern bool is_straight1; extern bool is_far_straight0; extern bool is_far_straight1; +extern bool Lpt0_found_barrier_in; +extern bool Lpt1_found_barrier_in; +extern int Lpt0_found_barrier_in_id; +extern int Lpt1_found_barrier_in_id; extern bool is_turn0; extern bool is_turn1; diff --git a/app/gl_get_corners.c b/app/gl_get_corners.c index 9d24e3a..686113f 100644 --- a/app/gl_get_corners.c +++ b/app/gl_get_corners.c @@ -43,8 +43,15 @@ void get_corners() { Lpt0_rpts0s_id_barrier = i; Lpt0_found_barrier = true; } - } + // if(Lpt0_found_barrier){ + // float angle1 = calculate_vector_angle(pts_resample_left[Lpt0_rpts0s_id_barrier][1],pts_resample_left[Lpt0_rpts0s_id_barrier][0],pts_resample_left[Lpt0_rpts0s_id_barrier+5][1],pts_resample_left[Lpt0_rpts0s_id_barrier+5][0]); + // if(angle1 < 85.) { + // Lpt0_found_barrier_in = true; + // Lpt0_found_barrier = false; + // Lpt0_found_barrier_in_id = Lpt0_rpts0s_id_barrier; + // } + // } @@ -82,6 +89,14 @@ void get_corners() { Lpt1_found_barrier = true; } } + // if(Lpt1_found_barrier){ + // float angle2 = calculate_vector_angle(pts_resample_right[Lpt1_rpts1s_id_barrier][1],pts_resample_right[Lpt1_rpts1s_id_barrier][0],pts_resample_right[Lpt1_rpts1s_id_barrier+5][1],pts_resample_right[Lpt1_rpts1s_id_barrier+5][0]); + // if(angle2 > 100.) { + // Lpt1_found_barrier_in = true; + // Lpt1_found_barrier = false; + // Lpt1_found_barrier_in_id = Lpt1_rpts1s_id_barrier; + // } + // } } diff --git a/app/gl_tracking.c b/app/gl_tracking.c index 56edb62..a911ef9 100644 --- a/app/gl_tracking.c +++ b/app/gl_tracking.c @@ -47,6 +47,11 @@ void ElementJudge() cross_type = CROSS_NONE; circle_type = CIRCLE_NONE; } + if (cross_type != CROSS_NONE) + { + circle_type = CIRCLE_NONE; + } + } void ElementRun()