Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Prevent NaN or zero dt in IMU propagation #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BenderBot-es
Copy link

@BenderBot-es BenderBot-es commented Feb 13, 2025

Issue

During the execution of the code, I observed that due to possible desynchronizations, sensor instabilities, or very fast IMU readings, the time interval dt between IMU measurements could sometimes become very close to zero or exactly zero.

This issue destabilizes the system and propagates NaN values through all IMU state calculations, leading to incorrect state estimations, from which it never recovers.

Observed Behavior

I identified this phenomenon while using FAST-LIVO2 with a rotating LiDAR and no camera, specifically when the LiDAR was close to obstacles and the resulting point cloud was small. In these scenarios, the system exhibited inconsistencies, and NaN values started propagating within the IMU state.

Solution

Added the following safeguard to skip IMU propagation steps where dt is NaN or too small:

if (dt != dt || dt == 0.0)
{
    std::cerr << "ERROR: dt is NaN or zero in IMU Propagation" << std::endl;
    continue;
}

I am aware that simply skipping the iteration with continue may not be the best solution. There might be a better way to handle this issue instead of ignoring the propagation step. If anyone has suggestions for a better approach, I’d appreciate any feedback or insights on how to handle this more effectively.

@BenderBot-es BenderBot-es changed the title Prevent NaN or zero dt in IMU propagation Fix: Prevent NaN or zero dt in IMU propagation Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant