Skip to content

Commit 29464e4

Browse files
authored
Merge pull request #3245 from ZhuYaoHui1998/docusaurus-version
fix orbbec camera of lerobot
2 parents ab74276 + f35eb3d commit 29464e4

File tree

4 files changed

+521
-46
lines changed

4 files changed

+521
-46
lines changed

docs/Robotics/Robot_Kits/Lerobot/Lerobot_SO100Arm_New.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,122 @@ The teleoperate command will automatically:
589589

590590
## Add cameras
591591

592+
593+
<details>
594+
<summary> If using the Orbbec Gemini2 Depth Camera </summary>
595+
596+
<div align="center">
597+
<img width={800}
598+
src="https://media-cdn.seeedstudio.com/media/catalog/product/cache/bb49d3ec4ee05b6f018e93f896b8a25d/0/-/0-101090144--orbbec-gemini-2-3d-camera.jpg" />
599+
</div>
600+
<div class="get_one_now_container" style={{textAlign: 'center'}}>
601+
<a class="get_one_now_item" href="https://www.seeedstudio.com/Orbbec-Gemini-2-3D-Camera-p-6464.html" target="_blank" rel="noopener noreferrer" >
602+
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong>
603+
</a></div>
604+
605+
606+
- 🚀 Step 1: Install the Orbbec SDK Dependent Environment
607+
608+
1. Clone the `pyorbbec` repository
609+
```bash
610+
cd ~/
611+
git clone https://github.com/orbbec/pyorbbecsdk.git
612+
```
613+
614+
2. Download and install the corresponding **.whl file** for the SDK
615+
Go to [pyorbbecsdk Releases](https://github.com/orbbec/pyorbbecsdk/releases),
616+
select and install based on your Python version. For example:
617+
```bash
618+
pip install pyorbbecsdk-x.x.x-cp310-cp310-linux_x86_64.whl
619+
```
620+
621+
3. Install dependencies in the `pyorbbec` directory
622+
```bash
623+
cd ~/pyorbbecsdk
624+
pip install -r requirements.txt
625+
```
626+
627+
Force downgrade the `numpy` version to `1.26.0`
628+
```bash
629+
pip install numpy==1.26.0
630+
```
631+
Red error messages can be ignored.
632+
633+
4. Clone the Orbbec SDK into the `~/lerobot/src/cameras` directory
634+
635+
```bash
636+
cd ~/lerobot/src/cameras
637+
git clone https://github.com/ZhuYaoHui1998/orbbec.git
638+
```
639+
640+
5. Modify utils.py and __init__.py
641+
- Find `utils.py` in the `~/lerobot/src/lerobot/cameras` directory, and add the following code at line 40:
642+
643+
```python
644+
elif cfg.type == "orbbec":
645+
from .realsense.camera_orbbec import OrbbecCamera
646+
647+
cameras[key] = OrbbecCamera(cfg)
648+
```
649+
650+
<div align="center">
651+
<img width={800}
652+
src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/utils.png" />
653+
</div>
654+
655+
- Find `__init__.py` in the `~/lerobot/src/lerobot/cameras` directory, and add the following code at line 18:
656+
657+
```python
658+
from .orbbec.configuration_orbbec import OrbbecCameraConfig
659+
```
660+
661+
<div align="center">
662+
<img width={800}
663+
src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/init.png" />
664+
</div>
665+
666+
667+
- 🚀 Step 2: Function Call and Examples
668+
669+
In all the following examples, replace `so101_follower` with the actual model of the robotic arm you are using (e.g., `so100` / `so101`).
670+
671+
672+
We have added the `focus_area` hyperparameter. Since depth data that is too far away is meaningless for the robotic arm (it cannot reach or grasp objects), depth data less than or greater than the `focus_area` will be displayed in black. The default `focus_area` is (20, 600).
673+
Currently, the only supported resolution is width: 640, height: 880.
674+
675+
```bash
676+
lerobot-teleoperate \
677+
--robot.type=so101_follower \
678+
--robot.port=/dev/ttyACM0 \
679+
--robot.id=my_awesome_follower_arm \
680+
--robot.cameras="{ up: {type: orbbec, width: 640, height: 880, fps: 30, focus_area:[60,300]}}" \
681+
--teleop.type=so101_leader \
682+
--teleop.port=/dev/ttyACM1 \
683+
--teleop.id=my_awesome_leader_arm \
684+
--display_data=true
685+
```
686+
687+
688+
<div align="center">
689+
<img width={800}
690+
src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/orbbec_result.png" />
691+
</div>
692+
693+
694+
695+
For subsequent tasks such as data collection, training, and evaluation, the process is the same as that for regular RGB commands. You only need to replace the relevant part in the regular RGB command with:
696+
697+
```bash
698+
--robot.cameras="{ up: {type: orbbec, width: 640, height: 880, fps: 30, focus_area:[60,300]}}" \
699+
```
700+
701+
You can also add an additional monocular RGB camera afterward.
702+
703+
704+
</details>
705+
706+
707+
592708
:::tip
593709
The SO100 and SO101 codes are compatible. Users of SO100 can directly utilize SO101's parameters and code for operation.
594710
:::

docs/Robotics/Robot_Kits/Lerobot/Lerobot_Starai_Arm.md

Lines changed: 133 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -294,25 +294,24 @@ sudo chmod 666 /dev/ttyUSB*
294294

295295
## Calibrate
296296

297-
### For Initial Calibration
297+
For videos covering the StarAI Robotic Arm from unboxing to teleoperation, you may refer to:
298+
<div class="video-container">
299+
<iframe width="900" height="600" src="https://www.youtube.com/embed/02lxxF9Cvy8?si=IGJda5nXkYEbm2N6" 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>
300+
</div>
298301

299-
Please rotate each joint left and right to the corresponding positions.
302+
Move the robotic arm to the initial position of the robotic arm (as shown in the figure below) and place it in standby mode, then reconnect the power supply. For the initial position of the new version of the robotic arm, special attention should be paid to ensuring that the servos of Joints 3, 4, and 5 strictly align with the positions in the figure.
300303

301-
### For Re-Calibration
302304

303-
Follow the on-screen prompt: enter the letter "c" and press the Enter key.
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) |
304308

