pax_global_header 0000666 0000000 0000000 00000000064 14306105762 0014516 g ustar 00root root 0000000 0000000 52 comment=9b694103e66a60ba602630cba528c50058328117
mujoco-2.2.2/ 0000775 0000000 0000000 00000000000 14306105762 0013015 5 ustar 00root root 0000000 0000000 mujoco-2.2.2/.github/ 0000775 0000000 0000000 00000000000 14306105762 0014355 5 ustar 00root root 0000000 0000000 mujoco-2.2.2/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 14306105762 0016540 5 ustar 00root root 0000000 0000000 mujoco-2.2.2/.github/ISSUE_TEMPLATE/ask_for_help.md 0000664 0000000 0000000 00000002130 14306105762 0021512 0 ustar 00root root 0000000 0000000 ---
name: Asking for help
about: Request help from the developers and the community
title: ''
labels: question
assignees: ''
---
**How to ask for help**
First, read our quick guide to
[asking good questions](https://github.com/deepmind/mujoco#asking-questions).
Below is a template for you to use:
Hi,
I'm a (student / professor / engineer) and I'm trying to use MuJoCo for _____.
I'm looking for some help with ____.
Here is a model which explains my question:
minimal XML
```XML
```
Here is a screenshot / video, illustrating my question:
mujoco-2.2.2/.github/ISSUE_TEMPLATE/bug_report.md 0000664 0000000 0000000 00000001401 14306105762 0021226 0 ustar 00root root 0000000 0000000 ---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**How to submit a good bug report**
- Are you sure this is a bug? If not, consider using the "Ask for help" or "Feature request" templates.
- Use a clear and descriptive title.
- Make it easy to reproduce the problem.
- Include a ***minimal*** model that demonstrates the problem. If the model is small, include it as inline XML. If it requires binary assets, attach it as a zip file.
- Include a screenshot or video, if relevant.
- Include the following context:
- Operating system.
- MuJoCo version (and if the bug is new, the version where it used to work).
- For Python issues, what bindings are you using (i.e `mujoco`, `dm_control`, `mujoco-py`)? mujoco-2.2.2/.github/ISSUE_TEMPLATE/feature_request.md 0000664 0000000 0000000 00000001125 14306105762 0022264 0 ustar 00root root 0000000 0000000 ---
name: Feature request
about: Suggest an idea for MuJoCo
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here. mujoco-2.2.2/.github/workflows/ 0000775 0000000 0000000 00000000000 14306105762 0016412 5 ustar 00root root 0000000 0000000 mujoco-2.2.2/.github/workflows/build.yml 0000664 0000000 0000000 00000014731 14306105762 0020242 0 ustar 00root root 0000000 0000000 # This configuration is used to build and test on GitHub Actions only.
# It is not the same configuration that is used by DeepMind to create release binaries.
# The "official" binaries are built with Clang 13 on all platforms, and are linked against libc++
# on Linux.
#
# We set CMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF here to reduce build time.
# It is highly recommended that this is set to ON for production builds.
name: build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
mujoco:
strategy:
matrix:
include:
- os: ubuntu-22.04
additional_label: "with GCC 11"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-11
-DCMAKE_CXX_COMPILER:STRING=g++-11
tmpdir: "/tmp"
- os: ubuntu-20.04
additional_label: "with GCC 10"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-10
-DCMAKE_CXX_COMPILER:STRING=g++-10
tmpdir: "/tmp"
- os: ubuntu-20.04
additional_label: "with GCC 9"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-9
-DCMAKE_CXX_COMPILER:STRING=g++-9
tmpdir: "/tmp"
- os: ubuntu-22.04
additional_label: "with Clang 14"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-14
-DCMAKE_CXX_COMPILER:STRING=clang++-14
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-22.04
additional_label: "with Clang 13"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-13
-DCMAKE_CXX_COMPILER:STRING=clang++-13
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-22.04
additional_label: "with Clang 12"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-12
-DCMAKE_CXX_COMPILER:STRING=clang++-12
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-20.04
additional_label: "with Clang 11"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-11
-DCMAKE_CXX_COMPILER:STRING=clang++-11
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-20.04
additional_label: "with Clang 10"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-10
-DCMAKE_CXX_COMPILER:STRING=clang++-10
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: macos-12
cmake_args: >-
-G Ninja
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: windows-2022
cmake_build_args: "-- -m"
tmpdir: "C:/Temp"
name: "MuJoCo on ${{ matrix.os }} ${{ matrix.additional_label }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Prepare Linux
if: ${{ runner.os == 'Linux' }}
run: >
sudo apt-get update && sudo apt-get install
libgl1-mesa-dev
libxinerama-dev
libxcursor-dev
libxrandr-dev
libxi-dev
ninja-build
- name: Prepare macOS
if: ${{ runner.os == 'macOS' }}
run: brew install ninja
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Prepare Python
shell: bash
run: |
cd ${{ matrix.tmpdir }}
python -m venv venv
if [[ $RUNNER_OS == "Windows" ]]; then
mkdir venv/bin
fixpath="$(s="$(cat venv/Scripts/activate | grep VIRTUAL_ENV=)"; echo "${s:13:-1}")"
sed -i "s#$(printf "%q" "${fixpath}")#$(cygpath "${fixpath}")#g" venv/Scripts/activate
ln -s ../Scripts/activate venv/bin/activate
fi
source venv/bin/activate
python -m pip install --upgrade pip
pip install pytest wheel
- name: Configure MuJoCo
run: >
mkdir build &&
cd build &&
cmake ..
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_INSTALL_PREFIX:STRING=${{ matrix.tmpdir }}/mujoco_install
-DMUJOCO_BUILD_EXAMPLES:BOOL=OFF
${{ matrix.cmake_args }}
- name: Build MuJoCo
working-directory: build
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }}
- name: Test MuJoCo
working-directory: build
run: ctest -C Release --output-on-failure .
- name: Install MuJoCo
working-directory: build
run: cmake --install .
- name: Configure samples
working-directory: sample
run: >
mkdir build &&
cd build &&
cmake ..
-DCMAKE_BUILD_TYPE:STRING=Release
-Dmujoco_ROOT:STRING=${{ matrix.tmpdir }}/mujoco_install
${{ matrix.cmake_args }}
- name: Build samples
working-directory: sample/build
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }}
- name: Configure simulate
working-directory: simulate
run: >
mkdir build &&
cd build &&
cmake ..
-DCMAKE_BUILD_TYPE:STRING=Release
-Dmujoco_ROOT:STRING=${{ matrix.tmpdir }}/mujoco_install
${{ matrix.cmake_args }}
- name: Build simulate
working-directory: simulate/build
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }}
- name: Make Python sdist
shell: bash
working-directory: python
run: >
source ${{ matrix.tmpdir }}/venv/bin/activate &&
./make_sdist.sh
- name: Build Python bindings
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: python/dist
run: >
source ${{ matrix.tmpdir }}/venv/bin/activate &&
MUJOCO_PATH="${{ matrix.tmpdir }}/mujoco_install"
MUJOCO_CMAKE_ARGS="-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF ${{ matrix.cmake_args }}"
pip wheel -v --no-deps mujoco-*.tar.gz
- name: Install Python bindings
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: python/dist
run: >
source ${{ matrix.tmpdir }}/venv/bin/activate &&
pip install mujoco-*.whl
- name: Test Python bindings
if: ${{ runner.os != 'Windows' }}
shell: bash
env:
MUJOCO_GL: disable
run: >
source ${{ matrix.tmpdir }}/venv/bin/activate &&
pytest -v --pyargs mujoco
mujoco-2.2.2/.gitignore 0000664 0000000 0000000 00000000560 14306105762 0015006 0 ustar 00root root 0000000 0000000 # Don't commit binaries
*.a
*.asm
*.dll
*.dylib
*.exe
*.lib
*.out
*.o
*.so
*.so.*
# Exclude editor config
.vscode/
.vs/
# Exclude temporary folders
*.egg-info/
build/
build_cmake/
# Exclude macOS folder attributes
.DS_Store
# Exclude macOS Info.framework.plist
Info.framework.plist
# Python byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
mujoco-2.2.2/.readthedocs.yml 0000664 0000000 0000000 00000000476 14306105762 0016112 0 ustar 00root root 0000000 0000000 # Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.10"
sphinx:
builder: html
configuration: doc/conf.py
fail_on_warning: false
python:
install:
- requirements: doc/requirements.txt
mujoco-2.2.2/CMakeLists.txt 0000664 0000000 0000000 00000015774 14306105762 0015573 0 ustar 00root root 0000000 0000000 # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
cmake_minimum_required(VERSION 3.16)
# Make CMAKE_C_VISIBILITY_PRESET work properly.
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
# INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
# Default to GLVND if available.
set(CMAKE_POLICY_DEFAULT_CMP0072 NEW)
# Avoid BUILD_SHARED_LIBS getting overridden by an option() in ccd.
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
# This line has to appear before 'PROJECT' in order to be able to disable incremental linking
set(MSVC_INCREMENTAL_DEFAULT ON)
project(
mujoco
VERSION 2.2.2
DESCRIPTION "MuJoCo Physics Simulator"
HOMEPAGE_URL "https://mujoco.org"
)
enable_language(C)
enable_language(CXX)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
option(MUJOCO_BUILD_EXAMPLES "Build samples for MuJoCo" ON)
option(MUJOCO_BUILD_SIMULATE "Build simulate library for MuJoCo" ON)
option(MUJOCO_BUILD_TESTS "Build tests for MuJoCo" ON)
option(MUJOCO_TEST_PYTHON_UTIL "Build and test utility libraries for Python bindings" ON)
if(APPLE AND (MUJOCO_BUILD_EXAMPLES OR MUJOCO_BUILD_SIMULATE))
enable_language(OBJC)
enable_language(OBJCXX)
endif()
include(MujocoOptions)
include(MujocoMacOS)
include(MujocoDependencies)
set(MUJOCO_HEADERS
include/mujoco/mjdata.h
include/mujoco/mjexport.h
include/mujoco/mjmodel.h
include/mujoco/mjrender.h
include/mujoco/mjtnum.h
include/mujoco/mjui.h
include/mujoco/mjvisualize.h
include/mujoco/mjxmacro.h
include/mujoco/mujoco.h
)
add_library(mujoco SHARED)
target_include_directories(
mujoco
PUBLIC $
$
PRIVATE src
)
add_subdirectory(src/engine)
add_subdirectory(src/user)
add_subdirectory(src/xml)
add_subdirectory(src/render)
add_subdirectory(src/ui)
target_compile_definitions(mujoco PRIVATE _GNU_SOURCE CCD_STATIC_DEFINE MUJOCO_DLL_EXPORTS)
if(MUJOCO_ENABLE_AVX_INTRINSICS)
target_compile_definitions(mujoco PUBLIC mjUSEPLATFORMSIMD)
endif()
target_compile_options(
mujoco
PRIVATE ${AVX_COMPILE_OPTIONS}
${MUJOCO_MACOS_COMPILE_OPTIONS}
${EXTRA_COMPILE_OPTIONS}
${MUJOCO_CXX_FLAGS}
)
target_link_options(
mujoco
PRIVATE
${MUJOCO_MACOS_LINK_OPTIONS}
${EXTRA_LINK_OPTIONS}
)
target_link_libraries(
mujoco
PRIVATE ccd
lodepng
qhullstatic_r
tinyobjloader
tinyxml2
)
set_target_properties(
mujoco PROPERTIES VERSION "${mujoco_VERSION}" PUBLIC_HEADER "${MUJOCO_HEADERS}"
)
# CMake's built-in FRAMEWORK option doesn't give us control over the dylib name inside the
# Framework. We instead make our own Framework here.
if(APPLE AND MUJOCO_BUILD_MACOS_FRAMEWORKS)
set(TAPI
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi"
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/dist/Info.plist.framework.in
${CMAKE_CURRENT_SOURCE_DIR}/dist/Info.framework.plist
)
set_target_properties(
mujoco
PROPERTIES LIBRARY_OUTPUT_DIRECTORY
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/mujoco.framework/Versions/A"
BUILD_WITH_INSTALL_NAME_DIR TRUE
INSTALL_NAME_DIR "@rpath/mujoco.framework/Versions/A"
)
add_custom_command(
TARGET mujoco
POST_BUILD
COMMAND mkdir -p $/Headers
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && cp ${MUJOCO_HEADERS} $/Headers
COMMAND mkdir -p $/Modules
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/dist/module.modulemap $/Modules
COMMAND mkdir -p $/Resources
COMMAND mv ${CMAKE_CURRENT_SOURCE_DIR}/dist/Info.framework.plist
$/Resources/Info.plist
COMMAND ${TAPI} stubify $ -o $/mujoco.tbd
COMMAND ln -fhs A $/../Current
COMMAND ln -fhs Versions/Current/mujoco.tbd $/../../mujoco.tbd
COMMAND ln -fhs Versions/Current/Headers $/../../Headers
COMMAND ln -fhs Versions/Current/Modules $/../../Modules
COMMAND ln -fhs Versions/Current/Resources $/../../Resources
COMMAND_EXPAND_LISTS
)
endif()
# Add a namespace alias to mujoco to be used by the examples.
# This simulates the install interface when building with sources.
add_library(mujoco::mujoco ALIAS mujoco)
add_subdirectory(model)
# `simulate` defines a macro, embed_in_bundle, that's used by `sample`, so that
# subdirectory needs to be added first.
# TODO: Remove this order dependency.
if(MUJOCO_BUILD_SIMULATE)
add_subdirectory(simulate)
endif()
if(MUJOCO_BUILD_EXAMPLES)
add_subdirectory(sample)
endif()
if(BUILD_TESTING AND MUJOCO_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
if(MUJOCO_TEST_PYTHON_UTIL)
add_subdirectory(python/mujoco/util)
endif()
endif()
if(NOT (APPLE AND MUJOCO_BUILD_MACOS_FRAMEWORKS))
# Install the libraries.
install(
TARGETS mujoco
EXPORT ${PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT dev
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/mujoco" COMPONENT dev
)
set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
# Generate and install the mujocoTargets.cmake file. This defines the targets as
# IMPORTED libraries for downstream users.
install(
EXPORT ${PROJECT_NAME}
DESTINATION ${CONFIG_PACKAGE_LOCATION}
NAMESPACE mujoco::
FILE "${PROJECT_NAME}Targets.cmake"
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${mujoco_VERSION}
COMPATIBILITY AnyNewerVersion
)
configure_package_config_file(
cmake/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
# Install also models into share folder.
install(
DIRECTORY model
DESTINATION "${CMAKE_INSTALL_DATADIR}/mujoco"
PATTERN "CMakeLists.txt" EXCLUDE
)
endif()
mujoco-2.2.2/CONTRIBUTING.md 0000664 0000000 0000000 00000007743 14306105762 0015261 0 ustar 00root root 0000000 0000000 # Contributing to MuJoCo
We intend for MuJoCo to be a true community-driven project and look forward to
accepting your contributions!
## Before you contribute
### Documentation, forums
Please read MuJoCo's [documentation](https://mujoco.readthedocs.io) and look
through current topics on our GitHub
[issues](https://github.com/deepmind/mujoco/issues) and
[discussions](https://github.com/deepmind/mujoco/discussions) pages.
### Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License
Agreement (CLA). You (or your employer) retain the copyright to your
contribution; this simply gives us permission to use and redistribute your
contributions as part of the project. Head over to
to see your current agreements on file or
to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
## Contributing
### Reporting bugs
How to submit a good bug report:
- Use a clear and descriptive title.
- Make it easy to reproduce the problem. If this requires a model, attach it as
a zip file to the bug report. The model and steps required to reproduce the
proplem should be *minimal*, in the sense that irrelevant parts are
removed.
- Clearly state what is the expected behavior.
- Include an illustrative screenshot, if relevant.
Try to provide context:
- If the problem is new, see if you can reproduce it in an older version.
What's the most recent version in which the problem doesn't happen?
- Can you reproduce the problem on multiple platforms?
### Suggesting enhancements
Before submitting an enhancement suggestion:
- Check if you're using the [latest
version](https://github.com/deepmind/mujoco/releases/latest) of MuJoCo.
- Perform a quick [search](https://github.com/deepmind/mujoco/issues) to see if
the enhancement has already been suggested. If it has, add a comment to the
existing issue instead of opening a new one.
How to submit a good enhacement suggestion:
- Use a clear and descriptive title.
- Describe the current behaviour and the behavior which you hope to see instead.
- Explain why this enhancement would be useful.
- Specify the version of MuJoCo and platform/OS you are using.
### Contributing code
- Except for small and straightforward bugfixes, please get in touch with us
before you start working on a contribution so that we can help and possibly
guide you. Coordinating up front makes it much easier to avoid frustration later
on.
- All submissions require review. Please use GitHub pull requests for this
purpose. Please consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on pull requests.
- Write tests. MuJoCo uses [googletest](https://github.com/google/googletest)
for C++ tests, [absltest](https://abseil.io/docs/python/guides/testing) for
Python binding code and [nunit](https://nunit.org/) for C# code in the Unity
plugin. In most cases, a pull request will only be accepted if it includes
tests. MuJoCo's internal codebase is currently lacking in test coverage. If you
want to modify a function that isn't covered by tests, you'll be expected to
contribute tests for the existing functionality, not just your modification. In
fact, writing a test for existing code is a great way to get started with
contributions.
- Resolve compiler warnings.
- All existing tests must pass.
- Follow the [Style Guide](./STYLEGUIDE.md). In particular, adequately comment
your code.
- Make small pull requests. We will likely ask you to split up a large pull
request into self-contained, smaller ones, especially if the PR is trying to
achieve multiple things.
- Respond to reviewers. Please be responsive to any questions and comments.
Once you have met all the requirements, your code will be merged.
Thanks for improving MuJoCo!
### Community guidelines
This project follows Google's
[Open Source Community Guidelines](https://opensource.google/conduct/).
mujoco-2.2.2/LICENSE 0000664 0000000 0000000 00000026136 14306105762 0014032 0 ustar 00root root 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
mujoco-2.2.2/README.md 0000664 0000000 0000000 00000021272 14306105762 0014300 0 ustar 00root root 0000000 0000000 # MuJoCo Physics
**MuJoCo** stands for **Mu**lti-**Jo**int dynamics with **Co**ntact. It is a
general purpose physics engine that aims to facilitate research and development
in robotics, biomechanics, graphics and animation, machine learning, and other
areas which demand fast and accurate simulation of articulated structures
interacting with their environment.
This repository is maintained by DeepMind, please see our [acquisition] and
[open sourcing] announcements.
MuJoCo has a C API and is intended for researchers and developers. The runtime
simulation module is tuned to maximize performance and operates on low-level
data structures that are preallocated by the built-in XML compiler. The library
includes interactive visualization with a native GUI, rendered in OpenGL. MuJoCo
further exposes a large number of utility functions for computing physics-related
quantities. We also provide Python bindings and a plug-in for the [Unity]
game engine.
## Installation
### Prebuilt binaries
Versioned releases are available as precompiled binaries from the GitHub
[releases page], built for Linux (x86-64 and AArch64), Windows (x86-64 only),
and macOS (universal). This is the recommended way to use the software.
### Building from source
Users who wish to build MuJoCo from source should consult the [build from
source] section of the documentation. However, please note that the commit at
the tip of the `main` branch may be unstable.
### Python (>= 3.7)
The native Python bindings, which come pre-packaged with a copy of MuJoCo, can
be installed from [PyPI] via:
```bash
pip install mujoco
```
Note that Pre-built Linux wheels target `manylinux2014`, see
[here](https://github.com/pypa/manylinux) for compatible distributions. For more
information such as building the bindings from source, see the [Python Bindings]
section of the documentation.
## Documentation
MuJoCo's documentation is available at [mujoco.readthedocs.io], which serves
webpages derived from the [documentation source files].
## Getting Started
There are two easy ways to get started with MuJoCo:
1. **Run `simulate` on your machine.**
[This video](https://www.youtube.com/watch?v=0ORsj_E17B0) shows a screen capture
of `simulate`, MuJoCo's native interactive viewer. Follow the steps described in
the [Getting Started] section of the documentation to get `simulate` running on
your machine.
2. **Explore our online IPython notebooks.**
If you are a Python user, you might want to start with our tutorial notebooks,
running on Google Colab:
- The first tutorial focuses on the basic MuJoCo Python bindings: [](https://colab.research.google.com/github/deepmind/dm_control/blob/main/dm_control/mujoco/tutorial.ipynb)
- The second tutorial includes more examples of `dm_control`-specific functionality: [](https://colab.research.google.com/github/deepmind/dm_control/blob/main/tutorial.ipynb)
## Asking Questions
We welcome community engagement: questions, requests for help, bug reports and
feature requests. To read more about bug reports, feature requests and more
ambitious contributions, please see our [contributors guide](CONTRIBUTING.md).
Questions and requests for help are welcome on the
GitHub [issues](https://github.com/deepmind/mujoco/issues) and
[discussions](https://github.com/deepmind/mujoco/discussions) pages. Issues
should be focused on a specific problem or question, while discussions should
address wider concerns that might require input from multiple participants.
Here are some guidelines for asking good questions:
1. Search for existing questions or issues that touch on the same subject.
You can add comments to existing threads or start new ones. If you start a
new thread and there are existing relevant threads, please link to them.
2. Use a clear and specific title. Try to include keywords that will make your
question easy for other to find in the future.
3. Introduce yourself and your project more generally.
If your level of expertise is exceptional (either high or low), and it might
be relevant to what we can assume you know, please state that as well.
4. Take a step back and tell us what you're trying to accomplish, if we
understand you goal we might suggest a different type of solution than the
one you are having problems with
5. Make it easy for others to reproduce the problem or understand your question.
If this requires a model, please include it. Try to make the model minimal:
remove elements that are unrelated to your question. Pure XML models should
be inlined. Models requiring binary assets (meshes, textures), should be
attached as a `.zip` file. Please make sure the included model is loadable
before you attach it.
6. Include an illustrative screenshot or video, if relevant.
7. Tell us how you are accessing MuJoCo (C API, Python bindings, etc.) and which
MuJoCo version and operating system you are using.
## Related software
MuJoCo forms the backbone of many environment packages, but these are too many
to list here individually. Below we focus on bindings and converters.
### Bindings
These packages give users of various languages access to MuJoCo functionality:
#### First-party bindings
- [Python bindings](https://mujoco.readthedocs.io/en/latest/python.html)
- [dm_control](https://github.com/deepmind/dm_control), DeepMind's related
environment stack, includes [PyMJCF](https://github.com/deepmind/dm_control/blob/main/dm_control/mjcf/README.md),
a module for procedural manipulation of MuJoCo models.
- [C# bindings and Unity plug-in](https://mujoco.readthedocs.io/en/latest/unity.html)
#### Third-party bindings
- **Swift**: [swift-mujoco](https://github.com/liuliu/swift-mujoco)
- **Java**: [mujoco-java](https://github.com/CommonWealthRobotics/mujoco-java)
- **Python**: [mujoco-py](https://github.com/openai/mujoco-py) (unmaintained)
- **Julia**: [Lyceum](https://github.com/Lyceum/MuJoCo.jl) (unmaintained)
### Converters
- **OpenSim**: [O2MConverter](https://github.com/aikkala/O2MConverter) converts
openSIM models to MJCF.
- **SDFormat**: [gz-mujoco](https://github.com/gazebosim/gz-mujoco/) is a
two-way SDFormat <-> MJCF conversion tool.
- **OBJ**: [obj2mjcf](https://github.com/kevinzakka/obj2mjcf)
a script for converting composite OBJ files into a loadable MJCF model.
## Citation
If you use MuJoCo for published research, please cite:
```
@inproceedings{todorov2012mujoco,
title={MuJoCo: A physics engine for model-based control},
author={Todorov, Emanuel and Erez, Tom and Tassa, Yuval},
booktitle={2012 IEEE/RSJ International Conference on Intelligent Robots and Systems},
pages={5026--5033},
year={2012},
organization={IEEE},
doi={10.1109/IROS.2012.6386109}
}
```
## License and Disclaimer
Copyright 2021 DeepMind Technologies Limited.
Box collision code ([`engine_collision_box.c`](https://github.com/deepmind/mujoco/tree/main/src/engine/engine_collision_box.c))
is Copyright 2016 Svetoslav Kolev.
ReStructuredText documents, images, and videos in the `doc` directory are made
available under the terms of the Creative Commons Attribution 4.0 (CC BY 4.0)
license. You may obtain a copy of the License at
https://creativecommons.org/licenses/by/4.0/legalcode.
Source code is licensed under the Apache License, Version 2.0. You may obtain a
copy of the License at https://www.apache.org/licenses/LICENSE-2.0.
This is not an officially supported Google product.
[build from source]: https://mujoco.readthedocs.io/en/latest/programming.html#building-mujoco-from-source
[Getting Started]: https://mujoco.readthedocs.io/en/latest/programming.html#getting-started
[acquisition]: https://www.deepmind.com/blog/opening-up-a-physics-simulator-for-robotics
[open sourcing]: https://www.deepmind.com/blog/open-sourcing-mujoco
[Unity]: https://unity.com/
[releases page]: https://github.com/deepmind/mujoco/releases
[GitHub Issues]: https://github.com/deepmind/mujoco/issues
[documentation source files]: https://github.com/deepmind/mujoco/tree/main/doc
[mujoco.readthedocs.io]: https://mujoco.readthedocs.io
[Python Bindings]: https://mujoco.readthedocs.io/en/latest/python.html#python-bindings
[PyPI]: https://pypi.org/project/mujoco/
mujoco-2.2.2/SECURITY.md 0000664 0000000 0000000 00000000453 14306105762 0014610 0 ustar 00root root 0000000 0000000 To report a security issue, please use [https://g.co/vulnz](https://g.co/vulnz).
We use g.co/vulnz for our intake, and do coordination and disclosure here on
GitHub (including using GitHub Security Advisory). The Google Security Team will
respond within 5 working days of your report on g.co/vulnz.
mujoco-2.2.2/STYLEGUIDE.md 0000664 0000000 0000000 00000013640 14306105762 0015021 0 ustar 00root root 0000000 0000000 # MuJoCo Style Guide
The MuJoCo codebase follows an internally consistent style that values
compactness and readability. Please try to follow the style guide as closely as
possible in your code contributions.
### Scope of this guide
MuJoCo has three main code categories:
1. **C code:** MuJoCo's core codebase. It consists of public headers under
`include/` and C source files and internal headers under `src/`. This style
guide primarily concerns itself with this category.
2. **Legacy C++:** Files under `src/user/` and `src/xml/`. These do not
necessarily follow best C++ practices. We intend to gradually replace these with
new code that follows the [Google C++
style](https://google.github.io/styleguide/cppguide.html) over time.
3. **New code:** This includes C++ files under `test/` and `python/` and C#
files under `unity/`. Added by DeepMind engineers, this code adheres to the
[Google style](https://google.github.io/styleguide/).
### General principles
Where any aspect of coding style is not explicitly spelled out in this guide,
the following principle is followed:
| Maximise consistency with the rest of the code. |
| --- |
If there is a contradiction between this guide and existing code, the guide
takes precedence. Additional principles include:
- Follow the [naming conventions](https://mujoco.readthedocs.io/en/latest/programming.html#naming-convention).
- Be sparing with horizontal space: Try to keep lines short, avoid line-breaks
where possble.
- Be generous with vertical space: Empty lines between code blocks are good.
- Keep names short.
- Inline comments are part of the code, treat them as such.
- Use American English in comments and documentation.
### Specific rules for C code
Over time, this style guide will be expanded to cover most aspects of C
programming in the MuJoCo codebase. In the meantime, it is usually enough to
inspect existing code and try to follow its example.
If there are any consistent coding patterns that are specific to the MuJoCo
codebase but aren't mentioned in the guide, the guide should be expanded. If you
spot such a pattern, feel free to send a PR to update the guide.
#### Indentation
2-space indents, using space characters rather than tabs.
#### Line length
Line length is 100 characters. In rare situations, like the collision table at
the top of
[engine_collision_driver.c](https://github.com/deepmind/mujoco/blob/c8ff7b3d341560e8cc33fbdcaffbcdbc4c32327c/src/engine/engine_collision_driver.c#L36),
longer lines are alowed for readability.
#### Comments
MuJoCo makes generous use of short, one-line comments describing the code block
just below them. They are considered an essential part of the code. Comments
should be:
- As succinct as possible, while maintaining clarity.
- Preceded by an empty line, unless at the top of a block.
- Uncapitalized and not terminated by a full-stop.
A helpful heuristic regarding in-code comments is that the reader should be able
to get a sense of what is happening in a function just by reading the comments.
An exception to the third bullet point above are function declaration comments
in public header files which are considered to be docstrings rather than code
and are therefore capitalized and terminated by a full stop. These docstrings
are required.
#### Braces
- MuJoCo uses
[attached K&R braces](https://en.wikipedia.org/wiki/Indentation_style#Variant:_mandatory_braces),
including for one-line blocks:
```C
// transpose matrix
void mju_transpose(mjtNum* res, const mjtNum* mat, int nr, int nc) {
for (int i=0; i