Skip to content

Commit 37a3d9a

Browse files
committed
update readme, prepare the pypi release env
1 parent cddea48 commit 37a3d9a

3 files changed

Lines changed: 140 additions & 51 deletions

File tree

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,57 @@
11
name: Publish Python Package
22

33
on:
4-
release:
5-
types: [published]
6-
# push:
7-
# branches:
8-
# - main
4+
push:
5+
tags:
6+
- "v*.*.*"
97

108
jobs:
119
pypi-publish:
12-
name: Upload release to PyPI
10+
name: Build and publish to PyPI
1311
runs-on: ubuntu-latest
14-
12+
1513
environment:
1614
name: pypi
17-
url: https://pypi.org/p/lerobot-robot-xarm
15+
url: https://pypi.org/p/lerobot-teleoperator-seeed-b601
1816
permissions:
17+
contents: write
1918
id-token: write
19+
2020
steps:
21-
- name: Checkout repository
22-
uses: actions/checkout@v3
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Ensure tag commit is on main
27+
run: |
28+
git fetch origin main --depth=1
29+
git merge-base --is-ancestor "$GITHUB_SHA" "origin/main"
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.10"
35+
cache: "pip"
36+
37+
- name: Install build tools
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install build twine
2341
24-
- name: Set up Python
25-
uses: actions/setup-python@v4
26-
with:
27-
python-version: '3.10'
42+
- name: Build package
43+
run: python -m build
2844

