Guard against NaNs in MJX solver when no cost is imposed. Fixes #1225.
PiperOrigin-RevId: 586020958 Change-Id: I82f398b1538d2c3801a35c80c862e49be3b110a2
This commit is contained in:
committed by
Copybara-Service
parent
e1669b568b
commit
2f37147fc0
@@ -128,7 +128,7 @@ class _LSPoint(PyTreeNode):
|
||||
|
||||
cost = alpha * alpha * quad_total[2] + alpha * quad_total[1] + quad_total[0]
|
||||
deriv_0 = 2 * alpha * quad_total[2] + quad_total[1]
|
||||
deriv_1 = 2 * quad_total[2]
|
||||
deriv_1 = 2 * quad_total[2] + (quad_total[2] == 0) * mujoco.mjMINVAL
|
||||
return _LSPoint(alpha=alpha, cost=cost, deriv_0=deriv_0, deriv_1=deriv_1)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user