Skip to content

Commit

Permalink
Covs calculates sigma points correctly and uses the right ones
Browse files Browse the repository at this point in the history
  • Loading branch information
wkearn committed Nov 11, 2014
1 parent 3ed936b commit c5f93b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/augmented.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ end

function covs(kf::AugmentedUnscentedKalmanFilter,y::Observation)
(x,p) = augment(kf.x,kf.z.r)
σn = sigma(x,p,kf.x.α,kf.x.κ)
(σn,wm,wc) = sigma(x,p,kf.x.α,kf.x.β,kf.x.κ)
yp = map(kf.z.h,σn)

yhat = dot(kf.x.wm,yp)
yhat = dot(wm,yp)

resx = map(x->x-kf.x.x,σn)
resy = map(y->y-yhat,yp)

res = y.y-yhat
ph = dot(kf.x.wc,map((x,z)->x*z',resx,resy))
s = dot(kf.x.wc,map(x->x*x',resy))
ph = dot(wc,map((x,z)->x*z',resx,resy))
s = dot(wc,map(x->x*x',resy))

return res,ph,s
end
Expand Down

0 comments on commit c5f93b0

Please sign in to comment.