From bf8e1f4ef4961b32dfa73a0b898f82c20721bf09 Mon Sep 17 00:00:00 2001 From: fctom1215 <fctom1215@outlook.com> Date: 星期五, 28 八月 2020 08:56:23 +0800 Subject: [PATCH] 坐标 --- lib/src/main/cpp/driver_test.cpp | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/lib/src/main/cpp/driver_test.cpp b/lib/src/main/cpp/driver_test.cpp index 0b16c3e..08fbfbd 100644 --- a/lib/src/main/cpp/driver_test.cpp +++ b/lib/src/main/cpp/driver_test.cpp @@ -96,6 +96,7 @@ static void UpdateCarBodyCoord(struct RtkTime *rtkTime, double azimuth, double pitch, double roll, PointF main_ant, car_model *carModel); static bool UpdateCarCoord(double &spd, int &mov, int &idx); +static void PrintObdInfo(struct RtkTime *rtkTime, double speed); void DriverTestInit(void) { @@ -500,6 +501,22 @@ if (ExamStart) { ExecuteExam(speed, move, azimuth, &rtkTime); } + + PrintObdInfo(&rtkTime, speed); + } +} + + + +static void PrintObdInfo(struct RtkTime *rtkTime, double speed) { + static struct RtkTime cTime = *rtkTime; + + if (TimeGetDiff(rtkTime, &cTime) >= D_SEC(3)) { + cTime = *rtkTime; + DEBUG("ENGINE_RPM %d OBD_SPEED %f SPEED %f", + ReadCarStatus(ENGINE_RPM), + ((double)ReadCarStatus(OBD_SPEED)) / 10.0, + speed * 3.6); } } -- Gitblit v1.8.0