fctom1215
2020-02-27 ce568d65d1738e0dfe64e0f903c9aa8d05cd365b
角度修正。
2个文件已添加
8个文件已修改
74 ■■■■ 已修改文件
lib/src/main/cpp/CMakeLists.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/driver_test.cpp 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/driver_test.h 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/native-lib.cpp 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/test_items/park_bottom.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/test_items/park_edge.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/test_items/stop_and_start.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/test_items/turn_a90.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/test_items2/common_check.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/test_items2/common_check.h 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/cpp/CMakeLists.txt
@@ -34,6 +34,9 @@
        test_items/driving_curve.cpp
        test_items/turn_a90.cpp
        test_items/comm_test.cpp
        test_items2/common_check.cpp
        rtk_module/rtk.cpp
        rtk_module/virtual_rtk.cpp
        master/comm_if.cpp
lib/src/main/cpp/driver_test.cpp
@@ -79,7 +79,7 @@
static int CurrExamMapIndex = -1;
static int CurrEnterMapIndex = -1;
static int CurrExamStatus = 0;      // 1 测试完成 0 测试中 -1 测试错误退出
static int CurrExamStatus = EXAM_AREA_NONE;      // 1 测试完成 0 测试中 -1 测试错误退出
static car_model *CarModel = NULL;
static car_model *CarModelPrev = NULL;
@@ -132,6 +132,8 @@
    RtkBuffer = (rtk_info *) malloc(RTK_BUFFER_SIZE * sizeof(rtk_info));
    RtkBufferNum = RtkBufferIn = 0;
    CurrExamStatus = EXAM_AREA_NONE;
}
static void ReadDriverExamPrimerTimeout(union sigval sig)
@@ -397,7 +399,7 @@
    if (map_id >= 0 && exam == 0) {
        CurrExamMapIndex = map_id;
        CurrExamStatus = 2;
        CurrExamStatus = EXAM_AREA_START;
    }
}
@@ -497,7 +499,7 @@
                        MA_EnterMap(GetMapId(CurrEnterMapIndex, MapList, MapNum), 1);
                        CurrExamMapIndex = CurrEnterMapIndex;
                        CurrExamStatus = 2;
                        CurrExamStatus = EXAM_AREA_START;
                    }
                } else {
                    if (ExitMap(CarModel, CurrEnterMapIndex, MapList, MapNum)) {
@@ -513,7 +515,7 @@
        if (CurrExamMapIndex >= 0) {
            int mtype = GetMapType(CurrExamMapIndex, MapList, MapNum);
            if (CurrExamStatus == 2) {
            if (CurrExamStatus == EXAM_AREA_START) {
                DEBUG("CurrExamMapIndex %d mtype %d", GetMapId(CurrExamMapIndex, MapList, MapNum), mtype);
                switch (mtype) {
@@ -522,20 +524,20 @@
                        MA_SendDebugInfo("进入倒车入库场地 %d", GetMapId(CurrExamMapIndex, MapList, MapNum));
                        StartParkBottom(move, &rtkTime);
                        CurrExamStatus = 0;
                        CurrExamStatus = EXAM_AREA_RUN;
                        break;
                    case MAP_TYPE_STOP_START:
                        DEBUG("进入上坡起步场地");
                        MA_SendDebugInfo("进入上坡起步场地 %d", GetMapId(CurrExamMapIndex, MapList, MapNum));
                        StartSAS(move, &rtkTime);
                        CurrExamStatus = 0;
                        CurrExamStatus = EXAM_AREA_RUN;
                        break;
                    case MAP_TYPE_PART_EDGE:
                        DEBUG("进入侧方位停车场地");
                        MA_SendDebugInfo("进入侧方位停车场地 %d", GetMapId(CurrExamMapIndex, MapList, MapNum));
                        StartParkEdge(move, &rtkTime);
                        CurrExamStatus = 0;
                        CurrExamStatus = EXAM_AREA_RUN;
                        break;
                    case MAP_TYPE_CURVE:
                        break;
@@ -543,38 +545,44 @@
                        DEBUG("进入直角转弯场地");
                        MA_SendDebugInfo("进入直角转弯场地 %d", GetMapId(CurrExamMapIndex, MapList, MapNum));
                        StartTurnA90(move, azimuth, &rtkTime);
                        CurrExamStatus = 0;
                        CurrExamStatus = EXAM_AREA_RUN;
                        break;
                    default:break;
                }
            } else if (CurrExamStatus == 0) {
            } else if (CurrExamStatus == EXAM_AREA_RUN) {
                int testing = 0;
                switch (mtype) {
                    case MAP_TYPE_PARK_BUTTOM:
                        CurrExamStatus = TestParkBottom(&MapList[CurrExamMapIndex].map,
                        testing = TestParkBottom(&MapList[CurrExamMapIndex].map,
                                                        CarModel, CarModelPrev, speed, move, &rtkTime);
                        break;
                    case MAP_TYPE_STOP_START:
                        CurrExamStatus = TestSAS(&MapList[CurrExamMapIndex].map, CarModel, CarModelPrev, speed, move, &rtkTime);
                        testing = TestSAS(&MapList[CurrExamMapIndex].map, CarModel, CarModelPrev, speed, move, &rtkTime);
                        break;
                    case MAP_TYPE_PART_EDGE:
                        CurrExamStatus = TestParkEdge(&MapList[CurrExamMapIndex].map, CarModel, CarModelPrev, speed, move, &rtkTime);
                        testing = TestParkEdge(&MapList[CurrExamMapIndex].map, CarModel, CarModelPrev, speed, move, &rtkTime);
                        break;
                    case MAP_TYPE_CURVE:
                        break;
                    case MAP_TYPE_TURN_90:
                        CurrExamStatus = TestTurnA90(&MapList[CurrExamMapIndex].map, CarModel, CarModelPrev, azimuth, speed, move, &rtkTime);
                        testing = TestTurnA90(&MapList[CurrExamMapIndex].map, CarModel, CarModelPrev, azimuth, speed, move, &rtkTime);
                        break;
                    default:
                        CurrExamStatus = 1;
                        break;
                }
                if (testing > 0) {
                    CurrExamStatus = EXAM_AREA_RUN;
                } else {
                    CurrExamStatus = EXAM_AREA_END;
                }
            }
            if (CurrExamStatus == 1) {
            if (CurrExamStatus != EXAM_AREA_RUN) {
                // 某项结束
                //DEBUG("退出场地 %d", GetMapId(CurrExamMapIndex, MapList, MapNum));
                //MA_SendDebugInfo("退出场地 %d", GetMapId(CurrExamMapIndex, MapList, MapNum));
                CurrExamStatus = EXAM_AREA_NONE;
                CurrExamMapIndex = -1;
            }
        }
lib/src/main/cpp/driver_test.h
@@ -10,6 +10,11 @@
#include <vector>
#define EXAM_AREA_NONE          0
#define EXAM_AREA_START         1
#define EXAM_AREA_RUN           2
#define EXAM_AREA_END           3
#define TIRE_OUTSIDE    0
#define TIRE_INSIDE     1
#define AXIAL_FRONT     0
lib/src/main/cpp/native-lib.cpp
@@ -26,6 +26,9 @@
const int RTK_PLATFORM_PORT = 12125;
const uint8_t phone[] = {0x20,0x19,0x10,0x15,0x00,0x00,0x00,0x01};
const char *VIRTUAL_RTK_IP = "192.168.3.52";
const int VIRTUAL_RTK_PORT = 9001;
static void SendBootIndicate(union sigval sig);
int DESEncrypt(const uint8_t *key, int key_length,
@@ -245,7 +248,7 @@
    InitPlatform(phone, RTK_PLATFORM_IP, RTK_PLATFORM_PORT);
    AppTimer_add(SendBootIndicate, 500);
    InitVirtualDevice("192.168.86.101", 9001);
    InitVirtualDevice(VIRTUAL_RTK_IP, VIRTUAL_RTK_PORT);
}
static void SendBootIndicate(union sigval sig) {
lib/src/main/cpp/test_items/park_bottom.cpp
@@ -209,7 +209,7 @@
    }
TEST_END:
    return testing ? 0 : 1;
    return testing ? 1 : 0;
}
// 检测2前轮是否正向越过左右控制线
lib/src/main/cpp/test_items/park_edge.cpp
@@ -165,7 +165,7 @@
        }
    }
TEST_END:
    return testing ? 0 : 1;
    return testing ? 1 : 0;
}
// 车轮是否压道路边线
lib/src/main/cpp/test_items/stop_and_start.cpp
@@ -171,7 +171,7 @@
        }
    }
    return testing ? 0 : 1;
    return testing ? 1 : 0;
}
// 车轮是否压边线
lib/src/main/cpp/test_items/turn_a90.cpp
@@ -112,7 +112,7 @@
    }
TEST_END:
    return testing?0:1;
    return testing? 1:0;
}
// 车轮是否压边线
lib/src/main/cpp/test_items2/common_check.cpp
New file
@@ -0,0 +1,5 @@
//
// Created by fctom on 2020/2/27.
//
#include "common_check.h"
lib/src/main/cpp/test_items2/common_check.h
New file
@@ -0,0 +1,8 @@
//
// Created by fctom on 2020/2/27.
//
#ifndef MYAPPLICATION2_COMMON_CHECK_H
#define MYAPPLICATION2_COMMON_CHECK_H
#endif //MYAPPLICATION2_COMMON_CHECK_H