Description
Initially reported by FRC team 2363:
Step 9 of PoseEstimator.addVisionMeasurement()
sets the PoseEstimator pose estimate to a vision-compensated version of the latest odometry object pose, but the odometry object's pose is only updated by twists passed to PoseEstimator.updateWithTime()
. This means the odometry pose is still allowed to drift over time instead of being gradually fixed by vision measurements. In other words, the odometry is only ever getting fixed by one vision measurement instead of a backlog of all of them.
The old implementation applied vision updates to old pose estimates, then replayed odometry updates up to the current time. That was too expensive at the time, so idk if we can fix this properly.
The odometry object pose not being vision-compensated also causes PoseEstimator.resetRotation()
to make the translation estimate teleport from the vision-compensated version to the odometry-only version.