-
Notifications
You must be signed in to change notification settings - Fork 665
Fix ResetTranslation and ResetRotation in PoseEstimator and PoseEstimator3d causing the robot to teleport
#8285
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
base: main
Are you sure you want to change the base?
Conversation
|
Why go with this route instead of calling |
|
I did consider just calling As this PR is written now, it remains possible to pull out both the |
Whoops, my bad! I saw that note earlier but then completely forgot when revisiting this PR.
Good point- That was something I had noted to myself when doing the At the same time, I don't like the asymmetry this introduces between To be honest, if the implementation complexity was not a concern, I do favor the "separately reset the odometry and pose estimator rotation" semantics- I'm just having trouble justifying the additional implementation complexity for a semantic difference that isn't even exposed to users. (Also, adding complexity for the sake of purity feels shaky- I'm not saying you're making that argument, it was just another potential reason I thought of while writing this.) Maybe we use |
I had a similar thought at first, but if by asymmetry you mean how the former now keep a
For what it's worth, we have been considering exposing odometry without vision compensation to our swerve users, and this PR contains the changes we were planning on rolling into our fork so we still have that option. With that said, it's understandable that WPILib may prefer to roll with the simpler change of directly calling |
I was thinking more on the semantics side- The former now have a difference between odometry and vision while the latter wouldn't (which amounts to effectively the same thing as whether they keep a After properly sitting down and looking in detail at the current
Some final thoughts:
|
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.
Tests also need to be added.
|
For the tests, do we want an entirely new |
7753199 to
8f57b2a
Compare
Fixes #8284.
If we have vision updates at the time of the
Reset*call, we can correct the translation/rotation of the new odometry pose by adding a new vision update where:ResetTranslation: the translation is hard-coded to the new translation, and the rotation components are set to those of the latest vision update (prior to clearing the map).ResetRotation: the rotation is hard-coded to the new rotation, and the translation components are set to those of the latest vision update (prior to clearing the map).