Files
Mujoco_WASM/README.md
T
chenlin b45b15d153
build / setup (compute matrix) (push) Has been cancelled
build / ${{ matrix.label }} (push) Has been cancelled
build / macos-15-arm64-studio (push) Has been cancelled
build / ubuntu-24.04-clang-18-studio (push) Has been cancelled
build / ubuntu-24.04-gcc-14-studio (push) Has been cancelled
build / windows-2025-ninja-studio (push) Has been cancelled
build / ubuntu-24.04-clang-18-wasm (push) Has been cancelled
build / ubuntu-24.04-clang-18-mjx (push) Has been cancelled
add chinese
2026-08-19 17:14:37 +08:00

156 lines
9.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<h1>
<a href="#"><img alt="MuJoCo" src="banner.png" width="100%"/></a>
</h1>
<p>
<a href="https://github.com/google-deepmind/mujoco/actions/workflows/build.yml?query=branch%3Amain" alt="GitHub Actions">
<img src="https://img.shields.io/github/actions/workflow/status/google-deepmind/mujoco/build.yml?branch=main">
</a>
<a href="https://mujoco.readthedocs.io/" alt="Documentation">
<img src="https://readthedocs.org/projects/mujoco/badge/?version=latest">
</a>
<a href="https://github.com/google-deepmind/mujoco/blob/main/LICENSE" alt="License">
<img src="https://img.shields.io/github/license/google-deepmind/mujoco">
</a>
</p>
**MuJoCo** 是 **Mu**lti-**Jo**int dynamics with **Co**ntact(带接触的多关节动力学)的缩写。它是一款通用物理引擎,旨在促进机器人学、生物力学、图形与动画、机器学习以及其他需要对与环境交互的多关节结构进行快速且精确仿真的领域的研究与开发。
本项目由 [Google DeepMind](https://www.deepmind.com/) 维护。
MuJoCo 提供 C API,面向研究人员和开发者。其实时仿真模块经过专门调优以实现极致性能,并运行在由内置 XML 编译器预先分配的底层数据结构之上。该库包含使用 OpenGL 渲染的原生 GUI 交互式可视化工具。MuJoCo 还提供了大量用于计算物理相关物理量的实用函数。
我们还提供了 [Python 绑定][Python bindings] 以及用于 [Unity] 游戏引擎的插件。
## 文档
MuJoCo 的文档可在 [mujoco.readthedocs.io] 查阅。下一个版本即将推出的新特性可以在 “latest” 分支的[更新日志][changelog]中找到。
## 快速入门
快速上手 MuJoCo 有两种简便途径:
1. **在本地运行 `simulate`。**
[此视频](https://www.youtube.com/watch?v=P83tKA1iz2Y)展示了 MuJoCo 原生交互式查看器 `simulate` 的录屏。请按照文档中的[快速入门][Getting Started]部分描述的步骤在您的机器上运行 `simulate`
2. **探索在线 IPython Notebook 教程。**
如果您是 Python 用户,建议从运行在 Google Colab 上的教程 Notebook 开始:
- **入门**教程讲解 MuJoCo 基础知识:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/python/tutorial.ipynb)
- **模型编辑**教程演示如何通过代码程序化创建和编辑模型:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/python/mjspec.ipynb)
- **rollout** 教程介绍如何使用多线程 `rollout` 模块:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/python/rollout.ipynb)
- **LQR** 教程演示如何合成线性二次型控制器(LQR),实现人形机器人单腿平衡:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/python/LQR.ipynb)
- **最小二乘法**教程解释如何使用基于 Python 的非线性最小二乘求解器:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/python/least_squares.ipynb)
- **MJX** 教程提供了 [MuJoCo XLA](https://mujoco.readthedocs.io/en/stable/mjx.html) 的使用示例,它是用 JAX 编写的 MuJoCo 分支版本:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/mjx/tutorial.ipynb)
- **可微物理**教程展示如何利用从 MuJoCo 物理计算步中自动推导出的解析梯度来训练运动控制策略:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/mjx/training_apg.ipynb)
## 安装
### 预编译二进制文件
带有版本号的正式发行版预编译二进制文件可在 GitHub [发布页面][releases page] 获取,支持 Linuxx86-64 和 AArch64)、Windows(仅限 x86-64)和 macOS(通用架构)。这是使用本软件的推荐方式。
### 从源码构建
希望从源码构建 MuJoCo 的用户请参阅文档中的[从源码构建][build from source]部分。但请注意,`main` 分支最新的提交可能不够稳定。
### Python (>= 3.10)
原生 Python 绑定已预打包了 MuJoCo 副本,可以通过 [PyPI] 进行安装:
```bash
pip install mujoco
```
请注意,预构建的 Linux wheel 面向 `manylinux2014`,兼容的发行版参见[此处](https://github.com/pypa/manylinux)。有关从源码构建绑定等更多信息,请参阅文档中的 [Python 绑定][Python bindings]部分。
## 版本规范
我们力求在每月的首周发布新版本 MuJoCo。自 3.5.0 版本起,我们的版本命名规范变更为修订版语义化版本控制(modified Semantic Versioning),详情请参阅 [版本规范](VERSIONING.md)。
## 参与贡献
我们非常欢迎社区参与:包括提问、寻求帮助、错误报告以及功能建议。欲了解更多有关提交 Bug 报告、功能需求以及更深入贡献的指引,请参阅我们的[贡献指南](CONTRIBUTING.md)和[代码风格指南](STYLEGUIDE.md)。
## 提问与交流
欢迎在 GitHub 的 [“Asking for Help” 讨论区](https://github.com/google-deepmind/mujoco/discussions/categories/asking-for-help) 提出问题或寻求帮助,请尽量聚焦于具体的问题或疑问。
## 错误报告与功能需求
GitHub [Issues](https://github.com/google-deepmind/mujoco/issues) 仅用于提交 Bug 报告、功能需求以及其他与开发相关的主题。
## 相关软件生态
MuJoCo 是许多仿真环境软件包的核心支撑。下面列出了一些语言绑定与格式转换器。
### 语言绑定
这些软件包为不同编程语言的用户提供了访问 MuJoCo 功能的接口:
#### 第一方绑定:
- [Python 绑定](https://mujoco.readthedocs.io/en/stable/python.html)
- [dm_control](https://github.com/google-deepmind/dm_control)Google DeepMind 的相关环境技术栈,包含了用于程序化操作 MuJoCo 模型的模块 [PyMJCF](https://github.com/google-deepmind/dm_control/blob/main/dm_control/mjcf/README.md)。
- [JavaScript 绑定与 WebAssembly 支持](/wasm/README.md)(灵感源于 [stillonearth](https://github.com/stillonearth) 和 [zalo](https://github.com/zalo) 的社区项目;[mjswan](https://github.com/ttktjmt/mjswan) 扩展了其实时策略控制、交互式施力等功能)。
- [C# 绑定与 Unity 插件](https://mujoco.readthedocs.io/en/stable/unity.html)
#### 第三方绑定:
- **MATLAB Simulink**: [Simulink Blockset for MuJoCo Simulator](https://github.com/mathworks-robotics/mujoco-simulink-blockset)(由 [Manoj Velmurugan](https://github.com/vmanoj1996) 开发)。
- **Swift**: [swift-mujoco](https://github.com/liuliu/swift-mujoco)
- **Java**: [mujoco-java](https://github.com/CommonWealthRobotics/mujoco-java)
- **Julia**: [MuJoCo.jl](https://github.com/JamieMair/MuJoCo.jl)
- **Rust**: [MuJoCo-rs](https://github.com/davidhozic/mujoco-rs)
### 格式转换工具
- **OpenSim**: [MyoConverter](https://github.com/MyoHub/myoconverter) 将 OpenSim 模型转换为 MJCF。
- **SDFormat**: [gz-mujoco](https://github.com/gazebosim/gz-mujoco/) 是 SDFormat 与 MJCF 之间的双向转换工具。
- **OBJ**: [obj2mjcf](https://github.com/kevinzakka/obj2mjcf) 用于将组合 OBJ 文件转换为可加载的 MJCF 模型的脚本。
- **onshape**: [Onshape to Robot](https://github.com/rhoban/onshape-to-robot) 将 [onshape](https://www.onshape.com/en/) CAD 装配体转换为 MJCF。
## 引用
如果您在公开发表的学术研究中使用了 MuJoCo,请按如下格式引用:
```
@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}
}
```
## 开源许可证与免责声明
Copyright 2021 DeepMind Technologies Limited.
盒体碰撞检测代码([`engine_collision_box.c`](https://github.com/google-deepmind/mujoco/blob/main/src/engine/engine_collision_box.c))版权所有 © 2016 Svetoslav Kolev。
`doc` 目录下的 ReStructuredText 文档、图像和视频均依据知识共享署名 4.0 国际许可协议(Creative Commons Attribution 4.0, CC BY 4.0)提供。您可在 https://creativecommons.org/licenses/by/4.0/legalcode 获取该许可证副本。
源代码基于 Apache 许可证 2.0 版(Apache License, Version 2.0)授权。您可在 https://www.apache.org/licenses/LICENSE-2.0 获取许可证副本。
本项目不是 Google 官方支持的产品。
[build from source]: https://mujoco.readthedocs.io/en/latest/programming#building-from-source
[Getting Started]: https://mujoco.readthedocs.io/en/latest/programming#getting-started
[Unity]: https://unity.com/
[releases page]: https://github.com/google-deepmind/mujoco/releases
[mujoco.readthedocs.io]: https://mujoco.readthedocs.io
[changelog]: https://mujoco.readthedocs.io/en/latest/changelog.html
[Python bindings]: https://mujoco.readthedocs.io/en/stable/python.html#python-bindings
[PyPI]: https://pypi.org/project/mujoco/