29-
- name: Install build tools
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install build
45+
- name: Check distributions
46+
run: twine check dist/*
3347

34-
- name: Build package
35-
run: python -m build
48+
- name: Publish package distributions to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1
3650

37-
- name: Publish package distributions to PyPI
38-
uses: pypa/gh-action-pypi-publish@release/v1
51+
- name: Create GitHub Release
52+
uses: softprops/action-gh-release@v2
53+
with:
54+
files: dist/*
55+
generate_release_notes: true
56+
draft: false
57+
prerelease: false

README.md

Lines changed: 93 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,127 @@ This repository provides the **Leader Arm (Teleoperator)** integration for the *
66

77
* **Robot**: Seeed reBot Arm B601 Series (6-DOF + Gripper)
88
* **Motors**: Damiao (DM4310 + DM4340), RobStride
9-
* **Communication**: CAN Bus (via USB-CAN adapter, e.g., derivatives of Candle/slcan or SocketCAN compatible devices)
9+
* **Communication**: CAN Bus (via USB-CAN adapter, including Damiao's v3 USB2CAN adapter)
1010

1111
## Installation
1212

1313
1. **Install LeRobot**:
14-
Follow the instructions in the [LeRobot repository](https://github.com/huggingface/lerobot) to install the base library.
14+
Follow the instructions in the [LeRobot repository](https://github.com/huggingface/lerobot) to install the base library. A very quick summary would be like the following.
15+
16+
```shell
17+
conda create -y -n lerobot python=3.12
18+
conda activate lerobot
19+
conda install ffmpeg -c conda-forge
20+
git clone https://github.com/huggingface/lerobot.git
21+
cd lerobot
22+
pip install -e .
23+
```
24+
25+
2. **Install motorbridge Python Package**
26+
27+
```shell
28+
# goto https://github.com/tianrking/motorbridge/releases
29+
# find the proper python wheel for your platform
30+
# e.g. ubuntu x86_64, python3.12, we should download https://github.com/tianrking/motorbridge/releases/download/v0.1.5/motorbridge-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
31+
# with your conda env activated
32+
pip install motorbridge-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
33+
34+
# TODO: install from pypi
35+
```
36+
37+
You could also install the `motor-cli` tool,a very useful motor tool.
1538

16-
2. **Install this package**:
39+
```shell
40+
wget https://github.com/tianrking/motorbridge/releases/download/v0.1.5/motor-cli-v0.1.5-linux-x86_64.tar.gz
41+
tar zxvf motor-cli-v0.1.5-linux-x86_64.tar.gz
42+
sudo cp motor-cli-v0.1.5-linux-x86_64/bin/motor_cli /usr/local/bin/
43+
sudo chmod a+x /usr/local/bin/motor_cli
44+
45+
## new version may be released, you should check the lates version
46+
47+
```
48+
49+
3. **Install this package**:
1750
Clone this repository and install in editable mode:
1851
```bash
19-
git clone https://github.com/Seeed-Studio/lerobot-teleoperator-seeed-b601.git
52+
git clone https://github.com/Seeed-Projects/lerobot-teleoperator-seeed-b601.git
2053
cd lerobot-teleoperator-seeed-b601
2154
pip install -e .
2255
```
2356

57+
Or install from PyPI:
58+
```bash
59+
pip install lerobot-teleoperator-seeed-b601
60+
```
61+
2462
Upon installation, two teleoperator variants are registered:
2563
* `seeed_b601_dm_leader`: B601 Leader using Damiao motors (6-DOF + Gripper) - **Fully Implemented**
2664
* `seeed_b601_rs_leader`: B601 Leader using RobStride motors (6-DOF + Gripper) - **Placeholder**
65+
66+
```shell
67+
# test if the installation is good
68+
lerobot-teleoperate --help | grep SeeedB601
69+
70+
# if you see the following you're good
71+
SeeedB601DMLeaderConfig ['teleop']:
72+
SeeedB601RSLeaderConfig ['teleop']:
73+
```
2774

2875
## Configuration
2976

30-
The default configuration for B601-DM Leader is located in `lerobot_teleoperator_seeed_b601/config_seeed_b601_dm_leader.py`.
31-
32-
* **Motor IDs**: 0x01 - 0x07 (send), 0x11 - 0x17 (receive)
33-
* **Motor Types**:
34-
* Joint 1, 4, 5, 6, Gripper: `dm4310`
35-
* Joint 2, 3: `dm4340`
77+
Default motor mapping for the B601 leader:
3678

37-
Ensure your robot's motor IDs match this configuration.
79+
* `shoulder_pan`: master ID `0x01`, feedback ID `0x11`, motor model `dm4340p`
80+
* `shoulder_lift`: master ID `0x02`, feedback ID `0x12`, motor model `dm4340p`
81+
* `elbow_flex`: master ID `0x03`, feedback ID `0x13`, motor model `dm4340p`
82+
* `wrist_flex`: master ID `0x04`, feedback ID `0x14`, motor model `dm4310`
83+
* `wrist_roll`: master ID `0x05`, feedback ID `0x15`, motor model `dm4310`
84+
* `wrist_yaw`: master ID `0x06`, feedback ID `0x16`, motor model `dm4310`
85+
* `gripper`: master ID `0x07`, feedback ID `0x17`, motor model `dm4310`
3886

39-
TODO: Refer to the wiki page for the guide to configure the motors.
87+
* **CAN adapter types**:
88+
* `socketcan`: for SocketCAN-compatible adapters such as `can0`
89+
* `damiao`: for Damiao serial bridge adapters such as `/dev/ttyACM0`
90+
* `robstride`: registered in config, but the dedicated adapter path is not yet supported by the current `motorbridge` Python SDK integration
4091

41-
## Usage
92+
Ensure your motor names, IDs, wiring, and motor models match this configuration.
4293

43-
### Quick Start
94+
TODO: Refer to the wiki page for the guide to configure the motors.
4495

45-
A verification script is provided to test the connection and read basic motor states (joint positions).
96+
TODO: A script that utilize the motorbridge to configure the deep parameters of the motor.
4697

47-
```bash
48-
# Linux (SocketCAN)
49-
python examples/verification_dm.py --port can0
98+
## Usage
5099

51-
# macOS (slcan)
52-
python examples/verification_dm.py --port /dev/tty.usbmodemXXX
100+
```shell
101+
lerobot-teleoperate \
102+
--robot.id=follower1 \
103+
--robot.type=seeed_b601_dm_follower \
104+
--robot.port=/dev/ttyACM4 \
105+
--robot.can_adapter=damiao \
106+
--teleop.type=seeed_b601_dm_leader \
107+
--teleop.id=leader1 \
108+
--teleop.port=/dev/ttyACM5 \
109+
--teleop.can_adapter=damiao
53110
```
54111

55-
### Use within LeRobot
112+
Teleoperate with cameras,
56113

57-
```bash
114+
```shell
58115
lerobot-teleoperate \
116+
--robot.type=seeed_b601_dm_follower \
117+
--robot.port=/dev/ttyACM4 \
118+
--robot.can_adapter=damiao \
119+
--robot.id=my_awesome_follower_arm \
120+
--robot.cameras="{ up: {type: opencv, index_or_path: /dev/video10, width: 640, height: 480, fps: 30}, side: {type: intelrealsense, serial_number_or_name: 233522074606, width: 640, height: 480, fps: 30}}" \
59121
--teleop.type=seeed_b601_dm_leader \
60-
--teleop.port=can0 \
61-
--robot.type=<your_follower_robot> \
62-
--robot.port=can1 \
63-
--fps=30
122+
--teleop.port=/dev/ttyACM5 \
123+
--teleop.id=my_awesome_leader_arm \
124+
--robot.can_adapter=damiao \
125+
--display_data=true
64126
```
65127

66-
TODO: Write the full guide to use this teleoperator within LeRobot.
128+
Fore more lerobot operations, please refer to the lerobot official documentation:
129+
130+
https://huggingface.co/docs/lerobot/il_robots
131+
132+

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["setuptools>=61", "wheel"]
2+
requires = ["setuptools>=61", "setuptools-scm[toml]>=8", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "lerobot_teleoperator_seeed_b601"
7-
version = "0.1.0"
7+
dynamic = ["version"]
88
description = "Seeed reBot Arm B601 Teleoperator integration with LeRobot"
99
readme = "README.md"
1010
authors = [
@@ -26,3 +26,7 @@ dependencies = [
2626
where = ["."]
2727
include = ["lerobot_teleoperator_seeed_b601"]
2828
exclude = ["*.egg-info"]
29+
30+
[tool.setuptools_scm]
31+
tag_regex = "^v(?P<version>\\d+\\.\\d+\\.\\d+)$"
32+
fallback_version = "0.0.0"

0 commit comments

Comments
 (0)