From 8331b8415dcad7a40c98123fd1f9d01e82f4ac7d Mon Sep 17 00:00:00 2001 From: Kalman Date: Thu, 8 Nov 2018 15:31:15 +0800 Subject: [PATCH] Fix push motion datas in callback --- src/internal/motions.cc | 4 +++- src/uvc/uvc-v4l2.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal/motions.cc b/src/internal/motions.cc index 3b49c6c..349a5ea 100644 --- a/src/internal/motions.cc +++ b/src/internal/motions.cc @@ -74,7 +74,9 @@ void Motions::SetMotionCallback(motion_callback_t callback) { std::lock_guard _(mtx_datas_); motion_data_t data = {imu}; - motion_datas_.push_back(data); + if (motion_datas_enabled_) { + motion_datas_.push_back(data); + } motion_callback_(data); } diff --git a/src/uvc/uvc-v4l2.cc b/src/uvc/uvc-v4l2.cc index afbc7ed..f86a209 100755 --- a/src/uvc/uvc-v4l2.cc +++ b/src/uvc/uvc-v4l2.cc @@ -394,7 +394,7 @@ struct device { living_count++; } else { living_count = 0; - LOG(INFO) << "UVC pulse detection,Please ignore."; + // LOG(INFO) << "UVC pulse detection,Please ignore."; } }