Do not update qacc_warmstart at the end of the solver call; instead, update it at the same time as all other state variables. This change makes mj_forward idempotent.
PiperOrigin-RevId: 797826112 Change-Id: Ibc51624adc3ec42c265958bf77696b33231431c1
This commit is contained in:
committed by
Copybara-Service
parent
2f28473bc1
commit
3dec35a91e
@@ -334,6 +334,9 @@ def _advance(
|
||||
# advance time
|
||||
time = d.time + m.opt.timestep
|
||||
|
||||
# save qacc for next step warmstart
|
||||
d = d.replace(qacc_warmstart=d.qacc)
|
||||
|
||||
return d.replace(act=act, qpos=qpos, time=time)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user