| | |
| | | |
| | | const uint32_t STOP_CAR_TIME = D_SEC(2); |
| | | |
| | | static bool TA90Testing; |
| | | static bool testing; |
| | | |
| | | static int enterAreaHeading; |
| | | static bool turnLeftFinished; |
| | |
| | | void StartTurnA90(int moveDirect, double heading, const struct RtkTime *rtkTime) |
| | | { |
| | | DEBUG("进入直角转弯场地"); |
| | | testing = true; |
| | | enterAreaHeading = (int) heading; |
| | | prevMoveDirect = moveDirect; |
| | | if (moveDirect == 0) { |
| | |
| | | |
| | | int TestTurnA90(const Polygon *map, const car_model *car, const car_model *carPrev, double heading, double speed, int moveDirect, const struct RtkTime *rtkTime) |
| | | { |
| | | int status = 0; |
| | | int az = (int) heading; |
| | | |
| | | if (ExitTestArea(map, car)) { |
| | | status = 1; |
| | | testing = false; |
| | | goto TEST_END; |
| | | } |
| | | |
| | | if (CrashRedLine(map, car)) { |
| | |
| | | } |
| | | |
| | | // 检查转向状态 |
| | | int az = (int) heading; |
| | | |
| | | if (ABS(az - enterAreaHeading) > 180) { |
| | | az = 360 - ABS(az-enterAreaHeading); |
| | | } else { |
| | | az = ABS(az - enterAreaHeading); |
| | | } |
| | | |
| | | |
| | | |
| | | if (az >= 30) { |
| | | if (!turnLeftFinished) { |
| | |
| | | if (turnLeftFinished) { |
| | | |
| | | } |
| | | |
| | | return status; |
| | | TEST_END: |
| | | return testing?0:1; |
| | | } |
| | | |
| | | // 车轮是否压边线 |