rpng / open_vins

An open source platform for visual-inertial navigation research.
https://docs.openvins.com
GNU General Public License v3.0
2.06k stars 615 forks source link

Why add cache_t_off in fast_state_propagate? #380

Closed WZG3661 closed 9 months ago

WZG3661 commented 9 months ago

On the line 154 of Propagator.cpp, the timestamp is originally in IMU clock, why add cache_t_off?

  double time0 = cache_state_time + cache_t_off;
  double time1 = timestamp + cache_t_off;
goldbattle commented 9 months ago

The timestamp of the state, e.g. state->_timestamp, is actually the camera time (see the bottom of the propagate_and_clone() function). Thus we need to take into account the time offset the first time the fast propagate function is called. After the first time the fast propagation is called, the cache_state_time will be in the IMU clock frame, so the cache_t_off will be zero (see bottom of fast_state_propagate() function).