From 03d6043c08364998137f4fd3b31e0c42c13faa94 Mon Sep 17 00:00:00 2001 From: John Zhao Date: Mon, 16 Apr 2018 17:18:27 +0800 Subject: [PATCH] Sleep 1 ms when publish imu in ros --- wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc | 2 ++ 1 file changed, 2 insertions(+) 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 de3160b..8d725d4 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 @@ -252,6 +252,8 @@ class ROSWrapperNodelet : public nodelet::Nodelet { << ", gyro_y: " << data.imu->gyro[1] << ", gyro_z: " << data.imu->gyro[2] << ", temperature: " << data.imu->temperature); + // Sleep 1ms, otherwise publish may drop some datas. + ros::Duration(0.001).sleep(); }); time_beg_ = ros::Time::now().toSec();