-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
rosplane/src/estimator_example.cpp
Outdated
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this 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
There was a problem hiding this 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
I added some cleaning to the code and reinstated the low pass filters for the gyro, as well. |
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.