mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-10 05:28:07 -05:00
Fix covariance dimension (#998)
This commit is contained in:
@@ -96,10 +96,10 @@ def calc_covariance(x_est, px, pw):
|
||||
calculate covariance matrix
|
||||
see ipynb doc
|
||||
"""
|
||||
cov = np.zeros((3, 3))
|
||||
cov = np.zeros((4, 4))
|
||||
n_particle = px.shape[1]
|
||||
for i in range(n_particle):
|
||||
dx = (px[:, i:i + 1] - x_est)[0:3]
|
||||
dx = (px[:, i:i + 1] - x_est)
|
||||
cov += pw[0, i] * dx @ dx.T
|
||||
cov *= 1.0 / (1.0 - pw @ pw.T)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user