Replies: 2 comments 4 replies
-
The 2022 pose estimator used the following model with a UKF: $$ where the input came from swerve drive velocity kinematics. We noticed that the UKF had occasional stability issues (usually when the reconstructed error covariance matrix had poor condition number) and the measurement replay during vision updates was very slow. A UKF does the same prediction and correction with multiple sigma points to approximate the true nonlinear probability distribution, so the filter effectively gets run 2k+1 times per timestep where k is the number of states; it's like a particle filter but more intelligent with how it selects the samples. Since the dynamics and measurement model were both linear, the UKF behavior was equivalent to just using a linear Kalman filter. Furthermore, since the model actually had no dynamics (the input and pose measurements drove the model directly), we could simplify further to just a weighted average between the SwerveDriveOdometry pose estimate and the vision pose estimate. We still use an optimal steady-state Kalman gain, but given the simple model we have, the continuous algebraic Riccati equation simplifies to this: https://github.com/wpilibsuite/allwpilib/blob/main/wpimath/algorithms.md#closed-form-kalman-gain-for-continuous-kalman-filter-with-a--0-and-c--i I agree that it's kind of disappointing, but the fancy UKF we used really just simplifies to this. Our original model was a gross simplification of the true nonlinear state estimation problem (for one thing, the pose measurement distributions aren't Gaussian). Given that we have SE(3) poses coming in at different timestamps, I've been told would be more accurate to model it with factor graphs. We've attempted to model swerve dynamics before, but it ended up not being accurate: #3374. The prediction method we're using now is essentially swerve drive position delta kinematics |
Beta Was this translation helpful? Give feedback.
-
ok, thanks, makes sense. i think our situation is a little bit unusual because we drive our "practice" swerve drivetrains very fast on very hard wheels so the odometry is not very accurate at all, whereas our camera system is very accurate. i think (perhaps because of the wheel situation) we also have not paid very much attention to sensor accuracy, so to us odometry seems like (and is) a source of noise instead of a source of certainty. in fact, i have in mind to do an off-season controls project that purposely saturates the wheels, kinda like the stanford drifting delorean, since we're almost there anyway... :-) . anyway thanks again. |
Beta Was this translation helpful? Give feedback.
-
Hi, I guess this is mostly a question for @calcmogul. Team 100 is using the SwerveDrivePoseEstimator, and kinda wishing that the embodied linear system had an "A" term. I dimly recall that the version of SDPE from 2022 used an EKF that did have "A", but the EKF was removed in December. Am I remembering correctly? The commit message from that time said that the reason to change was simplicity, but I'm wondering if there were any other reasons, like this would be a bad path for me to direct my control engineering students down. They're quite interested in state space controls, and also in very precise swerve driving, so maybe it would be a good way to get started? What do you think?
Beta Was this translation helpful? Give feedback.
All reactions