305-
Below are the reference values. Under normal circumstances, the actual limit reference values should fall within the range of **±10°** of these references.
309+
Initial position of the old-version robotic arm (special attention should be paid to ensuring that the servos of Joints 3, 4, and 5 strictly align with the positions in the figure; the initial position of the new-version robotic arm can also be used as a reference):
310+
<div align="center">
311+
<img width={800}
312+
src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/Specifications.png" />
313+
</div>
306314

307-
| Servo ID | Lower Angle Limit (°) | Upper Angle Limit (°) | Notes |
308-
| -------- | --------------------- | --------------------- | ---------------------------------------------- |
309-
| motor\_0 | -180° | 180° | Rotate to the limit position |
310-
| motor\_1 | -90° | 90° | Rotate to the limit position |
311-
| motor\_2 | -90° | 90° | Rotate to the limit position |
312-
| motor\_3 | -180° | 180° | No limit; rotate to the reference angle limits |
313-
| motor\_4 | -90° | 90° | Rotate to the limit position |
314-
| motor\_5 | -180° | 180° | No limit; rotate to the reference angle limits |
315-
| motor\_6 || 100° | Rotate to the limit position |
316315

317316
:::tip
318317
Taking PC (Linux) and Jetson board as examples, the `first` USB device inserted will be mapped to `ttyUSB0`, and the `second` USB device inserted will be mapped to `ttyUSB1`.
@@ -328,6 +327,8 @@ Connect the leader to `/dev/ttyUSB0`, or modify the `--teleop.port` parameter, a
328327
lerobot-calibrate --teleop.type=starai_violin --teleop.port=/dev/ttyUSB0 --teleop.id=my_awesome_staraiviolin_arm
329328
```
330329

330+
After startup, you will see the encoder values of each joint. You need to manually calibrate each joint one by one: rotate each joint to its maximum and minimum positions. For joints without limit stops, the rotation range must not exceed 180° clockwise or 180° counterclockwise. After calibrating all joints, press Enter to save the settings.
331+
331332
#### Follower Robotic Arm
332333

333334
Connect the follower to `/dev/ttyUSB1`, or modify the `--teleop.port` parameter, and then execute:
@@ -336,7 +337,7 @@ Connect the follower to `/dev/ttyUSB1`, or modify the `--teleop.port` parameter,
336337
lerobot-calibrate --robot.type=starai_viola --robot.port=/dev/ttyUSB1 --robot.id=my_awesome_staraiviola_arm
337338
```
338339

