google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.29k stars 829 forks source link

Allow rollout to accept a list of models of length nroll #2250

Closed aftersomemath closed 2 days ago

aftersomemath commented 3 days ago

rollout can now accept a list of models of length nroll, similar to its other arguments.

The models must be compatible, meaning nstate, ncontrol, nv, and nsensordata must be equal.

yuvaltassa commented 3 days ago

I'm getting

[ RUN      ] MuJoCoRolloutTest.test_detect_divergence
[third_party/crosstool/v18/stable/src/libcxx/include/__vector/vector.h:1114](https://cs.corp.google.com/piper///depot/google3/third_party/crosstool/v18/stable/src/libcxx/include/__vector/vector.h?l=1114&ws=tap-presubmit-rerun-server/51936822&snapshot=2): assertion __n < size() failed: vector[] index out of bounds

In line 233, shouldn't you be passing model_ptrs.data() ? But I don't understand how the test are passing on GH...

aftersomemath commented 2 days ago

It looks like the internal check passed, but I did not do anything. I'm worried that there is a bug now (and passing a raw pointer using model_ptrs.data() would just mask that). Was anything done that made the internal check pass?

yuvaltassa commented 2 days ago

They are not passing, I don't think. I'm a bit confused by the situation, but I trust @nimrod-gileadi will sort it out.

aftersomemath commented 2 days ago

I found the bug, I created the std::vector incorrectly.

aftersomemath commented 2 days ago

All requested changes implemented.