避障巡线更改

This commit is contained in:
Glz
2024-03-23 17:37:31 +08:00
parent c557c01f32
commit 872f35613e
3 changed files with 51 additions and 17 deletions

View File

@@ -13,3 +13,25 @@ void CheckBarrier() {
}
}
void RunBarrier() {
if (barrier_type == BARRIER_LEFT_BEGIN) // 左环开始,寻外直道右线
{
track_type = TRACK_RIGHT;
}
else if (barrier_type == BARRIER_LEFT_BEGIN && ((Lpt0_found_barrier && is_straight1) || Lpt0_found) )
{
barrier_type = BARRIER_NONE;
track_type = TRACK_RIGHT;
}
if (barrier_type == BARRIER_RIGHT_BEGIN) // 左环开始,寻外直道右线
{
track_type = TRACK_LEFT;
}
else if (barrier_type == BARRIER_RIGHT_BEGIN && ((Lpt1_found_barrier && is_straight0) || Lpt1_found) )
{
barrier_type = BARRIER_NONE;
track_type = TRACK_LEFT;
}
}