Before this change, MjDataWrapper contained a custom data structure called MjDataMetadata, which contained the sizes of various arrays needed to create MjData. This was used for serialization and deserialization, as well as copying MjData instances.
This worked fine for native MuJoCo models, but as soon as plugins were used, there was information in the model that was needed and not available in MjDataMetadata. Since plugins are so general, keeping MjDataMetadata was untenable.
PiperOrigin-RevId: 578205355
Change-Id: I11b9ee797d1da5aaf1fecbbe170b3b0f1f1a3e6c
The use of `np.empty` triggers an msan use-of-uninitialized-value error when upgraded.
PiperOrigin-RevId: 503975799
Change-Id: I337c8227c8c1e3bd415d7a798fc5e764c88c0875
- Also change signatures of `mju_fill` and `mju_symmetrize` to conform to standard.
PiperOrigin-RevId: 485613824
Change-Id: I8dd618bac92ef40aa6c76380fa73302e81968687
- Add private function `mj_arenaAlloc`. This is used internally to allocate memory from the arena.
- Add private function `mj_nefc` to count constraints. This function returns a tight upper bound on `d->nefc`. The number of counted constraints can be slightly bigger than exact `d->nefc` in the case of constraints with empty Jacobian, as when placing a frictional tendon between two world sites.
- Add new `memory` attribute to the `size` XML element for specification of arena memory size. This attribute is mutually exclusive with `nstack` and `njmax` specifications, which are now deprecated (but left around for the time being for legacy compatibility).
- Move `d->stack` to the end of the new arena space. The stack now grows in reverse from the end.
PiperOrigin-RevId: 479341539
Change-Id: Ie019c202e0908577ffc6f833a37920858116f667
List all valid names in the error message.
Fix an off-by-one error when accessing elements by numeric index (rather than name).
PiperOrigin-RevId: 457702283
Change-Id: I6e4f1518b4ecd9ca91ac9b0bf6b0963fc0a9bd18
Indiscriminate memset into d->buffer and m->buffer previously caused msan to not detect uninitialized reads.
Also fix tests with uninitialized read bugs that are detected by msan after this change.
PiperOrigin-RevId: 451508224
Change-Id: I1f4b080a8ef765c34ba7a0adc2c686419f6e5516
NumPy arrays with an empty shape cannot be assigned via the usual syntax.
Fixes: #238.
Related: #237.
PiperOrigin-RevId: 441265437
Change-Id: Ib0de22c83f9babe9a97682dc5a32660c198ad68c
This commit requires a new binary build, and therefore breaks compatibility with version 2.1.3.
Fixes#217.
Change-Id: I1e08b6fd2c468e3845e2166a1e4cc9d265de64de
This is useful when writing or modifying collision functions, when the actual direction of the x and y axes of a contact can be important.
PiperOrigin-RevId: 437256700
Change-Id: I5eab737fc98018399e151552778c6109088bf614