DARTPython绑定(dartpy) dart-python

这个技能提供 DART(动态动画与机器人技术)的 Python 绑定库 dartpy,用于在 Python 中进行机器人仿真、动画开发和物理引擎集成。支持 nanobind 绑定技术、wheel 包构建和 API 设计模式,便于开发、测试和类型检查。关键词:DART, Python绑定, 机器人仿真, 动画开发, nanobind, wheel构建, API模式。

游戏开发 0 次安装 0 次浏览 更新于 3/6/2026

name: dart-python description: DART Python 绑定 (dartpy) - nanobind、wheel 构建、API 模式

DART Python 绑定 (dartpy)

在需要处理 Python 绑定或 dartpy 时加载此技能。

快速开始

import dartpy as dart

world = dart.World()
skel = dart.io.read_skeleton("dart://sample/urdf/KR5/KR5 sixx R650.urdf")
world.add_skeleton(skel)

for _ in range(100):
    world.step()

完整文档

完整的 Python 绑定指南:docs/onboarding/python-bindings.md

模块特定细节:python/AGENTS.md

快速命令

pixi run build-py-dev    # 为开发构建
pixi run test-py         # 运行 Python 测试
pixi run generate-stubs  # 生成类型存根

Wheel 构建

pixi run -e py312-wheel wheel-build
pixi run -e py312-wheel wheel-repair  # 仅限 Linux
pixi run -e py312-wheel wheel-test

关键模式

  • 优先使用 snake_case(camelCase 会发出 DeprecationWarning)
  • NumPy 数组自动转换为 Eigen 类型
  • GUI 需要 DART_BUILD_GUI=ON

关键文件

  • 包配置:pyproject.toml
  • 构建系统:python/dartpy/CMakeLists.txt
  • 类型存根:python/stubs/dartpy/