Fix imu stamp bug in ros

This commit is contained in:
Kalman 2018-10-24 17:13:25 +08:00
parent a9353c965a
commit 5c46c72883
2 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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]