Skip to content

Commit e880b0e

Browse files
committed
Fix parameter of jacobian in EKF-SLAM
1 parent 4093b64 commit e880b0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

SLAM/EKFSLAM/ekf_slam.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@
305305
" :returns: predicted state vector, predicted covariance, jacobian of control vector, transition fx\n",
306306
" \"\"\"\n",
307307
" S = STATE_SIZE\n",
308-
" xEst[0:S] = motion_model(xEst[0:S], u)\n",
309308
" G, Fx = jacob_motion(xEst[0:S], u)\n",
309+
" xEst[0:S] = motion_model(xEst[0:S], u)\n",
310310
" # Fx is an an identity matrix of size (STATE_SIZE)\n",
311311
" # sigma = G*sigma*G.T + Noise\n",
312312
" PEst[0:S, 0:S] = G.T @ PEst[0:S, 0:S] @ G + Fx.T @ Cx @ Fx\n",

SLAM/EKFSLAM/ekf_slam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
def ekf_slam(xEst, PEst, u, z):
3030
# Predict
3131
S = STATE_SIZE
32-
xEst[0:S] = motion_model(xEst[0:S], u)
3332
G, Fx = jacob_motion(xEst[0:S], u)
33+
xEst[0:S] = motion_model(xEst[0:S], u)
3434
PEst[0:S, 0:S] = G.T @ PEst[0:S, 0:S] @ G + Fx.T @ Cx @ Fx
3535
initP = np.eye(2)
3636

0 commit comments

Comments
 (0)