DARTPython绑定 dart-python

这个skill是用于在Python中调用DART库的绑定,允许开发者在Python环境中使用DART的物理模拟、机器人控制、动画生成等功能。关键词:Python绑定, DART, dartpy, 机器人模拟, 物理引擎, 轮子构建, API模式, 开发工具。

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

名称: dart-python 描述: DART Python绑定 (dartpy) - nanobind, 轮子构建, API模式

<!-- 自动生成的文件 - 请勿手动编辑 --> <!-- 源文件: .claude/skills/dart-python/SKILL.md --> <!-- 同步脚本: scripts/sync_ai_commands.py --> <!-- 运行 pixi run sync-ai-commands 以更新 -->

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  # 生成类型存根

轮子构建

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/