Skip to content
Snippets Groups Projects
Commit 279a5431 authored by Jérémy MACEIRAS's avatar Jérémy MACEIRAS
Browse files

fix: fix indexes in iLQRManipulator3d.py

parent d192f558
No related branches found
No related tags found
No related merge requests found
......@@ -206,14 +206,13 @@ for i in range(param.nbIter):
Ra = np.zeros_like(Qr)
for i in range(param.nbPoints):
Rtmp = q2R(param.Mu[-4:,i]) # Orientation matrix for target
for j in range(param.nbPoints):
Rkp = np.zeros((param.nbVarF-1,param.nbVarF-1)) # Transformation matrix with both translation and rotation
Rkp[:3,:3] = np.identity(3) # For translation
Rkp[-3:,-3:] = Rtmp # For rotation
Rkp[-3:,-3:] = q2R(param.Mu[-4:,j]) # Orientation matrix for target
nbVarQ = param.nbVarF - 1
Ra[i*nbVarQ:(i+1)*nbVarQ,i*nbVarQ:(i+1)*nbVarQ] = Rkp
Ra[j*nbVarQ:(j+1)*nbVarQ,j*nbVarQ:(j+1)*nbVarQ] = Rkp
Q = Ra @ Qr @ Ra.T # Precision matrix in absolute coordinate frame (base frame)
du = np.linalg.pinv(Su.T @ J.T @ Q @ J @ Su + R) @ (-Su.T @ J.T @ Q @ f - u * param.r) # Gauss-Newton update
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment