懂得生命真谛的人,可以使短促的生命延长。 —— 西塞罗

License
GitHub commit activity
codecov
Push - AWS GPU

Newton

如果说物理世界是一场永不停歇的演出,那么 Newton 就是后台那位“偏执的舞台监督”:
他不满足于让东西动起来——他要你在 GPU 上动得更快、更大、更可微、还最好能把这一切搬进 OpenUSD 的舞台布景里,随时切换视角、录制、重放、甚至把力学过程拿去做研究。

仓库的自我介绍很硬核,也很明确:

Newton is a GPU-accelerated physics simulation engine built upon NVIDIA Warp, specifically targeting roboticists and simulation researchers.

而它的 GitHub description 又把这句话换成更正式的口吻再强调一次:

An open-source, GPU-accelerated physics simulation engine built upon NVIDIA Warp, specifically targeting roboticists and simulation researchers.

Newton 的语气像是在说:
“机器人学、仿真研究的朋友们,我来让你们跑得更快、算得更准、试得更猛。”


Newton 从哪里来:从 Warp 的肩膀上站起来,再把路铺得更宽

Newton 自己讲得很坦诚:

  • extends and generalizes Warp 的(已被标注为 deprecated 的)warp.sim 模块
  • 并把 MuJoCo Warp 作为 primary backend
  • 强调的关键词是:
    • GPU-based computation
    • OpenUSD support
    • differentiability
    • user-defined extensibility
    • rapid iteration
    • scalable robotics simulation

它不像一个只会“跑 demo”的引擎,更像一个会自我进化的“研究型底座”:
你可以在它上面快速迭代实验,也可以把它扩展成你自己的研究工具链。


一个很重要的身份:Linux Foundation 项目,社区维护

Newton 还有一个很“稳”的身份牌:

  • 它是 Linux Foundation 项目
  • community-built and maintained
  • Code:Apache-2.0
  • Documentation:CC-BY-4.0
  • 第三方 license 文本在 newton/licenses

它像在说:
“我不是孤岛项目,我有治理与社区,我的许可也清清楚楚。”


发起者:不是“随便做做”,而是站在巨人肩上起跑

README 点名了它的起点:

  • Disney Research
  • Google DeepMind
  • NVIDIA

Newton 这时候像个谦逊又自信的新人:
“我出身很硬,但我想让更多人一起把这件事做大。”


Requirements:让 Newton 上场之前,你得给他一块够大的舞台

Newton 的要求写得非常具体:

  • Python 3.10+
  • OS: Linux(x86-64, aarch64)、Windows(x86-64)、macOS(仅 CPU)
  • GPU: NVIDIA GPU(Maxwell 或更新),driver 545+(CUDA 12)
    • 不需要本地 CUDA Toolkit
    • macOS 只能跑 CPU

更详细配置看安装指南:
https://newton-physics.github.io/newton/latest/guide/installation.html


Quickstart:两行命令,把物理世界点亮

Newton 的“开场白”很干脆:

1
2
pip install "newton[examples]"
python -m newton.examples basic_pendulum

如果你用 uv 从源码安装,README 还提醒你把 python 换成 uv run


Examples:它把一整个“实验展厅”摆在你面前

运行 examples 之前先装 extras:

1
pip install "newton[examples]"

然后你就可以开始逛展:
Newton 的 examples 被分成多个系列,像不同展厅:

  • Basic Examples
  • Robot Examples
  • Cable Examples
  • Cloth Examples
  • Inverse Kinematics Examples
  • MPM Examples
  • Sensor Examples
  • Selection Examples
  • DiffSim Examples
  • Multi-Physics Examples
  • Contacts Examples
  • Softbody Examples

它像个热情的讲解员:
“你想看摆锤?URDF?viewer?关节?传送带?电缆扭转?布料弯折?IK?MPM?传感器?可微仿真?多物理耦合?接触与软体?都在,都能跑。”

下面这些命令,都是它递给你的“门票”。


