google-deepmind / mujoco_mpc

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

QAcc Divergence when importing Cassie model to mjpc #206

Closed manuaatitya closed 8 months ago

manuaatitya commented 10 months ago

Hi, I'm trying to import the Cassie Model, folder link, (the model is same as from cassie-mujoco-sim just with the sensor tags rearranged for the purpose of residuals).

One of the main issues is I get the divergence of QAcc in some of the joints.

rollout-divergence-error

The same model works well with just mujoco and I couldn't reason out as to why this is happening in mjpc.

Tried a bunch of things like changing the integrator and adding damping to the joints but doesn't seem to solve the issue. (The Cassie.cc file doesn't do much, just trying to import Cassie into this framework but haven't been successful) Any help to solve this would be appreciated !!!

Thanks in advance!

yuvaltassa commented 10 months ago

The Cassie model is not super stable IIRC.

My main guess (haven't looked at your file) is that your MJPC task is defining a planner timestep that is too large

manuaatitya commented 10 months ago

Thanks, it fixed the issue I had to set the timestep to 0.0001 and anything above that and the planner gives out rollout divergence error. Thanks for the help. I played around with the time steps but didn't realize I had to keep it very low for it to work.