Skip to content

Commit cc19eb2

Browse files
committed
changing pseudo inverse fallback method
1 parent 977923f commit cc19eb2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

source/isaaclab/docs/CHANGELOG.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Changed
88
^^^^^^^
99

1010
* Changed Pink IK controller qpsolver from osqp to daqp.
11-
* Changed Null Space matrix computation in Pink IK's Null Space Posture Task to a faster matrix pseudo inverse
12-
computation.
11+
* Changed Null Space matrix computation in Pink IK's Null Space Posture Task to a faster matrix pseudo inverse computation.
1312

1413

1514
0.47.6 (2025-11-01)

source/isaaclab/isaaclab/controllers/pink_ik/null_space_posture_task.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ def compute_jacobian(self, configuration: Configuration) -> np.ndarray:
257257
L, info = lapack.dpotrf(JJT, lower=1, clean=False, overwrite_a=True)
258258

259259
if info != 0:
260-
# Fallback if not positive definite
261-
return np.eye(n)
260+
# Fallback if not positive definite: use numpy's pseudoinverse
261+
J_pinv = np.linalg.pinv(J_combined)
262+
return np.eye(n) - J_pinv @ J_combined
262263

263264
# Solve (J @ J^T + λ²I) @ X = J using LAPACK's triangular solver (dpotrs)
264265
# This directly solves the system without computing the full inverse

0 commit comments

Comments
 (0)