Basic Examples:从最基本的节奏开始

1
2
3
4
5
6
7
8
9
10
python -m newton.examples basic_pendulum
python -m newton.examples basic_urdf
python -m newton.examples basic_viewer
python -m newton.examples basic_shapes
python -m newton.examples basic_joints
python -m newton.examples basic_conveyor
python -m newton.examples basic_heightfield
python -m newton.examples recording
python -m newton.examples replay_viewer
python -m newton.examples basic_plotting

Robot Examples:让机器人在 GPU 上“更像真的”

1
2
3
4
5
6
7
8
9
python -m newton.examples robot_cartpole
python -m newton.examples robot_g1
python -m newton.examples robot_h1
python -m newton.examples robot_anymal_d
python -m newton.examples robot_anymal_c_walk
python -m newton.examples robot_policy
python -m newton.examples robot_ur10
python -m newton.examples robot_panda_hydro
python -m newton.examples robot_allegro_hand

Cable Examples:电缆与柔性结构的世界

1
2
3
4
python -m newton.examples cable_twist
python -m newton.examples cable_y_junction
python -m newton.examples cable_bundle_hysteresis
python -m newton.examples cable_pile

Cloth Examples:布料不只是布料,它是约束与接触的诗

1
2
3
4
5
6
7
8
python -m newton.examples cloth_bending
python -m newton.examples cloth_hanging
python -m newton.examples cloth_style3d
python -m newton.examples cloth_h1
python -m newton.examples cloth_twist
python -m newton.examples cloth_franka
python -m newton.examples cloth_rollers
python -m newton.examples cloth_poker_cards

Inverse Kinematics Examples:你给目标,它去找姿态

1
2
3
4
python -m newton.examples ik_franka
python -m newton.examples ik_h1
python -m newton.examples ik_custom
python -m newton.examples ik_cube_stacking

MPM Examples:粒子、材料与两向耦合

1
2
3
4
5
6
7
8
python -m newton.examples mpm_granular
python -m newton.examples mpm_anymal
python -m newton.examples mpm_twoway_coupling
python -m newton.examples mpm_grain_rendering
python -m newton.examples mpm_multi_material
python -m newton.examples mpm_viscous
python -m newton.examples mpm_beam_twist
python -m newton.examples mpm_snow_ball

Sensor Examples:让仿真“感知”起来

1
2
3
python -m newton.examples sensor_contact
python -m newton.examples sensor_tiled_camera
python -m newton.examples sensor_imu

Selection Examples:选择、筛选、把世界点出来

1
2
3
4
python -m newton.examples selection_cartpole
python -m newton.examples selection_materials
python -m newton.examples selection_articulations
python -m newton.examples selection_multiple

DiffSim Examples:可微分仿真,给学习与优化一条路

1
2
3
4
5
6
python -m newton.examples diffsim_ball
python -m newton.examples diffsim_cloth
python -m newton.examples diffsim_drone
python -m newton.examples diffsim_spring_cage
python -m newton.examples diffsim_soft_body
python -m newton.examples diffsim_bear

Multi-Physics Examples:多物理耦合的“群像戏”

1
2
python -m newton.examples softbody_gift
python -m newton.examples softbody_dropping_to_cloth

Contacts Examples:接触与堆叠,最考验求解器的耐心

1
2
3
4
python -m newton.examples nut_bolt_hydro
python -m newton.examples nut_bolt_sdf
python -m newton.examples brick_stacking
python -m newton.examples pyramid

Softbody Examples:软体世界,既柔软又难算

1
2
python -m newton.examples softbody_hanging
python -m newton.examples softbody_franka

Example Options:它不只是“能跑”,还要你能控制“怎么跑”

Newton 的 examples 支持这些命令行参数:

Argument Description Default
--viewer Viewer type: gl (OpenGL window), usd (USD file output), rerun (ReRun), or null (no viewer). gl
--device Compute device to use, e.g., cpu, cuda:0, etc. None (default Warp device)
--num-frames Number of frames to simulate (for USD output). 100
--output-path Output path for USD files (required if --viewer usd is used). None

