fix:修復幾個bug

This commit is contained in:
2024-07-05 21:29:03 +08:00
parent be37b5d206
commit 336d1bc100
4 changed files with 43 additions and 40 deletions

View File

@@ -113,11 +113,11 @@ void aim_distance_select(void)
void ElementJudge()
{
if(begin_flag == 1){
shield_type = SHIELD_BEGIN;
begin_flag = 0;
return;
}
// if(begin_flag == 1){
// shield_type = SHIELD_BEGIN;
// begin_flag = 0;
// return;
// }
if (shield_type == SHIELD_NONE) {
CheckGarage();
@@ -168,11 +168,12 @@ void ElementRun()
void MidLineTrack()
{
if (shield_type == SHIELD_BEGIN) {
shield_type = SHIELD_NONE;
system_delay_ms(1000); // 斑马线发车延时
}
else if (cross_type == CROSS_IN) {
// if (shield_type == SHIELD_BEGIN) {
// shield_type = SHIELD_NONE;
// pure_angle = 0.f;
// system_delay_ms(3500); // 斑马线发车延时
// }
if (cross_type == CROSS_IN) {
if (track_type == TRACK_LEFT) {
mid_track = mid_left; // 这是为了预先分配内存
GetMidLine_Left(pts_far_resample_left + far_Lpt0_rpts0s_id, pts_far_resample_left_count - far_Lpt0_rpts0s_id, mid_left, (int)round(ANGLEDIST / RESAMPLEDIST), PIXPERMETER * ROADWIDTH / 2);