diff --git a/src/processor/processor_imu.cpp b/src/processor/processor_imu.cpp index 56d47d96e6e23737c76066f795f9aa9c591686cd..0e4257e65940cbdd753423fe9941b57150fe3c69 100644 --- a/src/processor/processor_imu.cpp +++ b/src/processor/processor_imu.cpp @@ -49,14 +49,13 @@ void ProcessorImu::preProcess() bool ProcessorImu::voteForKeyFrame() const { // time span - if (getBuffer().back().ts_ - getBuffer().front().ts_ > params_motion_Imu_->max_time_span) + if (getBuffer().back().ts_ - getBuffer().front().ts_ > params_motion_Imu_->max_time_span - params_motion_Imu_->time_tolerance) { WOLF_DEBUG( "PM: vote: time span" ); return true; } // buffer length - WOLF_INFO("buff size: ", getBuffer().size(), " max: ", params_motion_Imu_->max_buff_length); - if (getBuffer().size() > params_motion_Imu_->max_buff_length) + if (getBuffer().size() -1 > params_motion_Imu_->max_buff_length) { WOLF_DEBUG( "PM: vote: buffer length" ); return true;