| | |
| | | return true; |
| | | } |
| | | |
| | | static int currRoad = -1, currCrossing = -1; |
| | | |
| | | void RoadChange(int road, int status) |
| | | { |
| | | struct roadStatusBrief brief; |
| | |
| | | brief.status = status; |
| | | |
| | | MA_SendRoadStatus(&brief); |
| | | |
| | | currRoad = (status == 1? road : -1); |
| | | |
| | | DEBUG("报告长官 进出路段 road %d status %d", road, status); |
| | | } |
| | |
| | | brief.status = status; |
| | | |
| | | MA_SendCrossingStatus(&brief); |
| | | |
| | | currCrossing = (status == 1? crossing : -1); |
| | | |
| | | DEBUG("报告长官 进出路口 road %d crossing %d status %d", road, crossing, status); |
| | | } |
| | |
| | | ExamFaultList.clear(); |
| | | } |
| | | |
| | | void MasterInqRoadStatus(void) |
| | | { |
| | | struct roadStatusBrief brief; |
| | | struct crossingStatusBrief brief2; |
| | | |
| | | brief2.road_id = brief.road_id = currRoad; |
| | | |
| | | if (currRoad >= 0) { |
| | | brief.status = 1; |
| | | |
| | | if (currCrossing >= 0) { |
| | | brief2.crossing_index = currCrossing; |
| | | brief2.status = 1; |
| | | } else { |
| | | brief2.crossing_index = -1; |
| | | brief2.status = 0; |
| | | } |
| | | } |
| | | else { |
| | | brief.status = 0; |
| | | brief2.crossing_index = -1; |
| | | brief2.status = 0; |
| | | } |
| | | |
| | | MA_SendRoadStatus(&brief); |
| | | |
| | | MA_SendCrossingStatus(&brief2); |
| | | } |
| | | |
| | | /******************************************************************* |
| | | * @brief 由主天线坐标计算车身点坐标 |
| | | * @param azimuth |
| | |
| | | |
| | | uint32_t TimeGetDiff(const struct RtkTime *rtkTime1, const struct RtkTime *rtkTime2); |
| | | |
| | | void MasterInqRoadStatus(void); |
| | | |
| | | #endif //RTKDRIVERTEST_DRIVER_TEST_H |
| | |
| | | #define ID_SM_DISTANCE 0x0020 |
| | | #define ID_SM_CARSENSOR 0x0013 |
| | | |
| | | #define ID_MS_ROAD_BRIEF 0x0015 // 科目三项目标定,进出某条路的提示 |
| | | #define ID_MS_CROSSING_BRIEF 0x0016 // 科目三项目标定,接近/驶离某各路口的提示 |
| | | #define ID_SM_ROAD_BRIEF 0x0015 // 科目三项目标定,进出某条路的提示 |
| | | #define ID_SM_CROSSING_BRIEF 0x0016 // 科目三项目标定,接近/驶离某各路口的提示 |
| | | #define ID_MS_INQ_ROAD_CROSSING 0x8018 // Master查询当前路段和路口 |
| | | |
| | | #define MA_OUT_GPS_BRIEF 0x0001 |
| | | #define MA_OUT_RTK_BRIEF 0x0002 |
| | |
| | | writer.Int(brief->status); |
| | | writer.EndObject(); |
| | | |
| | | SendMsgToMainProcIndep(ID_MS_ROAD_BRIEF, sb.GetString()); |
| | | SendMsgToMainProcIndep(ID_SM_ROAD_BRIEF, sb.GetString()); |
| | | } |
| | | |
| | | void MA_SendCrossingStatus(const struct crossingStatusBrief *brief) |
| | |
| | | writer.Int(brief->status); |
| | | writer.EndObject(); |
| | | |
| | | SendMsgToMainProcIndep(ID_MS_CROSSING_BRIEF, sb.GetString()); |
| | | SendMsgToMainProcIndep(ID_SM_CROSSING_BRIEF, sb.GetString()); |
| | | } |
| | | |
| | | void MA_SendExamWrong(vector<ExamFault> &ExamFaultList) |
| | |
| | | } |
| | | break; |
| | | } |
| | | case ID_MS_INQ_ROAD_CROSSING: { |
| | | MasterInqRoadStatus(); |
| | | break; |
| | | } |
| | | default:break; |
| | | } |
| | | } |
| | |
| | | return CROSSING_NOT_HINT; |
| | | } |
| | | |
| | | static void ResetCrossingStatus(int roadIndex) |
| | | /***************************************************** |
| | | * 以正常通过路口或自由驾驶离开路段后 |
| | | * @param roadIndex |
| | | */ |
| | | static void ResetCrossingStatus(road_exam_map &RoadMap, int roadIndex) |
| | | { |
| | | while (true) { |
| | | bool w = false; |
| | | for (auto it = CrossingHint.begin(); it != CrossingHint.end(); ++it) { |
| | | if (it->first / 100 == roadIndex && it->second != CROSSING_NOT_HINT) { |
| | | ChangeCrossingStatus(it->first / 100, it->first % 100, CROSSING_NOT_HINT); |
| | | CrossingChange(RoadMap.roads[roadIndex].id, it->first % 100, 0); |
| | | w = true; |
| | | break; |
| | | } |
| | |
| | | DEBUG("道路ID切换 %d ======> %d", oldid, currExamMapIndex); |
| | | |
| | | if (oldid >= 0) { |
| | | ResetCrossingStatus(oldid); |
| | | ResetCrossingStatus(RoadMap, oldid); |
| | | ResetErrorLaneRpt(oldid); |
| | | |
| | | } |
| | | |
| | | if (RoadMap.calibrate) { |
| | |
| | | } |
| | | } |
| | | |
| | | /******************************************************************* |
| | | * 车辆越过停止线的方式通过路口 |
| | | * @param RoadMap |
| | | * @param road |
| | | * @param stop_line |
| | | * @param active |
| | | * @param car |
| | | */ |
| | | void CrossRoadCallback(road_exam_map &RoadMap, int road, int stop_line, int active, const car_model *car) |
| | | { |
| | | if (RoadMap.calibrate) { |