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,6 +119,7 @@ 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 (channels_ && !channels_->IsImuProtocol2()) {
if (proc_assembly && proc_temp_drift) { if (proc_assembly && proc_temp_drift) {
ProcImuTempDrift(imu); ProcImuTempDrift(imu);
ProcImuAssembly(imu); ProcImuAssembly(imu);
@ -127,6 +128,7 @@ void Motions::SetMotionCallback(motion_callback_t callback) {
} else if (proc_temp_drift) { } else if (proc_temp_drift) {
ProcImuTempDrift(imu); ProcImuTempDrift(imu);
} }
}
std::lock_guard<std::mutex> _(mtx_datas_); std::lock_guard<std::mutex> _(mtx_datas_);
motion_data_t data = {imu}; motion_data_t data = {imu};