fix(*): imu process logic fix.

This commit is contained in:
TinyO 2019-12-31 10:27:43 +08:00
parent d937dc5690
commit 5313b70ece

View File

@ -119,13 +119,15 @@ void Motions::SetMotionCallback(motion_callback_t callback) {
bool proc_assembly =((proc_mode_ & ProcessMode::PROC_IMU_ASSEMBLY) > 0); bool proc_assembly =((proc_mode_ & ProcessMode::PROC_IMU_ASSEMBLY) > 0);
bool proc_temp_drift = bool proc_temp_drift =
((proc_mode_ & ProcessMode::PROC_IMU_TEMP_DRIFT) > 0); ((proc_mode_ & ProcessMode::PROC_IMU_TEMP_DRIFT) > 0);
if (proc_assembly && proc_temp_drift) { if (channels_ && !channels_->IsImuProtocol2()) {
ProcImuTempDrift(imu); if (proc_assembly && proc_temp_drift) {
ProcImuAssembly(imu); ProcImuTempDrift(imu);
} else if (proc_assembly) { ProcImuAssembly(imu);
ProcImuAssembly(imu); } else if (proc_assembly) {
} else if (proc_temp_drift) { ProcImuAssembly(imu);
ProcImuTempDrift(imu); } else if (proc_temp_drift) {
ProcImuTempDrift(imu);
}
} }
std::lock_guard<std::mutex> _(mtx_datas_); std::lock_guard<std::mutex> _(mtx_datas_);