339-
After running the command, you need to **manually move the robotic arm** to allow each joint to reach its **limit position**. The terminal will display the recorded range data. Once this operation is completed, press Enter.
340+
After startup, you will see the encoder values of each joint. You need to manually calibrate each joint one by one: rotate each joint to its maximum and minimum positions. For joints without limit stops, the rotation range must not exceed 180° clockwise or 180° counterclockwise. After calibrating all joints, press Enter to save the settings.
340341

341342
:::tip
342343
The calibration files will be saved to the following paths: `~/.cache/huggingface/lerobot/calibration/robots` and `~/.cache/huggingface/lerobot/calibration/teleoperators`.
@@ -355,6 +356,8 @@ Connect `left_arm_port` to `/dev/ttyUSB0` and `right_arm_port` to `/dev/ttyUSB2`
355356
lerobot-calibrate --teleop.type=bi_starai_leader --teleop.left_arm_port=/dev/ttyUSB0 --teleop.right_arm_port=/dev/ttyUSB2 --teleop.id=bi_starai_leader
356357
```
357358

359+
After startup, you will see the encoder values of each joint. You need to manually calibrate each joint one by one: rotate each joint to its maximum and minimum positions. For joints without limit stops, the rotation range must not exceed 180° clockwise or 180° counterclockwise. After calibrating all joints, press Enter to save the settings.
360+
358361
#### Follower Robotic Arm
359362

360363
Connect `left_arm_port` to `/dev/ttyUSB1` and `right_arm_port` to `/dev/ttyUSB3`, or modify the `--robot.left_arm_port` and `--robot.right_arm_port` parameters, and then execute:
@@ -363,6 +366,8 @@ Connect `left_arm_port` to `/dev/ttyUSB1` and `right_arm_port` to `/dev/ttyUSB3`
363366
lerobot-calibrate --robot.type=bi_starai_follower --robot.left_arm_port=/dev/ttyUSB1 --robot.right_arm_port=/dev/ttyUSB3 --robot.id=bi_starai_follower
364367
```
365368

369+
After startup, you will see the encoder values of each joint. You need to manually calibrate each joint one by one: rotate each joint to its maximum and minimum positions. For joints without limit stops, the rotation range must not exceed 180° clockwise or 180° counterclockwise. After calibrating all joints, press Enter to save the settings.
370+
366371
:::tip
367372

368373
The difference between single-arm and dual-arm setups lies in the `--teleop.type` and `--robot.type` parameters. Additionally, dual-arm setups require separate USB ports for the left and right arms, totaling four USB ports: `--teleop.left_arm_port`, `--teleop.right_arm_port`, `--robot.left_arm_port`, and `--robot.right_arm_port`.
@@ -376,7 +381,7 @@ If using a dual-arm setup, you need to manually modify the robotic arm file type
376381
## Teleoperate
377382

378383
<div class="video-container">
379-
<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>
384+
<iframe width="900" height="600" src="https://www.youtube.com/embed/02lxxF9Cvy8?si=IGJda5nXkYEbm2N6" 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>
380385
</div>
381386

382387
Move the arm to the position shown in the diagram and set it to standby.
@@ -424,10 +429,122 @@ After the program starts, the Hover Lock Technology remains functional.
424429

425430
## Add cameras
426431

432+
<details>
433+
<summary> If using the Orbbec Gemini2 Depth Camera </summary>
434+
435+
<div align="center">
436+
<img width={800}
437+
src="https://media-cdn.seeedstudio.com/media/catalog/product/cache/bb49d3ec4ee05b6f018e93f896b8a25d/0/-/0-101090144--orbbec-gemini-2-3d-camera.jpg" />
438+
</div>
439+
<div class="get_one_now_container" style={{textAlign: 'center'}}>
440+
<a class="get_one_now_item" href="https://www.seeedstudio.com/Orbbec-Gemini-2-3D-Camera-p-6464.html" target="_blank" rel="noopener noreferrer" >
441+
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong>
442+
</a></div>
443+
444+
445+
- 🚀 Step 1: Install the Orbbec SDK Dependent Environment
446+
447+
1. Clone the `pyorbbec` repository
448+
```bash
449+
cd ~/
450+
git clone https://github.com/orbbec/pyorbbecsdk.git
451+
```
452+
453+
2. Download and install the corresponding **.whl file** for the SDK
454+
Go to [pyorbbecsdk Releases](https://github.com/orbbec/pyorbbecsdk/releases),
455+
select and install based on your Python version. For example:
456+
```bash
457+
pip install pyorbbecsdk-x.x.x-cp310-cp310-linux_x86_64.whl
458+
```
459+
460+
3. Install dependencies in the `pyorbbec` directory
461+
```bash
462+
cd ~/pyorbbecsdk
463+
pip install -r requirements.txt
464+
```
465+
466+
Force downgrade the `numpy` version to `1.26.0`
467+
```bash
468+
pip install numpy==1.26.0
469+
```
470+
Red error messages can be ignored.
471+
472+
4. Clone the Orbbec SDK into the `~/lerobot/src/cameras` directory
473+
474+
```bash
475+
cd ~/lerobot/src/cameras
476+
git clone https://github.com/ZhuYaoHui1998/orbbec.git
477+
```
478+
479+
5. Modify utils.py and __init__.py
480+
- Find `utils.py` in the `~/lerobot/src/lerobot/cameras` directory, and add the following code at line 40:
481+
482+
```python
483+
elif cfg.type == "orbbec":
484+
from .realsense.camera_orbbec import OrbbecCamera
485+
486+
cameras[key] = OrbbecCamera(cfg)
487+
```
488+
489+
<div align="center">
490+
<img width={800}
491+
src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/utils.png" />
492+
</div>
493+
494+
- Find `__init__.py` in the `~/lerobot/src/lerobot/cameras` directory, and add the following code at line 18:
495+
496+
```python
497+
from .orbbec.configuration_orbbec import OrbbecCameraConfig
498+
```
499+
500+
<div align="center">
501+
<img width={800}
502+
src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/init.png" />
503+
</div>
504+
505+
506+
- 🚀 Step 2: Function Call and Examples
507+
508+
In all the following examples, replace `starai_viola` with the actual model of the robotic arm you are using (e.g., `so100` / `so101`).
509+
510+
511+
We have added the `focus_area` hyperparameter. Since depth data that is too far away is meaningless for the robotic arm (it cannot reach or grasp objects), depth data less than or greater than the `focus_area` will be displayed in black. The default `focus_area` is (20, 600).
512+
Currently, the only supported resolution is width: 640, height: 880.
513+
514+
```bash
515+
lerobot-teleoperate \
516+
--robot.type=starai_viola \
517+
--robot.port=/dev/ttyUSB1 \
518+
--robot.id=my_awesome_staraiviola_arm \
519+
--robot.cameras="{ up: {type: orbbec, width: 640, height: 880, fps: 30, focus_area:[60,300]}}" \
520+
--teleop.type=starai_violin \
521+
--teleop.port=/dev/ttyUSB0 \
522+
--teleop.id=my_awesome_staraiviolin_arm \
523+
--display_data=true
524+
```
525+
526+
527+
<div align="center">
528+
<img width={800}
529+
src="https://files.seeedstudio.com/wiki/robotics/projects/lerobot/starai/orbbec_result.png" />
530+
</div>
531+
532+
533+
For subsequent tasks such as data collection, training, and evaluation, the process is the same as that for regular RGB commands. You only need to replace the relevant part in the regular RGB command with:
534+
```
535+
--robot.cameras="{ front: {type: orbbec, width: 640, height: 880, fps: 30, focus_area:(20,600)}}" \
536+
```
537+
You can also add an additional monocular RGB camera afterward.
538+
539+
540+
</details>
541+
427542
<div class="video-container">
428543
<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>
429544
</div>
430545

546+
547+
431548
After inserting your two USB cameras, run the following script to check the port numbers of the cameras. It is important to remember that the camera must not be connected to a USB Hub; instead, it should be plugged directly into the device. The slower speed of a USB Hub may result in the inability to read image data.
432549

433550
```bash

0 commit comments

Comments
 (0)