mujoco 3.3.0__tar.gz → 3.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mujoco-3.3.0/mujoco.egg-info → mujoco-3.3.2}/PKG-INFO +5 -4
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/CMakeLists.txt +26 -4
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/__init__.py +29 -2
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/bindings_test.py +20 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/MujocoDependencies.cmake +2 -2
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/enum_traits.h +4 -1
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/function_traits.h +65 -43
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/codegen/generate_structs.py +8 -5
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/enums.py +31 -28
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/functions.py +107 -105
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/structs.py +174 -30
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/minimize.py +56 -12
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/minimize_test.py +6 -7
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/mjpython/Info.plist +4 -4
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/CMakeLists.txt +1 -1
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/simulate.cc +95 -16
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/simulate.h +7 -3
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate.cc +67 -2
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/specs.cc +73 -138
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/specs.cc.inc +802 -433
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/specs_test.py +51 -22
- mujoco-3.3.2/mujoco/specs_wrapper.cc +124 -0
- mujoco-3.3.2/mujoco/specs_wrapper.h +45 -0
- mujoco-3.3.2/mujoco/structs.cc +1259 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/structs.h +11 -5
- mujoco-3.3.2/mujoco/structs_wrappers.cc +1328 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/viewer.py +82 -2
- {mujoco-3.3.0 → mujoco-3.3.2/mujoco.egg-info}/PKG-INFO +5 -4
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco.egg-info/SOURCES.txt +3 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/pyproject.toml +3 -3
- mujoco-3.3.0/mujoco/structs.cc +0 -2514
- {mujoco-3.3.0 → mujoco-3.3.2}/LICENSE +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/LICENSES_THIRD_PARTY.md +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/MANIFEST.in +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/README.md +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/callbacks.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cgl/__init__.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cgl/cgl.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/CheckAvxSupport.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/FindOrFetch.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/MujocoHarden.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/MujocoLinkOptions.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/MujocoMacOS.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/MujocoOptions.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/ShellTests.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/cmake/TargetAddRpath.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/constants.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/egl/__init__.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/egl/egl_ext.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/enums.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/errors.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/errors.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/functions.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/functions.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/gl_context.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/glfw/__init__.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/indexer_xmacro.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/indexers.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/indexers.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/__init__.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/ast_nodes.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/ast_nodes_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/codegen/formatter.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/codegen/generate_enums.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/codegen/generate_functions.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/enums_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/functions_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/mjxmacro.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/structs_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/type_parsing.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/introspect/type_parsing_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/memory_leak_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/mjpython/mjpython.icns +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/mjpython/mjpython.mm +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/mjpython/mjpython.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/msh2obj.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/msh2obj_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/osmesa/__init__.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/private.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/raw.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/render.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/render_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/renderer.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/renderer_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/rollout.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/rollout.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/rollout_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/serialization.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/array_safety.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/cmake/CheckAvxSupport.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/cmake/FindOrFetch.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/cmake/MujocoHarden.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/cmake/MujocoLinkOptions.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/cmake/MujocoMacOS.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/cmake/SimulateDependencies.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/cmake/SimulateOptions.cmake +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/glfw_adapter.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/glfw_adapter.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/glfw_corevideo.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/glfw_corevideo.mm +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/glfw_dispatch.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/glfw_dispatch.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/macos_gui.mm +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/main.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/platform_ui_adapter.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/simulate/platform_ui_adapter.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/testdata/abdomen_1_body.msh +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/testdata/model.xml +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/testdata/msh.xml +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/testdata/usd_golden.usda +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/threadpool.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/threadpool.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/camera.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/demo.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/exporter.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/exporter_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/lights.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/objects.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/shapes.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/usd/utils.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/CMakeLists.txt +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/array_traits.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/array_traits_test.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/crossplatform.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/func_traits.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/func_traits_test.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/func_wrap.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/func_wrap_test.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/tuple_tools.h +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/util/tuple_tools_test.cc +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco/viewer_test.py +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco.egg-info/dependency_links.txt +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco.egg-info/requires.txt +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/mujoco.egg-info/top_level.txt +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/setup.cfg +0 -0
- {mujoco-3.3.0 → mujoco-3.3.2}/setup.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: mujoco
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.2
|
|
4
4
|
Summary: MuJoCo Physics Simulator
|
|
5
5
|
Author-email: Google DeepMind <mujoco@deepmind.com>
|
|
6
6
|
License: Apache License 2.0
|
|
7
7
|
Project-URL: Homepage, https://github.com/google-deepmind/mujoco
|
|
8
|
-
Project-URL: Documentation, https://mujoco.readthedocs.io/en/3.3.
|
|
8
|
+
Project-URL: Documentation, https://mujoco.readthedocs.io/en/3.3.2
|
|
9
9
|
Project-URL: Repository, https://github.com/google-deepmind/mujoco
|
|
10
|
-
Project-URL: Changelog, https://mujoco.readthedocs.io/en/3.3.
|
|
10
|
+
Project-URL: Changelog, https://mujoco.readthedocs.io/en/3.3.2/changelog.html
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -33,6 +33,7 @@ Requires-Dist: usd-core; extra == "usd"
|
|
|
33
33
|
Requires-Dist: pillow; extra == "usd"
|
|
34
34
|
Dynamic: description
|
|
35
35
|
Dynamic: description-content-type
|
|
36
|
+
Dynamic: license-file
|
|
36
37
|
|
|
37
38
|
# MuJoCo Python Bindings
|
|
38
39
|
|
|
@@ -84,7 +84,7 @@ if(NOT TARGET mujoco)
|
|
|
84
84
|
if(MUJOCO_FRAMEWORK)
|
|
85
85
|
message("MuJoCo framework is at ${MUJOCO_FRAMEWORK}/mujoco.framework")
|
|
86
86
|
set(MUJOCO_LIBRARY
|
|
87
|
-
${MUJOCO_FRAMEWORK}/mujoco.framework/Versions/A/libmujoco.3.3.
|
|
87
|
+
${MUJOCO_FRAMEWORK}/mujoco.framework/Versions/A/libmujoco.3.3.2.dylib
|
|
88
88
|
)
|
|
89
89
|
target_compile_options(mujoco INTERFACE -F${MUJOCO_FRAMEWORK})
|
|
90
90
|
endif()
|
|
@@ -92,7 +92,7 @@ if(NOT TARGET mujoco)
|
|
|
92
92
|
|
|
93
93
|
if(NOT MUJOCO_FRAMEWORK)
|
|
94
94
|
find_library(
|
|
95
|
-
MUJOCO_LIBRARY mujoco mujoco.3.3.
|
|
95
|
+
MUJOCO_LIBRARY mujoco mujoco.3.3.2 HINTS ${MUJOCO_LIBRARY_DIR} REQUIRED
|
|
96
96
|
)
|
|
97
97
|
find_path(MUJOCO_INCLUDE mujoco/mujoco.h HINTS ${MUJOCO_INCLUDE_DIR} REQUIRED)
|
|
98
98
|
message("MuJoCo is at ${MUJOCO_LIBRARY}")
|
|
@@ -140,7 +140,7 @@ findorfetch(
|
|
|
140
140
|
GIT_REPO
|
|
141
141
|
https://github.com/abseil/abseil-cpp
|
|
142
142
|
GIT_TAG
|
|
143
|
-
|
|
143
|
+
d9e4955c65cd4367dd6bf46f4ccb8cd3d100540b # LTS 20250127.1
|
|
144
144
|
TARGETS
|
|
145
145
|
${MUJOCO_PYTHON_ABSL_TARGETS}
|
|
146
146
|
EXCLUDE_FROM_ALL
|
|
@@ -173,7 +173,7 @@ findorfetch(
|
|
|
173
173
|
GIT_REPO
|
|
174
174
|
https://gitlab.com/libeigen/eigen
|
|
175
175
|
GIT_TAG
|
|
176
|
-
|
|
176
|
+
464c1d097891a1462ab28bf8bb763c1683883892
|
|
177
177
|
TARGETS
|
|
178
178
|
Eigen3::Eigen
|
|
179
179
|
EXCLUDE_FROM_ALL
|
|
@@ -278,6 +278,25 @@ target_link_libraries(
|
|
|
278
278
|
raw
|
|
279
279
|
)
|
|
280
280
|
|
|
281
|
+
add_library(structs_wrappers STATIC
|
|
282
|
+
structs_wrappers.cc
|
|
283
|
+
serialization.h
|
|
284
|
+
indexers.cc
|
|
285
|
+
)
|
|
286
|
+
target_include_directories(structs_wrappers PRIVATE ${Python3_INCLUDE_DIRS})
|
|
287
|
+
target_link_libraries(
|
|
288
|
+
structs_wrappers
|
|
289
|
+
PRIVATE absl::flat_hash_map
|
|
290
|
+
absl::span
|
|
291
|
+
crossplatform
|
|
292
|
+
mujoco
|
|
293
|
+
raw
|
|
294
|
+
structs_header
|
|
295
|
+
pybind11::headers
|
|
296
|
+
Eigen3::Eigen
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
|
|
281
300
|
add_library(functions_header INTERFACE)
|
|
282
301
|
target_sources(functions_header INTERFACE functions.h)
|
|
283
302
|
set_target_properties(functions_header PROPERTIES PUBLIC_HEADER functions.h)
|
|
@@ -403,6 +422,7 @@ target_link_libraries(
|
|
|
403
422
|
func_wrap
|
|
404
423
|
function_traits
|
|
405
424
|
structs_header
|
|
425
|
+
structs_wrappers
|
|
406
426
|
)
|
|
407
427
|
|
|
408
428
|
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/specs.cc.inc)
|
|
@@ -417,6 +437,8 @@ endif()
|
|
|
417
437
|
mujoco_pybind11_module(
|
|
418
438
|
_specs
|
|
419
439
|
specs.cc
|
|
440
|
+
specs_wrapper.h
|
|
441
|
+
specs_wrapper.cc
|
|
420
442
|
specs.cc.inc
|
|
421
443
|
)
|
|
422
444
|
target_link_libraries(
|
|
@@ -91,7 +91,7 @@ MjStruct: TypeAlias = Union[
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
def to_zip(spec: _specs.MjSpec, file: Union[str, IO[bytes]]) -> None:
|
|
94
|
-
"""Converts
|
|
94
|
+
"""Converts an MjSpec to a zip file.
|
|
95
95
|
|
|
96
96
|
Args:
|
|
97
97
|
spec: The mjSpec to save to a file.
|
|
@@ -109,6 +109,33 @@ def to_zip(spec: _specs.MjSpec, file: Union[str, IO[bytes]]) -> None:
|
|
|
109
109
|
zip_file.writestr(zip_info, contents)
|
|
110
110
|
|
|
111
111
|
|
|
112
|
+
def from_zip(file: Union[str, IO[bytes]]) -> _specs.MjSpec:
|
|
113
|
+
"""Reads a zip file and returns an MjSpec.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
file: The path to the file to read from or the file object to read from.
|
|
117
|
+
Returns:
|
|
118
|
+
An MjSpec object.
|
|
119
|
+
"""
|
|
120
|
+
assets = {}
|
|
121
|
+
xml_string = None
|
|
122
|
+
if isinstance(file, str):
|
|
123
|
+
file = open(file, 'rb')
|
|
124
|
+
if not zipfile.is_zipfile(file):
|
|
125
|
+
raise ValueError(f'File {file} is not a zip file.')
|
|
126
|
+
with zipfile.ZipFile(file, 'r') as zip_file:
|
|
127
|
+
for zip_info in zip_file.infolist():
|
|
128
|
+
if not zip_info.filename.endswith(os.path.sep):
|
|
129
|
+
with zip_file.open(zip_info.filename) as f:
|
|
130
|
+
if zip_info.filename.endswith('.xml'):
|
|
131
|
+
xml_string = f.read()
|
|
132
|
+
else:
|
|
133
|
+
assets[zip_info.filename] = f.read()
|
|
134
|
+
if not xml_string:
|
|
135
|
+
raise ValueError('No XML file found in zip file.')
|
|
136
|
+
return _specs.MjSpec.from_string(xml_string, assets=assets)
|
|
137
|
+
|
|
138
|
+
|
|
112
139
|
class _MjBindModel:
|
|
113
140
|
def __init__(self, elements: Sequence[Any]):
|
|
114
141
|
self.elements = elements
|
|
@@ -166,7 +193,7 @@ def _bind_data(
|
|
|
166
193
|
else:
|
|
167
194
|
return data.bind_scalar(specs)
|
|
168
195
|
|
|
169
|
-
|
|
196
|
+
_specs.MjSpec.from_zip = from_zip
|
|
170
197
|
_specs.MjSpec.to_zip = to_zip
|
|
171
198
|
_structs.MjData.bind = _bind_data
|
|
172
199
|
_structs.MjModel.bind = _bind_model
|
|
@@ -377,6 +377,12 @@ class MuJoCoBindingsTest(parameterized.TestCase):
|
|
|
377
377
|
4,
|
|
378
378
|
)
|
|
379
379
|
|
|
380
|
+
def test_mjvisual_repr(self):
|
|
381
|
+
# Regression test for issue #2488.
|
|
382
|
+
vis_repr = repr(self.model.vis)
|
|
383
|
+
self.assertNotEmpty(vis_repr)
|
|
384
|
+
self.assertIn('MjVisual', vis_repr)
|
|
385
|
+
|
|
380
386
|
def test_mjmodel_can_read_and_write_opt(self):
|
|
381
387
|
self.assertEqual(self.model.opt.timestep, 0.002)
|
|
382
388
|
np.testing.assert_array_equal(self.model.opt.gravity, [0, 0, -9.81])
|
|
@@ -1077,6 +1083,20 @@ Euler integrator, semi-implicit in velocity.
|
|
|
1077
1083
|
):
|
|
1078
1084
|
mujoco.mj_forward(self.model, self.data)
|
|
1079
1085
|
|
|
1086
|
+
def test_timer_installed_by_default(self):
|
|
1087
|
+
timer_step = mujoco.mjtTimer.mjTIMER_STEP
|
|
1088
|
+
self.assertEqual(self.data.timer[timer_step].number, 0)
|
|
1089
|
+
self.assertEqual(self.data.timer[timer_step].duration, 0.0)
|
|
1090
|
+
|
|
1091
|
+
mujoco.mj_step(self.model, self.data)
|
|
1092
|
+
self.assertEqual(self.data.timer[timer_step].number, 1)
|
|
1093
|
+
duration_1 = self.data.timer[timer_step].duration
|
|
1094
|
+
self.assertGreater(duration_1, 0.0)
|
|
1095
|
+
|
|
1096
|
+
mujoco.mj_step(self.model, self.data, 5)
|
|
1097
|
+
self.assertEqual(self.data.timer[timer_step].number, 6)
|
|
1098
|
+
self.assertGreater(self.data.timer[timer_step].duration, duration_1)
|
|
1099
|
+
|
|
1080
1100
|
def test_mjcb_time(self):
|
|
1081
1101
|
|
|
1082
1102
|
class CallCounter:
|
|
@@ -39,12 +39,12 @@ set(MUJOCO_DEP_VERSION_qhull
|
|
|
39
39
|
CACHE STRING "Version of `qhull` to be fetched."
|
|
40
40
|
)
|
|
41
41
|
set(MUJOCO_DEP_VERSION_Eigen3
|
|
42
|
-
|
|
42
|
+
464c1d097891a1462ab28bf8bb763c1683883892
|
|
43
43
|
CACHE STRING "Version of `Eigen3` to be fetched."
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
set(MUJOCO_DEP_VERSION_abseil
|
|
47
|
-
|
|
47
|
+
d9e4955c65cd4367dd6bf46f4ccb8cd3d100540b # LTS 20250127.1
|
|
48
48
|
CACHE STRING "Version of `abseil` to be fetched."
|
|
49
49
|
)
|
|
50
50
|
|
|
@@ -269,7 +269,9 @@ struct mjtObj {
|
|
|
269
269
|
std::make_pair("mjOBJ_KEY", ::mjtObj::mjOBJ_KEY),
|
|
270
270
|
std::make_pair("mjOBJ_PLUGIN", ::mjtObj::mjOBJ_PLUGIN),
|
|
271
271
|
std::make_pair("mjNOBJECT", ::mjtObj::mjNOBJECT),
|
|
272
|
-
std::make_pair("mjOBJ_FRAME", ::mjtObj::mjOBJ_FRAME)
|
|
272
|
+
std::make_pair("mjOBJ_FRAME", ::mjtObj::mjOBJ_FRAME),
|
|
273
|
+
std::make_pair("mjOBJ_DEFAULT", ::mjtObj::mjOBJ_DEFAULT),
|
|
274
|
+
std::make_pair("mjOBJ_MODEL", ::mjtObj::mjOBJ_MODEL)};
|
|
273
275
|
};
|
|
274
276
|
|
|
275
277
|
struct mjtConstraint {
|
|
@@ -318,6 +320,7 @@ struct mjtSensor {
|
|
|
318
320
|
std::make_pair("mjSENS_ACTUATORVEL", ::mjtSensor::mjSENS_ACTUATORVEL),
|
|
319
321
|
std::make_pair("mjSENS_ACTUATORFRC", ::mjtSensor::mjSENS_ACTUATORFRC),
|
|
320
322
|
std::make_pair("mjSENS_JOINTACTFRC", ::mjtSensor::mjSENS_JOINTACTFRC),
|
|
323
|
+
std::make_pair("mjSENS_TENDONACTFRC", ::mjtSensor::mjSENS_TENDONACTFRC),
|
|
321
324
|
std::make_pair("mjSENS_BALLQUAT", ::mjtSensor::mjSENS_BALLQUAT),
|
|
322
325
|
std::make_pair("mjSENS_BALLANGVEL", ::mjtSensor::mjSENS_BALLANGVEL),
|
|
323
326
|
std::make_pair("mjSENS_JOINTLIMITPOS", ::mjtSensor::mjSENS_JOINTLIMITPOS),
|
|
@@ -134,7 +134,7 @@ struct mj_recompile {
|
|
|
134
134
|
|
|
135
135
|
struct mj_saveLastXML {
|
|
136
136
|
static constexpr char name[] = "mj_saveLastXML";
|
|
137
|
-
static constexpr char doc[] = "Update XML data structures with info from low-level model, save as MJCF. If error is not NULL, it must have size error_sz.";
|
|
137
|
+
static constexpr char doc[] = "Update XML data structures with info from low-level model created with mj_loadXML, save as MJCF. If error is not NULL, it must have size error_sz.";
|
|
138
138
|
using type = int (const char *, const mjModel *, char *, int);
|
|
139
139
|
static constexpr auto param_names = std::make_tuple("filename", "m", "error", "error_sz");
|
|
140
140
|
|
|
@@ -3861,53 +3861,20 @@ struct mju_taskJoin {
|
|
|
3861
3861
|
}
|
|
3862
3862
|
};
|
|
3863
3863
|
|
|
3864
|
-
struct
|
|
3865
|
-
static constexpr char name[] = "
|
|
3866
|
-
static constexpr char doc[] = "Attach child
|
|
3867
|
-
using type =
|
|
3864
|
+
struct mjs_attach {
|
|
3865
|
+
static constexpr char name[] = "mjs_attach";
|
|
3866
|
+
static constexpr char doc[] = "Attach child to a parent, return the attached element if success or NULL otherwise.";
|
|
3867
|
+
using type = mjsElement * (mjsElement *, const mjsElement *, const char *, const char *);
|
|
3868
3868
|
static constexpr auto param_names = std::make_tuple("parent", "child", "prefix", "suffix");
|
|
3869
3869
|
|
|
3870
3870
|
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
3871
|
-
return ::
|
|
3872
|
-
}
|
|
3873
|
-
};
|
|
3874
|
-
|
|
3875
|
-
struct mjs_attachFrame {
|
|
3876
|
-
static constexpr char name[] = "mjs_attachFrame";
|
|
3877
|
-
static constexpr char doc[] = "Attach child frame to a parent body, return the attached frame if success or NULL otherwise.";
|
|
3878
|
-
using type = mjsFrame * (mjsBody *, const mjsFrame *, const char *, const char *);
|
|
3879
|
-
static constexpr auto param_names = std::make_tuple("parent", "child", "prefix", "suffix");
|
|
3880
|
-
|
|
3881
|
-
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
3882
|
-
return ::mjs_attachFrame;
|
|
3883
|
-
}
|
|
3884
|
-
};
|
|
3885
|
-
|
|
3886
|
-
struct mjs_attachToSite {
|
|
3887
|
-
static constexpr char name[] = "mjs_attachToSite";
|
|
3888
|
-
static constexpr char doc[] = "Attach child body to a parent site, return the attached body if success or NULL otherwise.";
|
|
3889
|
-
using type = mjsBody * (mjsSite *, const mjsBody *, const char *, const char *);
|
|
3890
|
-
static constexpr auto param_names = std::make_tuple("parent", "child", "prefix", "suffix");
|
|
3891
|
-
|
|
3892
|
-
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
3893
|
-
return ::mjs_attachToSite;
|
|
3894
|
-
}
|
|
3895
|
-
};
|
|
3896
|
-
|
|
3897
|
-
struct mjs_attachFrameToSite {
|
|
3898
|
-
static constexpr char name[] = "mjs_attachFrameToSite";
|
|
3899
|
-
static constexpr char doc[] = "Attach child frame to a parent site, return the attached frame if success or NULL otherwise.";
|
|
3900
|
-
using type = mjsFrame * (mjsSite *, const mjsFrame *, const char *, const char *);
|
|
3901
|
-
static constexpr auto param_names = std::make_tuple("parent", "child", "prefix", "suffix");
|
|
3902
|
-
|
|
3903
|
-
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
3904
|
-
return ::mjs_attachFrameToSite;
|
|
3871
|
+
return ::mjs_attach;
|
|
3905
3872
|
}
|
|
3906
3873
|
};
|
|
3907
3874
|
|
|
3908
3875
|
struct mjs_detachBody {
|
|
3909
3876
|
static constexpr char name[] = "mjs_detachBody";
|
|
3910
|
-
static constexpr char doc[] = "
|
|
3877
|
+
static constexpr char doc[] = "Delete body and descendants from mjSpec, remove all references, return 0 on success.";
|
|
3911
3878
|
using type = int (mjSpec *, mjsBody *);
|
|
3912
3879
|
static constexpr auto param_names = std::make_tuple("s", "b");
|
|
3913
3880
|
|
|
@@ -3916,6 +3883,17 @@ struct mjs_detachBody {
|
|
|
3916
3883
|
}
|
|
3917
3884
|
};
|
|
3918
3885
|
|
|
3886
|
+
struct mjs_detachDefault {
|
|
3887
|
+
static constexpr char name[] = "mjs_detachDefault";
|
|
3888
|
+
static constexpr char doc[] = "Delete default class and descendants from mjSpec, remove all references, return 0 on success.";
|
|
3889
|
+
using type = int (mjSpec *, mjsDefault *);
|
|
3890
|
+
static constexpr auto param_names = std::make_tuple("s", "d");
|
|
3891
|
+
|
|
3892
|
+
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
3893
|
+
return ::mjs_detachDefault;
|
|
3894
|
+
}
|
|
3895
|
+
};
|
|
3896
|
+
|
|
3919
3897
|
struct mjs_addBody {
|
|
3920
3898
|
static constexpr char name[] = "mjs_addBody";
|
|
3921
3899
|
static constexpr char doc[] = "Add child body to body, return child.";
|
|
@@ -4323,6 +4301,17 @@ struct mjs_getParent {
|
|
|
4323
4301
|
}
|
|
4324
4302
|
};
|
|
4325
4303
|
|
|
4304
|
+
struct mjs_getFrame {
|
|
4305
|
+
static constexpr char name[] = "mjs_getFrame";
|
|
4306
|
+
static constexpr char doc[] = "Get parent frame.";
|
|
4307
|
+
using type = mjsFrame * (mjsElement *);
|
|
4308
|
+
static constexpr auto param_names = std::make_tuple("element");
|
|
4309
|
+
|
|
4310
|
+
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
4311
|
+
return ::mjs_getFrame;
|
|
4312
|
+
}
|
|
4313
|
+
};
|
|
4314
|
+
|
|
4326
4315
|
struct mjs_findFrame {
|
|
4327
4316
|
static constexpr char name[] = "mjs_findFrame";
|
|
4328
4317
|
static constexpr char doc[] = "Find frame by name.";
|
|
@@ -4348,7 +4337,7 @@ struct mjs_getDefault {
|
|
|
4348
4337
|
struct mjs_findDefault {
|
|
4349
4338
|
static constexpr char name[] = "mjs_findDefault";
|
|
4350
4339
|
static constexpr char doc[] = "Find default in model by class name.";
|
|
4351
|
-
using type =
|
|
4340
|
+
using type = mjsDefault * (mjSpec *, const char *);
|
|
4352
4341
|
static constexpr auto param_names = std::make_tuple("s", "classname");
|
|
4353
4342
|
|
|
4354
4343
|
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
@@ -4578,8 +4567,8 @@ struct mjs_setDefault {
|
|
|
4578
4567
|
|
|
4579
4568
|
struct mjs_setFrame {
|
|
4580
4569
|
static constexpr char name[] = "mjs_setFrame";
|
|
4581
|
-
static constexpr char doc[] = "Set element's enclosing frame.";
|
|
4582
|
-
using type =
|
|
4570
|
+
static constexpr char doc[] = "Set element's enclosing frame, return 0 on success.";
|
|
4571
|
+
using type = int (mjsElement *, mjsFrame *);
|
|
4583
4572
|
static constexpr auto param_names = std::make_tuple("dest", "frame");
|
|
4584
4573
|
|
|
4585
4574
|
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
@@ -4609,6 +4598,39 @@ struct mjs_bodyToFrame {
|
|
|
4609
4598
|
}
|
|
4610
4599
|
};
|
|
4611
4600
|
|
|
4601
|
+
struct mjs_setUserValue {
|
|
4602
|
+
static constexpr char name[] = "mjs_setUserValue";
|
|
4603
|
+
static constexpr char doc[] = "Set user payload, overriding the existing value for the specified key if present.";
|
|
4604
|
+
using type = void (mjsElement *, const char *, const void *);
|
|
4605
|
+
static constexpr auto param_names = std::make_tuple("element", "key", "data");
|
|
4606
|
+
|
|
4607
|
+
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
4608
|
+
return ::mjs_setUserValue;
|
|
4609
|
+
}
|
|
4610
|
+
};
|
|
4611
|
+
|
|
4612
|
+
struct mjs_getUserValue {
|
|
4613
|
+
static constexpr char name[] = "mjs_getUserValue";
|
|
4614
|
+
static constexpr char doc[] = "Return user payload or NULL if none found.";
|
|
4615
|
+
using type = const void * (mjsElement *, const char *);
|
|
4616
|
+
static constexpr auto param_names = std::make_tuple("element", "key");
|
|
4617
|
+
|
|
4618
|
+
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
4619
|
+
return ::mjs_getUserValue;
|
|
4620
|
+
}
|
|
4621
|
+
};
|
|
4622
|
+
|
|
4623
|
+
struct mjs_deleteUserValue {
|
|
4624
|
+
static constexpr char name[] = "mjs_deleteUserValue";
|
|
4625
|
+
static constexpr char doc[] = "Delete user payload.";
|
|
4626
|
+
using type = void (mjsElement *, const char *);
|
|
4627
|
+
static constexpr auto param_names = std::make_tuple("element", "key");
|
|
4628
|
+
|
|
4629
|
+
MUJOCO_ALWAYS_INLINE static type& GetFunc() {
|
|
4630
|
+
return ::mjs_deleteUserValue;
|
|
4631
|
+
}
|
|
4632
|
+
};
|
|
4633
|
+
|
|
4612
4634
|
struct mjs_defaultSpec {
|
|
4613
4635
|
static constexpr char name[] = "mjs_defaultSpec";
|
|
4614
4636
|
static constexpr char doc[] = "Default spec attributes.";
|
|
@@ -47,7 +47,7 @@ _EXCLUDED = (
|
|
|
47
47
|
'mjResource_',
|
|
48
48
|
)
|
|
49
49
|
|
|
50
|
-
_ARRAY_COMMENT_PATTERN = re.compile(r'(.+?)\s
|
|
50
|
+
_ARRAY_COMMENT_PATTERN = re.compile(r'(.+?)\s+\(([^\(\)]+) x ([^\(\)]+)\)\Z')
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
def traverse(node, visitor):
|
|
@@ -93,16 +93,19 @@ class MjStructVisitor:
|
|
|
93
93
|
# No valid normalization, just parse the declname.
|
|
94
94
|
return type_parsing.parse_type(declname)
|
|
95
95
|
|
|
96
|
-
def _make_comment(self, node: ClangJsonNode) -> str:
|
|
96
|
+
def _make_comment(self, node: ClangJsonNode, strip: bool = True) -> str:
|
|
97
97
|
"""Makes a comment string from a Clang AST FullComment node."""
|
|
98
98
|
kind = node.get('kind')
|
|
99
99
|
if kind == 'TextComment':
|
|
100
|
-
|
|
100
|
+
retval = node['text'].replace('\N{NO-BREAK SPACE}', ' ')
|
|
101
101
|
else:
|
|
102
102
|
strings = []
|
|
103
103
|
for child in node['inner']:
|
|
104
|
-
strings.append(self._make_comment(child))
|
|
105
|
-
|
|
104
|
+
strings.append(self._make_comment(child, strip=False))
|
|
105
|
+
retval = ''.join(strings)
|
|
106
|
+
if strip:
|
|
107
|
+
retval = retval.strip()
|
|
108
|
+
return retval
|
|
106
109
|
|
|
107
110
|
def _make_field(
|
|
108
111
|
self, node: ClangJsonNode
|
|
@@ -287,6 +287,8 @@ ENUMS: Mapping[str, EnumDecl] = dict([
|
|
|
287
287
|
('mjOBJ_PLUGIN', 25),
|
|
288
288
|
('mjNOBJECT', 26),
|
|
289
289
|
('mjOBJ_FRAME', 100),
|
|
290
|
+
('mjOBJ_DEFAULT', 101),
|
|
291
|
+
('mjOBJ_MODEL', 102),
|
|
290
292
|
]),
|
|
291
293
|
)),
|
|
292
294
|
('mjtConstraint',
|
|
@@ -338,34 +340,35 @@ ENUMS: Mapping[str, EnumDecl] = dict([
|
|
|
338
340
|
('mjSENS_ACTUATORVEL', 14),
|
|
339
341
|
('mjSENS_ACTUATORFRC', 15),
|
|
340
342
|
('mjSENS_JOINTACTFRC', 16),
|
|
341
|
-
('
|
|
342
|
-
('
|
|
343
|
-
('
|
|
344
|
-
('
|
|
345
|
-
('
|
|
346
|
-
('
|
|
347
|
-
('
|
|
348
|
-
('
|
|
349
|
-
('
|
|
350
|
-
('
|
|
351
|
-
('
|
|
352
|
-
('
|
|
353
|
-
('
|
|
354
|
-
('
|
|
355
|
-
('
|
|
356
|
-
('
|
|
357
|
-
('
|
|
358
|
-
('
|
|
359
|
-
('
|
|
360
|
-
('
|
|
361
|
-
('
|
|
362
|
-
('
|
|
363
|
-
('
|
|
364
|
-
('
|
|
365
|
-
('
|
|
366
|
-
('
|
|
367
|
-
('
|
|
368
|
-
('
|
|
343
|
+
('mjSENS_TENDONACTFRC', 17),
|
|
344
|
+
('mjSENS_BALLQUAT', 18),
|
|
345
|
+
('mjSENS_BALLANGVEL', 19),
|
|
346
|
+
('mjSENS_JOINTLIMITPOS', 20),
|
|
347
|
+
('mjSENS_JOINTLIMITVEL', 21),
|
|
348
|
+
('mjSENS_JOINTLIMITFRC', 22),
|
|
349
|
+
('mjSENS_TENDONLIMITPOS', 23),
|
|
350
|
+
('mjSENS_TENDONLIMITVEL', 24),
|
|
351
|
+
('mjSENS_TENDONLIMITFRC', 25),
|
|
352
|
+
('mjSENS_FRAMEPOS', 26),
|
|
353
|
+
('mjSENS_FRAMEQUAT', 27),
|
|
354
|
+
('mjSENS_FRAMEXAXIS', 28),
|
|
355
|
+
('mjSENS_FRAMEYAXIS', 29),
|
|
356
|
+
('mjSENS_FRAMEZAXIS', 30),
|
|
357
|
+
('mjSENS_FRAMELINVEL', 31),
|
|
358
|
+
('mjSENS_FRAMEANGVEL', 32),
|
|
359
|
+
('mjSENS_FRAMELINACC', 33),
|
|
360
|
+
('mjSENS_FRAMEANGACC', 34),
|
|
361
|
+
('mjSENS_SUBTREECOM', 35),
|
|
362
|
+
('mjSENS_SUBTREELINVEL', 36),
|
|
363
|
+
('mjSENS_SUBTREEANGMOM', 37),
|
|
364
|
+
('mjSENS_GEOMDIST', 38),
|
|
365
|
+
('mjSENS_GEOMNORMAL', 39),
|
|
366
|
+
('mjSENS_GEOMFROMTO', 40),
|
|
367
|
+
('mjSENS_E_POTENTIAL', 41),
|
|
368
|
+
('mjSENS_E_KINETIC', 42),
|
|
369
|
+
('mjSENS_CLOCK', 43),
|
|
370
|
+
('mjSENS_PLUGIN', 44),
|
|
371
|
+
('mjSENS_USER', 45),
|
|
369
372
|
]),
|
|
370
373
|
)),
|
|
371
374
|
('mjtStage',
|