Skip to content

Commit

Permalink
fix(ros): fix imu publish bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kalman committed Apr 1, 2019
1 parent bdfe88e commit 06e8e28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,10 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
if (data.imu) {
if (data.imu->flag == 1) { // accelerometer
imu_accel_ = data.imu;
publishImuBySync(stamp);
publishImuBySync();
} else if (data.imu->flag == 2) { // gyroscope
imu_gyro_ = data.imu;
publishImuBySync(stamp);
publishImuBySync();
} else {
publishImu(data, imu_count_, stamp);
publishTemperature(data.imu->temperature, imu_count_, stamp);
Expand Down Expand Up @@ -980,14 +980,14 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
}
}

void publishImuBySync(ros::Time stamp) {
void publishImuBySync() {
timestampAlign();

if (imu_accel_ == nullptr || imu_gyro_ == nullptr) {
return;
}
sensor_msgs::Imu msg;

ros::Time stamp = checkUpImuTimeStamp(imu_accel_->timestamp);
msg.header.seq = imu_sync_count_;
msg.header.stamp = stamp;
msg.header.frame_id = imu_frame_id_;
Expand Down

0 comments on commit 06e8e28

Please sign in to comment.