|
445 | 445 | "Correct the covariance estimate at arrival using `covestim` [`StateEstimator`](@ref)."
|
446 | 446 | function correct_cov!(estim::MovingHorizonEstimator)
|
447 | 447 | nym, nd = estim.nym, estim.model.nd
|
448 |
| - y0marr, d0arr = @views estim.Y0m[1:nym], estim.D0[1:nd] |
| 448 | + buffer = estim.covestim.buffer |
| 449 | + y0marr, d0arr = buffer.ym, buffer.d |
| 450 | + y0marr .= @views estim.Y0m[1:nym] |
| 451 | + d0arr .= @views estim.D0[1:nd] |
449 | 452 | estim.covestim.x̂0 .= estim.x̂0arr_old
|
450 | 453 | estim.covestim.P̂ .= estim.P̂arr_old
|
451 | 454 | try
|
|
468 | 471 | "Update the covariance estimate at arrival using `covestim` [`StateEstimator`](@ref)."
|
469 | 472 | function update_cov!(estim::MovingHorizonEstimator)
|
470 | 473 | nu, nd, nym = estim.model.nu, estim.model.nd, estim.nym
|
471 |
| - u0arr, y0marr, d0arr = @views estim.U0[1:nu], estim.Y0m[1:nym], estim.D0[1:nd] |
| 474 | + buffer = estim.covestim.buffer |
| 475 | + u0arr, y0marr, d0arr = buffer.u, buffer.ym, buffer.d |
| 476 | + u0arr .= @views estim.U0[1:nu] |
| 477 | + y0marr .= @views estim.Y0m[1:nym] |
| 478 | + d0arr .= @views estim.D0[1:nd] |
472 | 479 | estim.covestim.x̂0 .= estim.x̂0arr_old
|
473 | 480 | estim.covestim.P̂ .= estim.P̂arr_old
|
474 | 481 | try
|
|
0 commit comments