fctom1215
2020-02-19 dc2a01d4764efd33a23afcaf4f1d7543dc35c4fa
lib/src/main/cpp/test_items/turn_a90.cpp
@@ -19,7 +19,7 @@
const uint32_t STOP_CAR_TIME = D_SEC(2);
static bool TA90Testing;
static bool testing;
static int enterAreaHeading;
static bool turnLeftFinished;
@@ -35,6 +35,7 @@
void StartTurnA90(int moveDirect, double heading, const struct RtkTime *rtkTime)
{
    DEBUG("进入直角转弯场地");
    testing = true;
    enterAreaHeading = (int) heading;
    prevMoveDirect = moveDirect;
    if (moveDirect == 0) {
@@ -47,10 +48,11 @@
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)) {
@@ -86,15 +88,11 @@
    }
    // 检查转向状态
    int az = (int) heading;
    if (ABS(az - enterAreaHeading) > 180) {
        az = 360 - ABS(az-enterAreaHeading);
    } else {
        az = ABS(az - enterAreaHeading);
    }
    if (az >= 30) {
        if (!turnLeftFinished) {
@@ -113,8 +111,8 @@
    if (turnLeftFinished) {
    }
    return status;
TEST_END:
    return testing?0:1;
}
// 车轮是否压边线