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/