diff --git a/include/create/create.h b/include/create/create.h index 6ca2fe9..deaa4ba 100644 --- a/include/create/create.h +++ b/include/create/create.h @@ -80,7 +80,7 @@ namespace create { float totalLeftDist; float totalRightDist; bool firstOnData; - std::chrono::time_point prevOnDataTime; + std::chrono::time_point prevOnDataTime; Matrix poseCovar; diff --git a/src/create.cpp b/src/create.cpp index 75bfe9a..e8e359e 100644 --- a/src/create.cpp +++ b/src/create.cpp @@ -93,12 +93,12 @@ namespace create { prevTicksLeft = GET_DATA(ID_LEFT_ENC); prevTicksRight = GET_DATA(ID_RIGHT_ENC); } - prevOnDataTime = std::chrono::system_clock::now(); + prevOnDataTime = std::chrono::steady_clock::now(); firstOnData = false; } // Get current time - auto curTime = std::chrono::system_clock::now(); + auto curTime = std::chrono::steady_clock::now(); float dt = static_cast>(curTime - prevOnDataTime).count(); float deltaDist, deltaX, deltaY, deltaYaw, leftWheelDist, rightWheelDist, wheelDistDiff;