This commit is contained in:
bmy
2024-03-23 09:17:04 +08:00
5 changed files with 33 additions and 5 deletions

View File

@@ -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--) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
// }
// }
}

View File

@@ -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()