UZ-SLAMLab / ORB_SLAM3

ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM
GNU General Public License v3.0
6.55k stars 2.55k forks source link

The code discards the last imu measurement between 2 frames #482

Closed gsanya closed 2 years ago

gsanya commented 2 years ago

If I understand correctly, this line will mean, that n is the maximum index of imu measurements: https://github.com/UZ-SLAMLab/ORB_SLAM3/blob/851db08347849a94c51d3ebc3a36df8a114b800f/src/Tracking.cc#L1677 But than the code should either iterate till i<n+1 or i<=n and not like: https://github.com/UZ-SLAMLab/ORB_SLAM3/blob/851db08347849a94c51d3ebc3a36df8a114b800f/src/Tracking.cc#L1685 This causes the code to disregard the last imu measurement in the mvImuFromLastFrame vector.

An easy fix in my opinion is changing line 1677 to const int n = mvImuFromLastFrame.size(); I tested this on the EUROC dataset, and it works. No big improvement noticed in the tracking performance, but I haven't checked it quantitatively.

gsanya commented 2 years ago

Sorry! I've spoken too soon,, my mistake. The original code is perfect, I just didn't understand it.