A drop-in alternative to robot_ekf() that propagates the planar pose
with the unscented transform instead of Jacobians. The covariance lives
in the local tangent chart of the pose: the heading deviation is an
unwrapped angle, so a broad heading uncertainty is never folded back by
wrapping. ukf_predict() augments the state with the control noise,
draws \(2(3 + 2) + 1\) sigma points, moves each through
unicycle_step() with its noisy control and keeps its heading change
unwrapped. ukf_update() fuses range-bearing measurements of known
landmarks one at a time; predicted bearings are averaged as wrapped
differences from the bearing of the central sigma point, so signed
weights are handled exactly, and the state deviations used for the cross
covariance are the sigma deviations themselves, consistent with cov.
Usage
robot_ukf(mean, cov, landmarks, Q, R, alpha = 1, beta = 2, kappa = 0)
ukf_predict(filter, control, dt)
ukf_update(filter, measurements)Arguments
- mean
Initial pose estimate.
- cov
Initial 3 by 3 covariance.
- landmarks
Matrix of landmark positions with row names as ids.
- Q
Control noise covariance (2 by 2).
- R
Measurement noise covariance (2 by 2, positive definite).
- alpha, beta, kappa
Unscented transform parameters.
- filter
A
robot_ukf.- control
c(v, omega).- dt
Duration (s).
- measurements
A data frame as returned by
landmark_measurements().
Details
The default scaling alpha = 1, beta = 2, kappa = 0 makes every weight
nonnegative, which keeps every covariance positive semidefinite. Other
scalings (for example a small alpha) give a negative central weight; a
result that is then indefinite stops with an error instead of being
returned. alpha must be positive and kappa > -3, so that the
transform is defined for both the 3 dimensional state and the
5 dimensional augmented state.