Stop VIO waiting on the LiDAR buffer in LIVO mode#455
Open
bing8deng wants to merge 1 commit into
Open
Conversation
sync_packages() rejects every call up front when lid_raw_data_buffer is empty, before the mode-specific switch below even runs. In LIVO mode the LIO and VIO steps alternate, and the VIO step never touches lid_raw_data_buffer at all - it only reads img_buffer and imu_buffer. Once LIO has drained the LiDAR queue, that lone precondition still forces VIO to stall until the next LiDAR scan lands, adding tens of milliseconds of pure gate wait before every VIO update with no benefit. Move the LiDAR-buffer check out of the shared preamble and into the two switch branches that actually consume the buffer: the ONLY_LIO case and the LIVO WAIT/VIO case that performs the LIO step. The LIVO case that performs the VIO step is left without the check, since it has no dependency on lid_raw_data_buffer. Measured on our platforms this removes on the order of 30 ms of gate wait per VIO update at 10 Hz LiDAR input, with the effect shrinking as LiDAR rate rises and the queue refills sooner. Signed-off-by: Deng, Bing <[email protected]>
Author
|
@xuankuzcr @XW-HKU Could you please review this patch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
sync_packages()rejects every call up front whenlid_raw_data_bufferis empty, before the mode-specific switchbelow even runs:
In LIVO mode the LIO and VIO steps alternate, and the VIO step
(the
case LIO:branch inside the inner switch) never toucheslid_raw_data_bufferat all — it only readsimg_bufferandimu_buffer. Once LIO has drained the LiDAR queue, this oneprecondition still forces VIO to stall until the next LiDAR scan
lands, adding pure gate-wait latency before every VIO update with
no benefit. The stall shrinks as LiDAR rate rises (queue refills
sooner) and grows if LiDAR/camera are hardware-synced at a low
rate, which rules out a "sync harder" fix.
Fix
Move the LiDAR-buffer check out of the shared preamble and into
the two switch branches that actually consume the buffer: the
ONLY_LIOcase and the LIVOWAIT/VIOcase that performs theLIO step. The LIVO case that performs the VIO step is left
without the check, since it has no dependency on
lid_raw_data_buffer.Impact
Measured on our platforms this removes on the order of tens of
milliseconds of gate wait per VIO update at 10 Hz LiDAR input.
No behavior change for
ONLY_LIO/ONLY_LOmodes or for the LIOhalf of LIVO mode.