From 5c46c7288368d551e2e2c7c6b47cf28caf6726d9 Mon Sep 17 00:00:00 2001 From: Kalman Date: Wed, 24 Oct 2018 17:13:25 +0800 Subject: [PATCH] Fix imu stamp bug in ros --- tools/dataset/record.cc | 3 +-- wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/dataset/record.cc b/tools/dataset/record.cc index 1f699b9..45df013 100644 --- a/tools/dataset/record.cc +++ b/tools/dataset/record.cc @@ -99,8 +99,7 @@ int main(int argc, char *argv[]) { return -1; } cv::imshow("frame", img); - - { // save + if (img_count > 10 && imu_count > 50) { // save for (auto &&left : left_datas) { dataset.SaveStreamData(Stream::LEFT, left); } diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc index 8b42ebc..80b941f 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc @@ -341,9 +341,10 @@ class ROSWrapperNodelet : public nodelet::Nodelet { } else { NODELET_WARN_STREAM("Motion data is empty"); } + } else { + publishImu(data, imu_count_, stamp); + publishTemp(data.imu->temperature, imu_count_, stamp); } - publishImu(data, imu_count_, stamp); - publishTemp(data.imu->temperature, imu_count_, stamp); NODELET_DEBUG_STREAM( "Imu count: " << imu_count_ << ", timestamp: " << data.imu->timestamp << ", accel_x: " << data.imu->accel[0]