diff --git a/src/mynteye/device/channel/def.h b/src/mynteye/device/channel/def.h index a903854..ec8b2b9 100644 --- a/src/mynteye/device/channel/def.h +++ b/src/mynteye/device/channel/def.h @@ -72,6 +72,8 @@ struct ImuSegment { std::uint32_t frame_id; std::uint64_t timestamp; std::uint8_t flag; + // Is external time source + bool is_ets; std::int16_t temperature; std::int16_t accel[3]; std::int16_t gyro[3]; diff --git a/src/mynteye/device/standard2/channels_adapter_s2.cc b/src/mynteye/device/standard2/channels_adapter_s2.cc index 13efb89..0c0157b 100644 --- a/src/mynteye/device/standard2/channels_adapter_s2.cc +++ b/src/mynteye/device/standard2/channels_adapter_s2.cc @@ -55,7 +55,8 @@ struct ImuData { void unpack_imu_segment(const ImuData &imu, ImuSegment *seg) { seg->frame_id = imu.frame_id; seg->timestamp = imu.timestamp; - seg->flag = imu.flag; + seg->flag = imu.flag & 0b0011; + seg->is_ets = (imu.flag & 0b0100 == 0b0100); seg->temperature = imu.temperature; seg->accel[0] = (seg->flag == 1) ? imu.accel_or_gyro[0] : 0; seg->accel[1] = (seg->flag == 1) ? imu.accel_or_gyro[1] : 0;