From 5313b70ece46af3935ba3a9e5b26c0f76f32dd47 Mon Sep 17 00:00:00 2001 From: TinyO Date: Tue, 31 Dec 2019 10:27:43 +0800 Subject: [PATCH] fix(*): imu process logic fix. --- src/mynteye/device/motions.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/mynteye/device/motions.cc b/src/mynteye/device/motions.cc index c80f5a1..4ee4140 100644 --- a/src/mynteye/device/motions.cc +++ b/src/mynteye/device/motions.cc @@ -119,13 +119,15 @@ void Motions::SetMotionCallback(motion_callback_t callback) { bool proc_assembly =((proc_mode_ & ProcessMode::PROC_IMU_ASSEMBLY) > 0); bool proc_temp_drift = ((proc_mode_ & ProcessMode::PROC_IMU_TEMP_DRIFT) > 0); - if (proc_assembly && proc_temp_drift) { - ProcImuTempDrift(imu); - ProcImuAssembly(imu); - } else if (proc_assembly) { - ProcImuAssembly(imu); - } else if (proc_temp_drift) { - ProcImuTempDrift(imu); + if (channels_ && !channels_->IsImuProtocol2()) { + if (proc_assembly && proc_temp_drift) { + ProcImuTempDrift(imu); + ProcImuAssembly(imu); + } else if (proc_assembly) { + ProcImuAssembly(imu); + } else if (proc_temp_drift) { + ProcImuTempDrift(imu); + } } std::lock_guard _(mtx_datas_);