This change updates all size-related members within the `mjModel` struct from `int` to `mjtSize`. This allows MuJoCo to handle models with a larger number of elements. Corresponding changes were made to macros, function signatures, and I/O routines to accommodate the new `mjtSize` type.
PiperOrigin-RevId: 860144595
Change-Id: I701c6d607715d240766b6210a9773cd9e4258c59
This allows other modules to depend on functions such as FromRawPointer that previously were only defined in the _struct python module.
PiperOrigin-RevId: 745619670
Change-Id: I9f1af60cb665c00d853b7ca38201b37302d278af
This method allows users to bind a spec to a model or data object, making it less verbose to access its arrays.
PiperOrigin-RevId: 699952211
Change-Id: I6b71a88d5a6968bc0f902bd49db7c568b46a4dfb
When loading models in the XML bindings, different issues with the asset dictionary were all reported as "assets dict is too big".
PiperOrigin-RevId: 670960339
Change-Id: I2e47d91a6b433fd90ebdf9960a9b5b47413af410
This CL adds error handling to the mj_recompile function. If the recompile fails, the function will return -1 and set the error message in the spec. The Python wrapper for mj_recompile will catch the error and raise a ValueError exception.
PiperOrigin-RevId: 666784579
Change-Id: I225eca1769ea839c782be3c03fc4ff1ea5885a48
Also add metadata fields to the Python bindings of mjModel and mjOption,
and fix dtype of a number of fields.
PiperOrigin-RevId: 654138876
Change-Id: If2bbe41bf3dfdb350d60b5289afc65fffb397ce9
In MjDataWrapper.__deepcopy__ use the Python implementation of MjModelWrapper.__deepcopy__ to make an object that Python knows about and can release later.
Fixesgoogle-deepmind/mujoco#1572.
PiperOrigin-RevId: 644967999
Change-Id: I95d093c672e136122e1939f69463a4d29dad82e8
Orthographic cameras are specified by setting the `orthographic` attribute of the `<camera>` element. The `fovy` attribute is still used to specify the field-of-view, but its semantic is different for orthographic cameras. For orthographic cameras, the field-of-view is expressed in units of length, rather than degrees.
Other related changes:
* Fix bug in the ordering of `cam_xxx` elements in `mjModel`.
* Make camera visualization translucent only when the frustum is visualized.
* Added a button to `simulate` to toggle between perspective and orthographic free cameras.
https://youtu.be/ZXBTEIDWHhs
PiperOrigin-RevId: 642293435
Change-Id: Id090a421ad88ab404b5b27ddbbd6bfc81ad49bc5
Rename `light_radius` -> `light_bulbradius`, make the default value 0.02.
PiperOrigin-RevId: 627032170
Change-Id: I1e01e2eca028c0aefc2e7dc384e8b34abac184aa
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