Skip to content

Commit 05d400e

Browse files
committed
Decrease tolerance for the nonlinear least squares solver
1 parent ef3bf7c commit 05d400e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/demo_planar_hsa_motor2ee_jacobian.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@
2929
phi_max = params["phi_max"].flatten()
3030

3131
# define initial configuration
32-
q0 = jnp.array([jnp.pi, 0.0, 0.0])
32+
q0 = jnp.array([0.0, 0.0, 0.0])
3333

3434
# increase damping for simulation stability
3535
params["zetab"] = 5 * params["zetab"]
3636
params["zetash"] = 5 * params["zetash"]
3737
params["zetaa"] = 5 * params["zetaa"]
3838

39+
# nonlinear least squares solver settings
40+
nlq_tol = 1e-5 # tolerance for the nonlinear least squares solver
3941

4042
(
4143
forward_kinematics_virtual_backbone_fn,
@@ -65,7 +67,7 @@ def residual_fn(_q: Array) -> Array:
6567
return res
6668

6769
# solve the nonlinear least squares problem
68-
lm = LevenbergMarquardt(residual_fun=residual_fn, jit=True, verbose=True)
70+
lm = LevenbergMarquardt(residual_fun=residual_fn, tol=nlq_tol, jit=True, unroll=True, verbose=True)
6971
sol = lm.run(q0)
7072

7173
# configuration that minimizes the residual

0 commit comments

Comments
 (0)