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 internal error when both reset and prop_cov are set to False in IMUPreintegrator #281

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

Conversation

luyr
Copy link

@luyr luyr commented Sep 20, 2023

When initializing IMUPreintegrator, if we set both parameter prop_cov and reset to False, then an internal error UnboundLocalError: local variable 'Rij' referenced before assignment will occur when doing preintegration.
I add a parameter check in the initialization of IMUPreintegrator, to avoid this internal error.

@@ -98,12 +98,14 @@ def __init__(self, pos = torch.zeros(3),
reset = False):
super().__init__()
self.reset, self.prop_cov = reset, prop_cov
if not self.reset and not self.prop_cov:
raise RuntimeError('In IMUPreintegrator, prop_cov must be set to True if reset = False.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haleqiu Can you confirm this msg of runtime error is correct?

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.

None yet

2 participants