它像一个很会配合的实验伙伴:
“你想用哪个 viewer?输出到 USD 还是直接开窗口?跑多久?在哪个 device 上跑?你说了算。”


Example Usage:几条命令,教你怎么“指挥”它

1
2
3
4
5
6
7
8
9
10
11
# List available examples
python -m newton.examples

# Run with the USD viewer and save to my_output.usd
python -m newton.examples basic_viewer --viewer usd --output-path my_output.usd

# Run on a selected device
python -m newton.examples basic_urdf --device cuda:0

# Combine options
python -m newton.examples basic_viewer --viewer gl --num-frames 500 --device cpu

Kamino:Newton 体内的一位“新求解器学徒”(BETA 1)

在 Newton 的世界里,还有一个名字很有故事感的角色:Kamino

Kamino 的 README 开头就先郑重其事地立了规矩:

  • SolverKamino 目前是 BETA(BETA 1)
  • 目前 discourage users 依赖它
  • 因团队带宽有限,不会接受社区贡献
  • 更稳定的 BETA 2 计划在 2026 年夏季(summer of 2026) 发布

它像一个正在闭关修炼的高手:
“我很强,但还没到能承诺稳定的时候;我会变得更稳,但请给我时间。”


Kamino Introduction:它想解决的是真正“难”的机械系统

Kamino 的目标很明确:

  • 模拟任意机械装配体
  • 支持 kinematic loops、under-/overactuation
  • 支持:
    • 任意关节拓扑的约束刚体多体系统(不假设是 kinematic tree)
    • 大量常见与高级 bilateral joint constraints
    • unilateral joint-limit 与 contact constraints(带空间摩擦与可恢复冲击)
    • 可配置的 constraint stabilization(可按 subset 设置)
    • hard joint-limit 与 hard contact,使用高级 Proximal-ADMM forward dynamics solver 强制约束

并且它同样由 Disney Research 与 NVIDIA、Google DeepMind 协作开发维护。


Kamino Getting Started:它也给了入口(但你要知道它还在 beta)

Running Examples

Kamino 的 examples 在:

  • newton/_src/solvers/kamino/examples

运行示例:

1
2
cd newton/_src/solvers/kamino/examples
python sim/example_sim_dr_legs.py

Running Unit Tests

1
2
cd newton/_src/solvers/kamino/tests
python -m unittest discover -s . -p 'test_*.py'

VS Code / Cursor 跑单元测试(Kamino 的小抄)

启用环境(示例):

1
pyenv activate newton-dev

进入测试目录:

1
cd <path-to-parent-dir>/newton/newton/_src/solvers/kamino/tests

执行:

1
python -m unittest discover -s . -p 'test_*.py'

以及 .vscode/settings.json 参考配置:

1
2
3
4
5
6
7
8
9
10
11
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true
}

Contributing and Development:想加入这场“物理交响乐”,先看规则再上台

Newton 把贡献与开发的入口放在:

  • contribution guidelines(newton-governance 仓库)
  • development guide(官方文档)

Support and Community Discussion:先查文档,再去 Discussions

Newton 建议你:

  • 先读 Newton documentation
  • 再去 main repository 的 Discussions 提问

Code of Conduct:在这座物理世界里,也要遵守社区规则

参与社区即同意遵守 Linux Foundation 的 Code of Conduct。


Project Governance, Legal, and Members

治理信息见:

  • newton-governance repository

如果你一直在寻找一个能把“机器人仿真”从 CPU 的拥堵小路,带上 GPU 的高速公路的伙伴,Newton 会很乐意把你的世界接管一部分:
给它一个设备,给它一点输入,它就能把力学的每一帧都算得又快又清楚,还能把结果装进 OpenUSD 的容器里,交给你继续研究、继续迭代、继续创造。