fix(*): sample record lost motion.

This commit is contained in:
TinyO 2019-10-22 11:47:43 +08:00
parent 762841c73a
commit e1485e2103

View File

@ -131,7 +131,6 @@ void Dataset::SaveMotionData(const api::MotionData &data) {
auto &&writer = GetMotionWriter(); auto &&writer = GetMotionWriter();
// auto seq = data.imu->serial_number; // auto seq = data.imu->serial_number;
auto seq = motion_count_; auto seq = motion_count_;
if (data.imu->flag == 1 || data.imu->flag == 2) {
writer->ofs << seq << ", " << static_cast<int>(data.imu->flag) << ", " writer->ofs << seq << ", " << static_cast<int>(data.imu->flag) << ", "
<< data.imu->timestamp << ", " << data.imu->accel[0] << ", " << data.imu->timestamp << ", " << data.imu->accel[0] << ", "
<< data.imu->accel[1] << ", " << data.imu->accel[2] << ", " << data.imu->accel[1] << ", " << data.imu->accel[2] << ", "
@ -139,7 +138,7 @@ void Dataset::SaveMotionData(const api::MotionData &data) {
<< data.imu->gyro[2] << ", " << data.imu->temperature << data.imu->gyro[2] << ", " << data.imu->temperature
<< std::endl; << std::endl;
++motion_count_; ++motion_count_;
}
/* /*
if(motion_count_ != seq) { if(motion_count_ != seq) {
LOG(INFO) << "motion_count_ != seq !" << " motion_count_: " << motion_count_ LOG(INFO) << "motion_count_ != seq !" << " motion_count_: " << motion_count_