diff --git a/CMakeLists.txt b/CMakeLists.txt index c3c25a47751f03c062f58cf93ca38c0210d4e92c..53dc9b883599a657c3c971487ac298bbdf0b46cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") include(Findglog) -find_package( OpenCV REQUIRED ) +find_package( OpenCV REQUIRED COMPONENTS core imgproc highgui cudaimgproc calib3d imgcodecs videoio aruco cudaarithm cudastereo cudaoptflow face tracking quality) find_package( Threads REQUIRED ) find_package( URIParser REQUIRED ) find_package( MsgPack REQUIRED ) diff --git a/components/common/cpp/src/timer.cpp b/components/common/cpp/src/timer.cpp index 842a1e7eed0ede5334182f8c750418b253a54824..79fb8720bd43fb7bbd35f1fff3fa0f7a537d195e 100644 --- a/components/common/cpp/src/timer.cpp +++ b/components/common/cpp/src/timer.cpp @@ -92,9 +92,9 @@ static void waitTimePoint() { if (hprec_) { // Spin loop until exact grab time - //LOG(INFO) << "Spin Delay: " << (now / 40) << " = " << (40 - (now%40)); - + // Accurate to around 4 micro seconds. if (sincelast != mspf) { + // TODO: Try using sleep_for for msdelay-1 target = now / mspf; while ((now/mspf) == target) { _mm_pause(); // SSE2 nano pause intrinsic @@ -102,6 +102,7 @@ static void waitTimePoint() { }; } } else { + // Accurate to just under 1 millisecond usually if (sincelast != mspf) sleep_for(milliseconds(msdelay)); now = get_time(); }