| | |
| | | |
| | | #define DEBUG(fmt, args...) LOGD("<road_exam car_start> <%s>: " fmt, __func__, ##args) |
| | | |
| | | static const int MAX_ENGINE_RPM = 2500; |
| | | static const double START_CAR_MOVE_DISTANCE = 10.0; |
| | | static const double START_CAR_CHECK_DOOR_DISTANCE = 1.0; |
| | | |
| | | static double startCarMoveDistance; |
| | | static bool checkEngineRPM, checkStartCarSignal, checkDoor, handBreakActive; |
| | | |
| | |
| | | checkStartCarSignal = false; |
| | | checkDoor = false; |
| | | handBreakActive = false; |
| | | PlayTTS("请起步", cb); |
| | | PlayTTS(examParam.start_car_begin_tts, cb); |
| | | |
| | | DEBUG("车辆起步"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (moveDistance > START_CAR_MOVE_DISTANCE) { |
| | | if (moveDistance > examParam.start_car_limit_distance) { |
| | | sensor = ReadCarSensorValue(HAND_BREAK); |
| | | |
| | | if (sensor.name == HAND_BREAK && sensor.value == BREAK_ACTIVE) { |
| | |
| | | AddExamFault(26, rtkTime); |
| | | } |
| | | |
| | | PlayTTS("完成起步", NULL); |
| | | PlayTTS(examParam.start_car_end_tts, NULL); |
| | | DEBUG("############# 完成起步 ############"); |
| | | |
| | | return false; |
| | | } else if (moveDistance >= START_CAR_CHECK_DOOR_DISTANCE) { |
| | | } else if (moveDistance >= examParam.open_door_drive_allow_distance) { |
| | | if (!checkDoor) { |
| | | checkDoor = true; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (ReadCarStatus(ENGINE_RPM) > MAX_ENGINE_RPM && !checkEngineRPM) { |
| | | if (ReadCarStatus(ENGINE_RPM) > examParam.start_car_max_rpm && !checkEngineRPM) { |
| | | // 转速超标,不合格 |
| | | DEBUG("转速超标"); |
| | | AddExamFault(29, rtkTime); |