避障修改

This commit is contained in:
Glz
2024-07-08 17:54:34 +08:00
parent 336d1bc100
commit dc874bf6f1
3 changed files with 40 additions and 4 deletions

View File

@@ -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,7 +115,8 @@ void RunBarrier()
// }
// }
// }
if (pts_resample_right_count >= 5)
{
if (Lpt1_found) {
Lpt1_found_count++;
}
@@ -110,6 +136,11 @@ void RunBarrier()
}
}
}
else{
track_type = TRACK_LEFT;
barrier_type = BARRIER_NONE;
}
}
}
void Check_s()

View File

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

View File

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