From 41610fd7143c55c3feef85b1fdd416ef8a2e23d7 Mon Sep 17 00:00:00 2001 From: John Zhao Date: Wed, 7 Nov 2018 17:11:44 +0800 Subject: [PATCH] Fix push motion datas in callback --- src/mynteye/device/motions.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mynteye/device/motions.cc b/src/mynteye/device/motions.cc index cd1a8d4..7a2bcd4 100644 --- a/src/mynteye/device/motions.cc +++ b/src/mynteye/device/motions.cc @@ -36,7 +36,6 @@ void Motions::SetMotionCallback(motion_callback_t callback) { if (motion_callback_) { channels_->SetImuCallback([this](const ImuPacket &packet) { if (!motion_callback_ && !motion_datas_enabled_) { - LOG(WARNING) << ""; return; } for (auto &&seg : packet.segments) { @@ -57,7 +56,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); }