OpenDuckMini快速入门教程-训练环境配置
文章说明
- 本教程主要介绍模型训练前环境的基本配置步骤
- 配置环境时最好提前准备好科学上网的设置
为减少训练时间,训练环境最好部署在带GPU的高性能PC下
欢迎加入我们的openduckmini交流群,微信扫描右侧二维码立即进群交流
相关设备
OpenDuckMini
套件: 采购地址

基本安装
- 安装git-lfs软件包
$ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
$ sudo apt update
$ sudo apt install git-lfs
- 下载源码
$ cd ~/open_duck_mini_ws
$ git clone https://github.com/apirrone/Open_Duck_Playground
$ git clone https://github.com/apirrone/Open_Duck_reference_motion_generator
- 拉取源码中的大文件到本地
$ cd ~/open_duck_mini_ws/Open_Duck_Playground
$ git lfs install
$ cd ~/open_duck_mini_ws/Open_Duck_reference_motion_generator
$ git lfs install
- 检查是否拉取到文件本地
$ ls -lah ~/open_duck_mini_ws/Open_Duck_reference_motion_generator/open_duck_reference_motion_generator/robots/open_duck_mini_v2/assets/
-rw-rw-r-- 1 ubuntu ubuntu 374 Jun 18 10:23 antenna.part
-rw-rw-r-- 1 ubuntu ubuntu 29K Jun 18 10:23 antenna.stl
-rw-rw-r-- 1 ubuntu ubuntu 383 Jun 18 10:23 battery_pack_lid.part
-rw-rw-r-- 1 ubuntu ubuntu 117K Jun 18 10:23 battery_pack_lid.stl
-rw-rw-r-- 1 ubuntu ubuntu 420 Jun 18 10:23 bms.part
-rw-rw-r-- 1 ubuntu ubuntu 684 Jun 18 10:23 bms.stl
-rw-rw-r-- 1 ubuntu ubuntu 423 Jun 18 10:23 bno055.part
-rw-rw-r-- 1 ubuntu ubuntu 72K Jun 18 10:23 bno055.stl
-rw-rw-r-- 1 ubuntu ubuntu 371 Jun 18 10:23 board.part
-rw-rw-r-- 1 ubuntu ubuntu 485K Jun 18 10:23 board.stl
-rw-rw-r-- 1 ubuntu ubuntu 376 Jun 18 10:23 body_back.part
-rw-rw-r-- 1 ubuntu ubuntu 484K Jun 18 10:23 body_back.stl
-rw-rw-r-- 1 ubuntu ubuntu 377 Jun 18 10:23 body_front.part
-rw-rw-r-- 1 ubuntu ubuntu 235K Jun 18 10:23 body_front.stl
-rw-rw-r-- 1 ubuntu ubuntu 385 Jun 18 10:23 body_middle_bottom.part
-rw-rw-r-- 1 ubuntu ubuntu 409K Jun 18 10:23 body_middle_bottom.stl
-rw-rw-r-- 1 ubuntu ubuntu 382 Jun 18 10:23 body_middle_top.part
-rw-rw-r-- 1 ubuntu ubuntu 294K Jun 18 10:23 body_middle_top.stl
-rw-rw-r-- 1 ubuntu ubuntu 421 Jun 18 10:23 cell.part
-rw-rw-r-- 1 ubuntu ubuntu 268K Jun 18 10:23 cell.stl
-rw-rw-r-- 1 ubuntu ubuntu 380 Jun 18 10:23 drive_palonier.part
-rw-rw-r-- 1 ubuntu ubuntu 101K Jun 18 10:23 drive_palonier.stl
-rw-rw-r-- 1 ubuntu ubuntu 382 Jun 18 10:23 foot_bottom_pla.part
-rw-rw-r-- 1 ubuntu ubuntu 58K Jun 18 10:23 foot_bottom_pla.stl
-rw-rw-r-- 1 ubuntu ubuntu 382 Jun 18 10:23 foot_bottom_tpu.part
-rw-rw-r-- 1 ubuntu ubuntu 101K Jun 18 10:23 foot_bottom_tpu.stl
-rw-rw-r-- 1 ubuntu ubuntu 376 Jun 18 10:23 foot_side.part
-rw-rw-r-- 1 ubuntu ubuntu 240K Jun 18 10:23 foot_side.stl
-rw-rw-r-- 1 ubuntu ubuntu 375 Jun 18 10:23 foot_top.part
-rw-rw-r-- 1 ubuntu ubuntu 241K Jun 18 10:23 foot_top.stl
-rw-rw-r-- 1 ubuntu ubuntu 381 Jun 18 10:23 head_bot_sheet.part
-rw-rw-r-- 1 ubuntu ubuntu 286K Jun 18 10:23 head_bot_sheet.stl
-rw-rw-r-- 1 ubuntu ubuntu 371 Jun 18 10:23 head.part
-rw-rw-r-- 1 ubuntu ubuntu 384 Jun 18 10:23 head_pitch_to_yaw.part
-rw-rw-r-- 1 ubuntu ubuntu 658K Jun 18 10:23 head_pitch_to_yaw.stl
-rw-rw-r-- 1 ubuntu ubuntu 382 Jun 18 10:23 head_roll_mount.part
-rw-rw-r-- 1 ubuntu ubuntu 275K Jun 18 10:23 head_roll_mount.stl
-rw-rw-r-- 1 ubuntu ubuntu 1.1M Jun 18 10:23 head.stl
-rw-rw-r-- 1 ubuntu ubuntu 383 Jun 18 10:23 head_yaw_to_roll.part
-rw-rw-r-- 1 ubuntu ubuntu 341K Jun 18 10:23 head_yaw_to_roll.stl
-rw-rw-r-- 1 ubuntu ubuntu 423 Jun 18 10:23 holder.part
-rw-rw-r-- 1 ubuntu ubuntu 1.5K Jun 18 10:23 holder.stl
-rw-rw-r-- 1 ubuntu ubuntu 386 Jun 18 10:23 left_antenna_holder.part
-rw-rw-r-- 1 ubuntu ubuntu 106K Jun 18 10:23 left_antenna_holder.stl
-rw-rw-r-- 1 ubuntu ubuntu 377 Jun 18 10:23 left_cache.part
-rw-rw-r-- 1 ubuntu ubuntu 105K Jun 18 10:23 left_cache.stl
-rw-rw-r-- 1 ubuntu ubuntu 396 Jun 18 10:23 left_knee_to_ankle_left_sheet.part
-rw-rw-r-- 1 ubuntu ubuntu 278K Jun 18 10:23 left_knee_to_ankle_left_sheet.stl
-rw-rw-r-- 1 ubuntu ubuntu 397 Jun 18 10:23 left_knee_to_ankle_right_sheet.part
-rw-rw-r-- 1 ubuntu ubuntu 284K Jun 18 10:23 left_knee_to_ankle_right_sheet.stl
-rw-rw-r-- 1 ubuntu ubuntu 385 Jun 18 10:23 left_roll_to_pitch.part
-rw-rw-r-- 1 ubuntu ubuntu 493K Jun 18 10:23 left_roll_to_pitch.stl
-rw-rw-r-- 1 ubuntu ubuntu 377 Jun 18 10:23 leg_spacer.part
-rw-rw-r-- 1 ubuntu ubuntu 156K Jun 18 10:23 leg_spacer.stl
-rw-rw-r-- 1 ubuntu ubuntu 382 Jun 18 10:23 neck_left_sheet.part
-rw-rw-r-- 1 ubuntu ubuntu 207K Jun 18 10:23 neck_left_sheet.stl
-rw-rw-r-- 1 ubuntu ubuntu 383 Jun 18 10:23 neck_right_sheet.part
-rw-rw-r-- 1 ubuntu ubuntu 211K Jun 18 10:23 neck_right_sheet.stl
-rw-rw-r-- 1 ubuntu ubuntu 382 Jun 18 10:23 passive_palonier.part
-rw-rw-r-- 1 ubuntu ubuntu 101K Jun 18 10:23 passive_palonier.stl
-rw-rw-r-- 1 ubuntu ubuntu 429 Jun 18 10:23 power_switch.part
-rw-rw-r-- 1 ubuntu ubuntu 95K Jun 18 10:23 power_switch.stl
-rw-rw-r-- 1 ubuntu ubuntu 433 Jun 18 10:23 raspberrypizerow.part
-rw-rw-r-- 1 ubuntu ubuntu 1.1M Jun 18 10:23 raspberrypizerow.stl
-rw-rw-r-- 1 ubuntu ubuntu 387 Jun 18 10:23 right_antenna_holder.part
-rw-rw-r-- 1 ubuntu ubuntu 106K Jun 18 10:23 right_antenna_holder.stl
-rw-rw-r-- 1 ubuntu ubuntu 378 Jun 18 10:23 right_cache.part
-rw-rw-r-- 1 ubuntu ubuntu 105K Jun 18 10:23 right_cache.stl
-rw-rw-r-- 1 ubuntu ubuntu 386 Jun 18 10:23 right_roll_to_pitch.part
-rw-rw-r-- 1 ubuntu ubuntu 493K Jun 18 10:23 right_roll_to_pitch.stl
-rw-rw-r-- 1 ubuntu ubuntu 379 Jun 18 10:23 roll_bearing.part
-rw-rw-r-- 1 ubuntu ubuntu 29K Jun 18 10:23 roll_bearing.stl
-rw-rw-r-- 1 ubuntu ubuntu 384 Jun 18 10:23 roll_motor_bottom.part
-rw-rw-r-- 1 ubuntu ubuntu 88K Jun 18 10:23 roll_motor_bottom.stl
-rw-rw-r-- 1 ubuntu ubuntu 381 Jun 18 10:23 roll_motor_top.part
-rw-rw-r-- 1 ubuntu ubuntu 222K Jun 18 10:23 roll_motor_top.stl
-rw-rw-r-- 1 ubuntu ubuntu 421 Jun 18 10:23 sg90.part
-rw-rw-r-- 1 ubuntu ubuntu 66K Jun 18 10:23 sg90.stl
-rw-rw-r-- 1 ubuntu ubuntu 379 Jun 18 10:23 trunk_bottom.part
-rw-rw-r-- 1 ubuntu ubuntu 276K Jun 18 10:23 trunk_bottom.stl
-rw-rw-r-- 1 ubuntu ubuntu 376 Jun 18 10:23 trunk_top.part
-rw-rw-r-- 1 ubuntu ubuntu 930K Jun 18 10:23 trunk_top.stl
-rw-rw-r-- 1 ubuntu ubuntu 430 Jun 18 10:23 usb_c_charger.part
-rw-rw-r-- 1 ubuntu ubuntu 60K Jun 18 10:23 usb_c_charger.stl
-rw-rw-r-- 1 ubuntu ubuntu 395 Jun 18 10:23 wj-wk00-0122topcabinetcase_95.part
-rw-rw-r-- 1 ubuntu ubuntu 2.0M Jun 18 10:23 wj-wk00-0122topcabinetcase_95.stl
-rw-rw-r-- 1 ubuntu ubuntu 391 Jun 18 10:23 wj-wk00-0123middlecase_56.part
-rw-rw-r-- 1 ubuntu ubuntu 49K Jun 18 10:23 wj-wk00-0123middlecase_56.stl
-rw-rw-r-- 1 ubuntu ubuntu 391 Jun 18 10:23 wj-wk00-0124bottomcase_45.part
-rw-rw-r-- 1 ubuntu ubuntu 4.9M Jun 18 10:23 wj-wk00-0124bottomcase_45.stl
- 安装uv
$ curl -LsSf https://astral.sh/uv/install.sh | sh
downloading uv 0.7.13 x86_64-unknown-linux-gnu
no checksums to verify
installing to /home/ubuntu/.local/bin
uv
uvx
everything's installed!
To add $HOME/.local/bin to your PATH, either restart your shell or run:
source $HOME/.local/bin/env (sh, bash, zsh)
source $HOME/.local/bin/env.fish (fish)
$ echo 'source $HOME/.local/bin/env' >> ~/.bashrc
- 安装mujoco
$ cd
$ wget https://github.com/google-deepmind/mujoco/releases/download/3.3.0/mujoco-3.3.0-linux-x86_64.tar.gz
$ mkdir ~/.mujoco
$ tar -zxvf mujoco-3.3.0-linux-x86_64.tar.gz -C ~/.mujoco
$ echo 'export LD_LIBRARY_PATH=~/.mujoco/mujoco-3.3.0/bin' >> ~/.bashrc
$ source ~/.bashrc
- 测试mujoco
$ cd ~/.mujoco/mujoco-3.3.0/bin
$ ./simulate ../model/humanoid/humanoid.xml
MuJoCo version 3.3.0
Plugins registered by library 'libelasticity.so':
mujoco.elasticity.cable
mujoco.elasticity.shell
Plugins registered by library 'libsensor.so':
mujoco.sensor.touch_grid
Plugins registered by library 'libsdf.so':
mujoco.sdf.bolt
mujoco.sdf.bowl
mujoco.sdf.gear
mujoco.sdf.nut
mujoco.sdf.torus
mujoco.sdf.sdflib
Plugins registered by library 'libactuator.so':
mujoco.pid
训练环境
Open_Duck_reference_motion_generator
pyproject.toml
中需要用到的环境
[project]
name = "open_duck_reference_motion_generator"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = "==3.10.12"
dependencies = [
"flask>=3.1.0",
"framesviewer>=1.0.2",
"matplotlib>=3.10.0",
"placo==0.6.3",
"pygame>=2.6.1",
"scikit-learn>=1.6.1",
"scipy>=1.15.2",
]
- 一般情况这生成动作的部分,不会出现过多的环境配置问题
Open_Duck_Playground
pyproject.toml
中需要用到的环境
[project]
name = "Open_Duck_Playground"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"framesviewer>=1.0.2",
"jax[cuda12]>=0.5.0",
"jaxlib>=0.5.0",
"jaxtyping>=0.2.38",
"matplotlib>=3.10.0",
"mediapy>=1.2.2",
"onnxruntime>=1.20.1",
"playground>=0.0.3",
"pygame>=2.6.1",
"tensorflow>=2.18.0",
"tf2onnx>=1.16.1",
]
[build-system]
requires = ["setuptools"]
[tool.setuptools]
packages = ["playground"]
- 通常可能出现的报错是python版本不对需要3.11版本以上,建议使用3.11
NumPy
版本大于2.0也会报错,本教程测试时使用的版本为1.26.4jaxlib
版本可能也会出现问题,可以将pyproject.toml
中的默认版本改成当前版本进行测试,比如"jaxlib>=0.6.0",
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号