@@ -137,7 +137,7 @@ conda create -y -n lerobot python=3.10 && conda activate lerobot
1371373.克隆 LeRobot 仓库:
138138
139139``` bash
140- git clone https://gitee .com/Marlboro1998 /lerobot-starai.git ~ /lerobot
140+ git clone https://github .com/Seeed-Projects /lerobot-starai.git ~ /lerobot
141141```
142142
143143并切换到starai-arm-develop分支
@@ -174,10 +174,6 @@ conda install ffmpeg=7.1.1 -c conda-forge
174174cd ~ /lerobot && pip install -e " .[starai]"
175175```
176176
177- ``` bash
178- sudo apt remove brltty
179- ```
180-
181177对于 Jetson Jetpack 设备(请确保在执行此步骤前按照[ 此链接教程] ( https://github.com/Seeed-Projects/reComputer-Jetson-for-Beginners/tree/main/3-Basic-Tools-and-Getting-Started/3.5-Pytorch ) 第 5 步安装了 Pytorch-gpu 和 Torchvision):
182178
183179``` bash
@@ -296,27 +292,25 @@ sudo chmod 666 /dev/ttyUSB*
296292
297293### 单臂校准设置
298294
299- 如果是第一次校准,请对每个关节左右转动到对应位置。
295+ 机械臂开箱到遥操作视频可参考:
300296
301- 如果是重新校准,按照命令提示输入字母c后按Enter键。
297+ <div class =" video-container " >
298+ <iframe width =" 900 " height =" 600 " src =" //player.bilibili.com/player.html?isOutside=true&aid=115348342901390&bvid=BV1Pt47zGEEc&cid=32960351835&p=1 " title =" bilibili video player " frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " referrerpolicy =" strict-origin-when-cross-origin " allowfullscreen ></iframe >
299+ </div >
302300
303- 下面是参考值,通常情况下,真实的限位参考值的±10°范围内。
301+
304302
305- | 舵机ID | 角度下限参考值 | 角度上限参考值 | 备注 |
306- | ------- | -------------: | -------------: | ---------------------------------- |
307- | motor_0 | -180° | 180° | 转动到限位处 |
308- | motor_1 | -90° | 90° | 转动到限位处 |
309- | motor_2 | -90° | 90° | 转动到限位处 |
310- | motor_3 | -180° | 180° | 没有限位,需转动到角度上下限参考值 |
311- | motor_4 | -90° | 90° | 转动到限位处 |
312- | motor_5 | -180° | 180° | 没有限位,需转动到角度上下限参考值 |
313- | motor_6 | 0° | 100° | 转动到限位处 |
303+ 将手臂移动至下图** 机械臂初始位置** 待机, 然后再重新接上电源。新版本机械臂初始位置,(需要特别关注3,4,5号关节舵机与图片需要严格对应):
314304
315- ::: tip
316- 以PC(linux)和jetson板卡为例,` 第一个 ` 插入usb接口会映射为` ttyUSB0 ` ,` 第二个 ` 插入usb接口会映射为` ttyUSB1 ` 。
305+ | ** Violin Leader Arm初始位置** | ** Viola Follower Arm初始位置** |
306+ | :---------:| :---------:|
307+ | ![ fig1] ( https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/violin_rest.jpg ) | ![ fig2] ( https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/viola_rest.jpg ) |
317308
318- 在运行代码前请注意leader和follower的映射接口。
319- :::
309+ 老版本机械臂初始位置(需要特别关注3,4,5号关节舵机与图片需要严格对应,也可以参考新版本机械臂初始位置):
310+ <div align =" center " >
311+ <img width={800}
312+ src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/Specifications.png" />
313+ </div >
320314
321315#### leader机械臂
322316
@@ -326,6 +320,9 @@ sudo chmod 666 /dev/ttyUSB*
326320lerobot-calibrate --teleop.type=starai_violin --teleop.port=/dev/ttyUSB0 --teleop.id=my_awesome_staraiviolin_arm
327321```
328322
323+ 启动后你会看到各个关节的编码器值,需要你逐一对每个关节进行手动校准,将每个关节旋转到最大值和和最小值,没有限位的关节,最大不超过顺时针及逆时针180°。校准完所有关节后点击回车即可保存。
324+
325+
329326#### follower机械臂
330327
331328将follower连接到` /dev/ttyUSB1 ` ,或者修改` --teleop.port ` ,然后执行:
@@ -334,7 +331,8 @@ lerobot-calibrate --teleop.type=starai_violin --teleop.port=/dev/ttyUSB0 --t
334331lerobot-calibrate --robot.type=starai_viola --robot.port=/dev/ttyUSB1 --robot.id=my_awesome_staraiviola_arm
335332```
336333
337- 在运行命令后,需要** 手动掰机械臂** ,让每个关节达到** 极限值** ,终端会显示记录的范围数据,做完此操作后按下回车即可。
334+ 启动后你会看到各个关节的编码器值,需要你逐一对每个关节进行手动校准,将每个关节旋转到最大值和和最小值,没有限位的关节,最大不超过顺时针及逆时针180°。校准完所有关节后点击回车即可保存。
335+
338336
339337::: tip
340338校准的文件会保存到以下路径` ~/.cache/huggingface/lerobot/calibration/robots ` 和` ~/.cache/huggingface/lerobot/calibration/teleoperators ` 下。
@@ -352,6 +350,8 @@ lerobot-calibrate --robot.type=starai_viola --robot.port=/dev/ttyUSB1 --robo
352350``` bash
353351lerobot-calibrate --teleop.type=bi_starai_leader --teleop.left_arm_port=/dev/ttyUSB0 --teleop.right_arm_port=/dev/ttyUSB2 --teleop.id=bi_starai_leader
354352```
353+ 启动后你会看到各个关节的编码器值,需要你逐一对每个关节进行手动校准,将每个关节旋转到最大值和和最小值,没有限位的关节,最大不超过顺时针及逆时针180°。校准完所有关节后点击回车即可保存。
354+
355355
356356#### follower机械臂
357357
@@ -361,6 +361,8 @@ lerobot-calibrate --teleop.type=bi_starai_leader --teleop.left_arm_port=/de
361361lerobot-calibrate --robot.type=bi_starai_follower --robot.left_arm_port=/dev/ttyUSB1 --robot.right_arm_port=/dev/ttyUSB3 --robot.id=bi_starai_follower
362362```
363363
364+ 启动后你会看到各个关节的编码器值,需要你逐一对每个关节进行手动校准,将每个关节旋转到最大值和和最小值,没有限位的关节,最大不超过顺时针及逆时针180°。校准完所有关节后点击回车即可保存。
365+
364366::: tip
365367
366368单臂和双臂的区别在于` --teleop.type ` 和` --robot.type ` 不一样,同时双臂需要给左右手各一个usb口,总共需要4个usb口` --teleop.left_arm_port ` ` --teleop.right_arm_port ` ` --robot.left_arm_port ` ` --robot.right_arm_port ` 。
@@ -374,7 +376,7 @@ lerobot-calibrate --robot.type=bi_starai_follower --robot.left_arm_port=/de
374376## 遥控操作
375377
376378<div class =" video-container " >
377- <iframe width =" 900 " height =" 600 " src =" https://www.youtube .com/embed/Uz-x-2P2xaE?si=HJTjALt5yFntR6-s " title =" youtube video player" frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " referrerpolicy =" strict-origin-when-cross-origin " allowfullscreen ></iframe >
379+ <iframe width =" 900 " height =" 600 " src =" //player.bilibili .com/player.html?isOutside=true&aid=115348342901390&bvid=BV1Pt47zGEEc&cid=32960351835&p=1 " title =" bilibili video player" frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " referrerpolicy =" strict-origin-when-cross-origin " allowfullscreen ></iframe >
378380</div >
379381
380382将手臂移动至图上位置待机。
@@ -423,6 +425,126 @@ lerobot-teleoperate \
423425
424426## 添加摄像头
425427
428+ <details >
429+ <summary > 如果是Orbbec Gemini2深度相机 </summary >
430+
431+ <div align =" center " >
432+ <img width={800}
433+ src="https://media-cdn.seeedstudio.com/media/catalog/product/cache/bb49d3ec4ee05b6f018e93f896b8a25d/0/-/0-101090144--orbbec-gemini-2-3d-camera.jpg" />
434+ </div >
435+ <div class =" get_one_now_container " style ={{textAlign : 'center'}} >
436+ <a class =" get_one_now_item " href =" https://detail.tmall.com/item.htm?abbucket=16&id=877820346195&mi_id=0000Ou_lIzqedYPuPAA8fpFm7RLR5dXIVA-SAX_AOiJab6M&ns=1&skuId=6069820106496&spm=a21n57.1.hoverItem.5&utparam=%7B%22aplus_abtest%22%3A%2275f755ae980dafcddefac00fe2ec6540%22%7D&xxc=taobaoSearch " target =" _blank " rel =" noopener noreferrer " >
437+ <strong><span><font color={'FFFFFF'} size={"4"}> 淘宝来一单 🖱️</font></span></strong>
438+ </a ></div >
439+
440+
441+ - 🚀 步骤 1:安装 Orbbec SDK 依赖环境
442+
443+ 1 . 拉取 ` pyorbbec ` 仓库
444+ ``` bash
445+ cd ~ /
446+ git clone https://github.com/orbbec/pyorbbecsdk.git
447+ ```
448+
449+ 2 . 下载并安装 SDK 对应的 ** .whl 文件**
450+ 前往 [ pyorbbecsdk Releases] ( https://github.com/orbbec/pyorbbecsdk/releases ) ,
451+ 根据 Python 版本选择并安装,例如:
452+ ``` bash
453+ pip install pyorbbecsdk-x.x.x-cp310-cp310-linux_x86_64.whl
454+ ```
455+
456+ 3 . 在 ` pyorbbec ` 目录下安装依赖
457+ ``` bash
458+ cd ~ /pyorbbecsdk
459+ pip install -r requirements.txt
460+ ```
461+
462+ 强制降低` numpy ` 版本到` 1.26.0 `
463+ ```bash
464+ pip install numpy==1.26.0
465+ ```
466+ 可以忽略红色报错。
467+
468+ 4.将orbbec sdk克隆到` ~/lerobot/src/cameras ` 目录下
469+
470+ ``` bash
471+ cd ~ /lerobot/src/cameras
472+ git clone https://github.com/ZhuYaoHui1998/orbbec.git
473+ ```
474+
475+ 5.修改utils.py和__ init__ .py
476+ - 在` ~/lerobot/src/lerobot/cameras ` 目录下找到` utils.py ` ,在` 40 ` 行处添加如下代码:
477+
478+ ``` python
479+ elif cfg.type == " orbbec" :
480+ from .realsense.camera_orbbec import OrbbecCamera
481+
482+ cameras[key] = OrbbecCamera(cfg)
483+ ```
484+
485+ <div align =" center " >
486+ <img width={800}
487+ src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/utils.png" />
488+ </div >
489+
490+ - 在` ~/lerobot/src/lerobot/cameras ` 目录下找到` __init__.py ` ,在` 18 ` 行处添加如下代码:
491+
492+ ``` python
493+ from .orbbec.configuration_orbbec import OrbbecCameraConfig
494+ ```
495+
496+ <div align =" center " >
497+ <img width={800}
498+ src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/init.png" />
499+ </div >
500+
501+
502+
503+
504+ - 🚀 步骤 2:函数调用与示例
505+
506+ 以下示例均需将 ` starai_viola ` 替换为你所使用实际机械臂型号(如 ` so100 ` / ` so101 ` )。
507+
508+
509+ 我们加入了focus_area超参数,因为过远的深度数据对于机械臂没有意义(抓取不到),因此小于或者大于focus_area的深度数据将会变为黑色,默认的focus_area是(20,600)
510+ 目前支持的分辨率只限于 width: 640, height: 880
511+
512+ ``` bash
513+ lerobot-teleoperate \
514+ --robot.type=starai_viola \
515+ --robot.port=/dev/ttyUSB1 \
516+ --robot.id=my_awesome_staraiviola_arm \
517+ --robot.cameras=" { up: {type: orbbec, width: 640, height: 880, fps: 30, focus_area:[60,300]}}" \
518+ --teleop.type=starai_violin \
519+ --teleop.port=/dev/ttyUSB0 \
520+ --teleop.id=my_awesome_staraiviolin_arm \
521+ --display_data=true
522+ ```
523+
524+ <div align =" center " >
525+ <img width={800}
526+ src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/orbbec_result.png" />
527+ </div >
528+
529+
530+
531+ 后续采集数据、训练及评估任务与常规RGB命令一样,只需要把:
532+
533+ ``` bash
534+ --robot.cameras=" { up: {type: orbbec, width: 640, height: 880, fps: 30, focus_area:[60,300]}}" \
535+ ```
536+
537+
538+ 替换到常规rgb命令中即可,你也可以再后面添加额外的单目RGB相机。
539+
540+ ** 💡 作者与贡献**
541+
542+ - 作者: 张家铨,王文钊 - 华南师范大学
543+
544+
545+ </details >
546+
547+
426548<div class =" video-container " >
427549<iframe width =" 900 " height =" 600 " src =" https://www.youtube.com/embed/-p8K_-XxW8U?si=UmYWvEyKNPpTRxDC " title =" youtube video player " frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " referrerpolicy =" strict-origin-when-cross-origin " allowfullscreen ></iframe >
428550</div >
@@ -722,8 +844,7 @@ lerobot-train \
722844 --job_name=act_viola_test \
723845 --policy.device=cuda \
724846 --wandb.enable=False \
725- --policy.repo_id=starai/my_policy \
726- --steps=200000
847+ --policy.repo_id=starai/my_policy
727848```
728849
729850<details >
@@ -737,8 +858,7 @@ lerobot-train \
737858 --job_name=act_bi_viola_test \
738859 --policy.device=cuda \
739860 --wandb.enable=False \
740- --policy.repo_id=starai/my_policy \
741- --steps=200000
861+ --policy.repo_id=starai/my_policy
742862```
743863</details >
744864
@@ -750,10 +870,9 @@ lerobot-train \
750870从某个检查点恢复训练。
751871
752872``` bash
753- lerobot- train \
873+ python -m lerobot.scripts. train \
754874 --config_path=outputs/train/act_viola_test/checkpoints/last/pretrained_model/train_config.json \
755- --resume=true \
756- --steps=400000
875+ --resume=true
757876```
758877
759878
0 commit comments