newton-physics/newton

GitHub: newton-physics/newton

Newton 是基于 NVIDIA Warp 构建的 GPU 加速物理仿真引擎,专为机器人学家和仿真研究人员提供高性能、可微分的机器人与多物理场仿真能力。

Stars: 3517 | Forks: 360

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/newton-physics/newton/main) [![codecov](https://codecov.io/gh/newton-physics/newton/graph/badge.svg?token=V6ZXNPAWVG)](https://codecov.io/gh/newton-physics/newton) [![Push - AWS GPU](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/3679169be8132548.svg)](https://github.com/newton-physics/newton/actions/workflows/push_aws_gpu.yml) # Newton Newton 是一个基于 [NVIDIA Warp](https://github.com/NVIDIA/warp) 构建的 GPU 加速物理模拟引擎,专为机器人学家和模拟研究人员设计。 Newton 扩展并泛化了 Warp 的([已弃用](https://github.com/NVIDIA/warp/discussions/735))`warp.sim` 模块,并集成了 [MuJoCo Warp](https://github.com/google-deepmind/mujoco_warp) 作为其主要后端。Newton 强调 GPU 计算、[OpenUSD](https://openusd.org/) 支持、可微性和用户定义的可扩展性,从而促进快速迭代和可扩展的机器人模拟。 Newton 是一个 [Linux Foundation](https://www.linuxfoundation.org/) 项目,由社区构建和维护。代码根据 [Apache-2.0](https://github.com/newton-physics/newton/blob/main/LICENSE.md) 授权。文档根据 [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) 授权。额外的第三方许可证文本可在 [`newton/licenses`](https://github.com/newton-physics/newton/tree/main/newton/licenses) 中找到。 Newton 由 [Disney Research](https://www.disneyresearch.com/)、[Google DeepMind](https://deepmind.google/) 和 [NVIDIA](https://www.nvidia.com/) 发起。 ## 系统要求 - **Python** 3.10+ - **操作系统:** Linux (x86-64, aarch64), Windows (x86-64), 或 macOS (仅限 CPU) - **GPU:** NVIDIA GPU (Maxwell 或更新版本),驱动版本 545 或更新 (CUDA 12)。无需安装本地 CUDA Toolkit。macOS 在 CPU 上运行。 有关详细的系统要求和经过测试的配置,请参阅 [安装指南](https://newton-physics.github.io/newton/latest/guide/installation.html)。 ## 快速开始 ``` pip install "newton[examples]" python -m newton.examples basic_pendulum ``` 要使用 [uv](https://docs.astral.sh/uv/) 从源代码安装,请参阅 [安装指南](https://newton-physics.github.io/newton/latest/guide/installation.html)。 ## 示例 在运行以下示例之前,请安装包含示例额外组件的 Newton: ``` pip install "newton[examples]" ``` 如果您是使用 uv 从源代码安装的,请在以下命令中将 `python` 替换为 `uv run`。

Basic Examples

Pendulum URDF Viewer
python -m newton.examples basic_pendulum python -m newton.examples basic_urdf python -m newton.examples basic_viewer
Shapes Joints Conveyor
python -m newton.examples basic_shapes python -m newton.examples basic_joints python -m newton.examples basic_conveyor
Heightfield Recording Replay Viewer
python -m newton.examples basic_heightfield python -m newton.examples recording python -m newton.examples replay_viewer
Plotting
python -m newton.examples basic_plotting

Robot Examples

Cartpole G1 H1
python -m newton.examples robot_cartpole python -m newton.examples robot_g1 python -m newton.examples robot_h1
Anymal D Anymal C Walk
python -m newton.examples robot_anymal_d python -m newton.examples robot_anymal_c_walk
Policy UR10 Panda Hydro
python -m newton.examples robot_policy python -m newton.examples robot_ur10 python -m newton.examples robot_panda_hydro
Allegro Hand
python -m newton.examples robot_allegro_hand

Cable Examples

Cable Twist Cable Y-Junction Cable Bundle Hysteresis
python -m newton.examples cable_twist python -m newton.examples cable_y_junction python -m newton.examples cable_bundle_hysteresis
Cable Pile
python -m newton.examples cable_pile

Cloth Examples

Cloth Bending Cloth Hanging Cloth Style3D
python -m newton.examples cloth_bending python -m newton.examples cloth_hanging python -m newton.examples cloth_style3d
Cloth H1 Cloth Twist Cloth Franka
python -m newton.examples cloth_h1 python -m newton.examples cloth_twist python -m newton.examples cloth_franka
Cloth Rollers Cloth Poker Cards
python -m newton.examples cloth_rollers python -m newton.examples cloth_poker_cards

Inverse Kinematics Examples

IK Franka IK H1 IK Custom
python -m newton.examples ik_franka python -m newton.examples ik_h1 python -m newton.examples ik_custom
IK Cube Stacking
python -m newton.examples ik_cube_stacking

MPM Examples

MPM Granular MPM Anymal MPM Two-Way Coupling
python -m newton.examples mpm_granular python -m newton.examples mpm_anymal python -m newton.examples mpm_twoway_coupling
MPM Grain Rendering MPM Multi Material
python -m newton.examples mpm_grain_rendering python -m newton.examples mpm_multi_material

Sensor Examples

Sensor Contact Sensor Tiled Camera Sensor IMU
python -m newton.examples sensor_contact python -m newton.examples sensor_tiled_camera python -m newton.examples sensor_imu

Selection Examples

Selection Cartpole Selection Materials Selection Articulations
python -m newton.examples selection_cartpole python -m newton.examples selection_materials python -m newton.examples selection_articulations
Selection Multiple
python -m newton.examples selection_multiple

DiffSim Examples

DiffSim Ball DiffSim Cloth DiffSim Drone
python -m newton.examples diffsim_ball python -m newton.examples diffsim_cloth python -m newton.examples diffsim_drone
DiffSim Spring Cage DiffSim Soft Body DiffSim Quadruped
python -m newton.examples diffsim_spring_cage python -m newton.examples diffsim_soft_body python -m newton.examples diffsim_bear

Multi-Physics Examples

Softbody Gift Softbody Dropping to Cloth
python -m newton.examples softbody_gift python -m newton.examples softbody_dropping_to_cloth

Contacts Examples

Nut Bolt Hydro Nut Bolt SDF Brick Stacking
python -m newton.examples nut_bolt_hydro python -m newton.examples nut_bolt_sdf python -m newton.examples brick_stacking
Pyramid
python -m newton.examples pyramid

Softbody Examples

Softbody Hanging Softbody Franka
python -m newton.examples softbody_hanging python -m newton.examples softbody_franka
### 示例选项 这些示例支持以下命令行参数: | 参数 | 描述 | 默认值 | | --------------- | --------------------------------------------------------------------------------------------------- | ---------------------------- | | `--viewer` | 查看器类型:`gl` (OpenGL 窗口), `usd` (USD 文件输出), `rerun` (ReRun), 或 `null` (无查看器)。 | `gl` | | `--device` | 要使用的计算设备,例如 `cpu`, `cuda:0` 等。 | `None` (默认 Warp 设备) | | `--num-frames` | 要模拟的帧数(用于 USD 输出)。 | `100` | | `--output-path` | USD 文件的输出路径(如果使用 `--viewer usd` 则为必需)。 | `None` | 某些示例可能会添加额外的参数(有关详细信息,请参阅其各自的源文件)。 ### 示例用法 ``` # 列出可用示例 python -m newton.examples # 使用 USD viewer 运行并保存到 my_output.usd python -m newton.examples basic_viewer --viewer usd --output-path my_output.usd # 在选定设备上运行 python -m newton.examples basic_urdf --device cuda:0 # 组合选项 python -m newton.examples basic_viewer --viewer gl --num-frames 500 --device cpu ``` ## 贡献与开发 请参阅 [贡献指南](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md) 和 [开发指南](https://newton-physics.github.io/newton/latest/guide/development.html) 以获取有关如何为 Newton 做贡献的说明。 ## 支持与社区讨论 如有问题,请先查阅 [Newton 文档](https://newton-physics.github.io/newton/latest/guide/overview.html),然后再在 [主仓库发起讨论](https://github.com/newton-physics/newton/discussions)。 ## 行为准则 参与此社区即表示您同意遵守 Linux Foundation [行为准则](https://lfprojects.org/policies/code-of-conduct/)。 ## 项目治理、法律与成员 请参阅 [newton-governance 仓库](https://github.com/newton-physics/newton-governance) 以获取有关项目治理的更多信息。
标签:Apache 2.0, CUDA, Disney Research, Google DeepMind, Linux基金会, MuJoCo, NVIDIA Warp, OpenUSD, Python, Vectored Exception Handling, 仿真, 仿真引擎, 动画, 可微分物理, 开源, 强化学习, 数字孪生, 无后门, 机器人, 机器人学, 游戏开发, 物理仿真引擎, 物理引擎, 研究工具, 科学计算, 虚拟现实, 计算机图形学, 逆向工具, 高性能计算