google-deepmind / mujoco_mpc

Real-time behaviour synthesis with MuJoCo, using Predictive Control
https://github.com/deepmind/mujoco_mpc
Apache License 2.0
1.04k stars 156 forks source link

a proposal on updating agent state info before mj_step in PhysicsLoop of app.cc #344

Open starimpact opened 1 month ago

starimpact commented 1 month ago

as following (line 359), what do you say about adding sim.agent->state.Set(m, d); before mj_step. my reason is that , controller need instant state info to control robot, instant time info is good for interpolating right control info, or it will be failed in some hard scenarios.

截屏2024-09-25 17 26 35

i am not sure about this suggestion, because the performance does not improve yet.

thowell commented 1 month ago

The state is set below in this line. The planner has access to the most up-to-date state. However, I am noticing that we might not be initializing the planner state from the model default state since this function does nothing.