//
|
// Created by YY on 2019/10/21.
|
//
|
|
#ifndef RTKDRIVERTEST_DRIVER_TEST_H
|
#define RTKDRIVERTEST_DRIVER_TEST_H
|
|
#include "Geometry.h"
|
#include "rtk_module/rtk.h"
|
#include "test_items2/dummy_light.h"
|
|
#include <vector>
|
#include <string>
|
#include <list>
|
|
#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
|
#define AXIAL_REAR 1
|
|
using namespace std;
|
|
struct car_desc_ {
|
double distance; // 距离主天线的距离
|
double angle; // 从中轴线逆时针形成的角度
|
};
|
|
struct RtkTime {
|
int YY;
|
int MM;
|
int DD;
|
int hh;
|
int mm;
|
int ss;
|
int mss;
|
};
|
|
typedef struct {
|
struct RtkTime tm;
|
PointF basePoint; // 现场测量的主天线坐标
|
int axial[2];
|
int left_front_tire[2];
|
int right_front_tire[2];
|
int left_rear_tire[2];
|
int right_rear_tire[2];
|
int bodyNum;
|
int *body;
|
int pointNum;
|
double antPitch; // 前后天线因安装位置之固有pitch角
|
double antHeight; // 车顶天线高程
|
double groundHeight; // 大地高程
|
double yaw;
|
double pitch;
|
struct car_desc_ *carDesc; // 经现场测量点计算后的值
|
PointF *carXY; // 计算后的车身各点坐标
|
} car_model;
|
|
// 总数
|
// 中轴线前点,id 0,中轴线后点id
|
// 左包围, 右包围
|
// 左前轮,外内
|
typedef struct {
|
int body_num;
|
int body[64];
|
int front_left_tire[2];
|
int front_right_tire[2];
|
int rear_left_tire[2];
|
int rear_right_tire[2];
|
} carModelDesc_t;
|
|
typedef struct {
|
uint32_t uptime;
|
int point_num;
|
PointF *points;
|
carModelDesc_t *desc;
|
} car_model_cache_t;
|
|
struct ExamFault {
|
int sn;
|
char utc[32];
|
int wrong_id;
|
};
|
|
struct trigger_line_t {
|
int triggerMapId;
|
Polygon line;
|
};
|
|
struct road_exam_map {
|
int id;
|
int type;
|
|
string tts;
|
|
int redLineNum;
|
Polygon *redLine;
|
|
int greenLineNum;
|
Polygon *greenLine;
|
|
int redAreaNum;
|
Polygon *redArea;
|
|
int triggerLineNum;
|
trigger_line_t *triggerLine;
|
|
int roadEdgeLineNum; // 道路边线,只有直线驾驶、靠边停车才有
|
Polygon *roadEdgeLine;
|
|
Polygon area; // 子项目的区域
|
Line stopLine; // 诸如人行道、路口等考点的停止线
|
int flagStop; // 到达开始线前,是否需要停车
|
};
|
|
typedef vector<struct road_exam_map> LIST_ROAD_MAP;
|
|
typedef list<car_model *> LIST_CAR_MODEL;
|
|
//vector<ExamFault> ExamFaultList;
|
|
void DriverTestInit(void);
|
void ReadDriverExamPrimer(void);
|
void ClearMap(void);
|
void AddMap(int id, int type, const double (*map)[2], int pointNum, const double (*map2)[2], int pointNum2);
|
void CleanRoadMap(void);
|
void SetRoadMapPoints(vector<double> &mapPoints);
|
void AddRoadMapParent(int id, int type, string tts, int stopFlag, vector<vector<int>> &redLines,
|
vector<vector<int>> &redAreas, vector<vector<int>> &greenLines,
|
vector<vector<int>> &triggerLines, vector<vector<int>> &roadEdgeLines,
|
vector<int> area, vector<int> stopLine);
|
|
void SetCarMeasurePoint(double *basePoint, int *axial, int *left_front_tire,
|
int *right_front_tire, int *left_rear_tire, int *right_rear_tire,
|
int *body, int bodyNum, double (*point)[2], int pointNum, double antPitch, double antHeight, double groundHeight);
|
|
void StartDriverExam(int start, int type);
|
void StartMapExam(int map_id, int exam);
|
|
void UpdateRTKInfo(const rtk_info *s);
|
void AddExamFault(int wrong, const struct RtkTime *rtkTime);
|
car_model_cache_t *GetCarModelCache(int node);
|
void SystemShutdown(int event, int timeout);
|
|
void SetDummyLightExam(int n, struct dummy_light_exam *cfg);;
|
|
#endif //RTKDRIVERTEST_DRIVER_TEST_H
|