From 13833ce2b0f852ca476c6bb21e8bab21e428c7ac Mon Sep 17 00:00:00 2001 From: kalman Date: Mon, 14 Jan 2019 18:55:53 +0800 Subject: [PATCH] fix(dataset): fix record bug --- tools/dataset/dataset.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/dataset/dataset.cc b/tools/dataset/dataset.cc index 7d2065d..eab794f 100644 --- a/tools/dataset/dataset.cc +++ b/tools/dataset/dataset.cc @@ -95,15 +95,13 @@ void Dataset::SaveMotionData(const device::MotionData &data) { auto &&writer = GetMotionWriter(); // auto seq = data.imu->serial_number; auto seq = motion_count_; - if (data.imu->flag == 1 || data.imu->flag == 2) { - writer->ofs << seq << ", " << static_cast(data.imu->flag) << ", " - << data.imu->timestamp << ", " << data.imu->accel[0] << ", " - << data.imu->accel[1] << ", " << data.imu->accel[2] << ", " - << data.imu->gyro[0] << ", " << data.imu->gyro[1] << ", " - << data.imu->gyro[2] << ", " << data.imu->temperature - << std::endl; - ++motion_count_; - } + writer->ofs << seq << ", " << static_cast(data.imu->flag) << ", " + << data.imu->timestamp << ", " << data.imu->accel[0] << ", " + << data.imu->accel[1] << ", " << data.imu->accel[2] << ", " + << data.imu->gyro[0] << ", " << data.imu->gyro[1] << ", " + << data.imu->gyro[2] << ", " << data.imu->temperature + << std::endl; + ++motion_count_; /* if(motion_count_ != seq) { LOG(INFO) << "motion_count_ != seq !" << " motion_count_: " << motion_count_