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

Fixed wrapping issue. #5

Merged
merged 6 commits into from
Jan 16, 2024
Merged

Fixed wrapping issue. #5

merged 6 commits into from
Jan 16, 2024

Conversation

iandareid
Copy link
Collaborator

This fixes the wrapping issues we have seen in the estimator that cause it to stall indefinitely. We replaced the while loops used to calculate the wrapping to a single execution that calculates the number of wraps required and then applies them. This prevents the stalling.

@iandareid iandareid self-assigned this Nov 15, 2023
@iandareid iandareid added the bug Something isn't working label Nov 15, 2023
while(xhat_p_(3) < radians(-180.0f)) xhat_p_(3) = xhat_p_(3) + radians(360.0f);

xhat_p_(3) = wrap(0.0, xhat_p_(3));
// while(xhat_p_(3) > radians(180.0f)) xhat_p_(3) = xhat_p_(3) - radians(360.0f);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove these commented out lines, since we won't be needing them anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Of course, I didn't realize they weren't deleted!

Copy link
Collaborator

@bsutherland333 bsutherland333 left a comment

Choose a reason for hiding this comment

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

Looks functionally good, I would just make things a bit cleaner and clearer

Copy link
Collaborator

@bsutherland333 bsutherland333 left a comment

Choose a reason for hiding this comment

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

You missed one spot with comments, but otherwise looks good

@iandareid
Copy link
Collaborator Author

I added some cleaning to the code and reinstated the low pass filters for the gyro, as well.

@iandareid iandareid merged commit 07cdd9b into main Jan 16, 2024
2 checks passed
@iandareid iandareid deleted the estimator_fixes branch January 16, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants