From 48509547a2ceda6f7f628efaafdd278f261a6607 Mon Sep 17 00:00:00 2001 From: kalman Date: Tue, 15 Jan 2019 21:20:23 +0800 Subject: [PATCH] fix(ros): fix imu count bug --- .../src/wrapper_nodelet.cc | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 869ef46..803c12f 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 @@ -72,14 +72,20 @@ class ROSWrapperNodelet : public nodelet::Nodelet { << (right_count_ / compute_time(time_end, right_time_beg_)); } if (imu_time_beg_ != -1) { - if (publish_imu_by_sync_) { - LOG(INFO) << "imu_sync_count: " << imu_sync_count_ << ", hz: " - << (imu_sync_count_ / - compute_time(time_end, imu_time_beg_)); - } else { - LOG(INFO) << "Imu count: " << imu_count_ << ", hz: " - << (imu_count_ / - compute_time(time_end, imu_time_beg_)); + if (model_ == Model::STANDARD) { + LOG(INFO) << "Imu count: " << imu_count_ << ", hz: " + << (imu_count_ / + compute_time(time_end, imu_time_beg_)); + } else { + if (publish_imu_by_sync_) { + LOG(INFO) << "imu_sync_count: " << imu_sync_count_ << ", hz: " + << (imu_sync_count_ / + compute_time(time_end, imu_time_beg_)); + } else { + LOG(INFO) << "Imu count: " << imu_count_ << ", hz: " + << (imu_count_ / + compute_time(time_end, imu_time_beg_)); + } } }