Skip to content

Commit 6f1035b

Browse files
author
Ziwei Chang
committed
updates
1 parent f725ac0 commit 6f1035b

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# FAQ
22

33

4-
## 1. 配置自定义网络后,无法连接网络
4+
## 1. 配置自定义网络后,可能无法连接网络
55

66
```sh
77
# 移除默认路由

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,35 @@
66

77
## 代码库说明
88

9-
### 最新版本
9+
#### 最新版本
1010

11-
- 更新:2025.09.03 修复了做第一个动作时立即deactivate手臂异常运动的问题
11+
更新 2025.09.03 : 修复了做第一个动作时立即deactivate手臂异常运动的问题
1212

13-
### brainco_ws
13+
#### brainco_ws
1414

1515
G1手臂IK计算基于宇树官方示例[Unitree/xr_teleoperate](https://github.com/unitreerobotics/xr_teleoperate/blob/main/teleop/robot_control/robot_arm_ik.py)。双臂双手控制基于ROS2。
1616
- Main control [smach_action.py](./brainco_ws/src/control_py/control_py/smach_action.py)
1717
- State machine transition client [keyboard_call.py](./brainco_ws/src/control_py/control_py/keyboard_call.py)
1818

1919

20-
### ros2_stark_ws
20+
#### ros2_stark_ws
2121

2222
本例中使用的灵巧手SDK与[原版SDK](https://github.com/BrainCoTech/stark-serialport-example/tree/revo2/ros2_stark_ws)区别:
2323
强脑灵巧手与宇树G1通过**双485**串口通信,即单ROS节点中左右手分别通过`/dev/ttyUSB0``/dev/ttyUSB1`串口同时传输信息。
2424
- Brainco hands [stark_node.cpp](./ros2_stark_ws/src/ros2_stark_controller/src/stark_node.cpp)
2525

2626

27+
2728
## 灵巧手适配教程
2829

2930
视频演示(待添加)
3031

31-
### 机器人启动
32+
#### 机器人启动
3233
1. 宇树G1开机,具体可参照[宇树文档中心|操作指南](https://support.unitree.com/home/zh/G1_developer/quick_start)。接电时,灵巧手手背指示灯亮起,手指自动复位。
3334
2. 等待(约1分钟)宇树G1进入**零力矩模式**,具体表现为随意活动关节无阻力。
3435
3. 使用遥控器,按照说明按下对应按钮,使机器人依次进入**阻尼模式****锁定站立模式**。(注意:手臂开发**不进入**运动模式)
3536

36-
### 远程连接
37+
#### 远程连接
3738
参考[宇树文档中心|快速开发](https://support.unitree.com/home/zh/G1_developer/quick_development)
3839
1. 首次连接使用网线连接G1和计算机,将计算机以太网IP设置为与宇树G1同网段 `192.168.123.XXX`,如:
3940
```
@@ -79,7 +80,7 @@ sudo nmcli connection down <SSID> && sudo nmcli connection up <SSID>
7980
```
8081

8182

82-
### 安装环境依赖
83+
#### 安装环境依赖
8384
1. 安装Miniconda。进入[Miniconda官网](https://www.anaconda.com/docs/getting-started/miniconda/main),选择系统:`Linux`,选择系统架构`ARM64`,按照官方提供的命令安装。
8485
2. 创建conda环境,环境名为g1brainco,使用python3.8
8586
```sh
@@ -101,7 +102,7 @@ pip install empy==3.3.2
101102
pip install lark-parser
102103
```
103104

104-
### 安装宇树ROS
105+
#### 安装宇树ROS
105106
1. 参考[宇树文档中心|ROS2通信例程](https://support.unitree.com/home/zh/G1_developer/ros2_communication_routine),安装并编译`unitree_ros2`
106107

107108
2. 打开`~/unitree_ros2/setup.sh`,修改`"enp3s0"``"eth0"`
@@ -111,7 +112,7 @@ export CYCLONEDDS_URI='<CycloneDDS><Domain><General><Interfaces>
111112
</Interfaces></General></Domain></CycloneDDS>'
112113
```
113114

114-
### 安装强脑灵巧手SDK
115+
#### 安装强脑灵巧手SDK
115116
1. 下载本仓库到G1
116117
- 方法1:
117118
```sh
@@ -131,13 +132,13 @@ chmod +x ./launch/launch_trans.sh
131132
chmod +x ./launch/launch_robot.sh
132133
```
133134

134-
### 配置灵巧手
135+
#### 配置灵巧手
135136
打开`ros2_stark_ws/src/ros2_stark_controller/config/params_v2_double.yaml`,根据灵巧手配置修改参数,通常使用默认参数。
136137
- `port_l, port_r`: 左右手串口,分别对应USB-485板的`485_A, 485_B`信号端口
137138
- `baudrate`: 波特率
138139
- `slave_id_l, slave_id_r`: 左手默认`0x7e`右手默认`0x7f`
139140

140-
### 编译
141+
#### 编译
141142

142143
```sh
143144
# 激活 conda 环境
@@ -155,7 +156,7 @@ python -m colcon build
155156

156157
同时开启两个终端
157158

158-
### 终端1: 启动主控制节点和灵巧手节点
159+
#### 终端1: 启动主控制节点和灵巧手节点
159160
```sh
160161
conda activate g1brainco # 激活conda环境
161162
cd ~/unitree-g1-brainco-hand/brainco_ws # 进入工作空间
@@ -172,18 +173,19 @@ cd ~/unitree-g1-brainco-hand/brainco_ws # 进入工作空间
172173
- 当显示 `"Request 'configure' to start"` 则可以发送状态转换请求
173174

174175

175-
### 终端2: 启动状态转换 client 节点
176+
#### 终端2: 启动状态转换 client 节点
176177
```sh
177178
conda activate g1brainco # 激活conda环境
178179
cd ~/unitree-g1-brainco-hand/brainco_ws # 进入工作空间
179180
./launch/launch_trans.sh # 运行 launch 文件
180181
```
181182

182-
### 请求状态切换
183+
#### 请求状态切换
183184
**终端2**会提示当前状态、可使用的转换和对应的动作。输入`字符(串) + 回车`转换状态。进入`active`状态后,在字母后加`l``r`单独控制左/右手,不加则默认双手。
184185
<p align="center">
185186
<img src="brainco_ws/figs/ros2_statemachine.png" alt="statemachine" width="600"/>
186187
</p>
187188

189+
188190
## FAQ
189191
[FAQ.md](./FAQ.md).

README_en.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ Tutorial on adapting BrainCo Revo2 hands for Unitree G1 robot. Install, setup an
66

77
## Repository Overview
88

9-
### Lastest version
9+
#### Lastest version
1010

11+
Update 2025.09.03: Fixed the issue where the arm behaved abnormally when immediately deactivated during the first action
1112

12-
- Update on 03.09.2025: Fixed the issue of abnormal arm movement when deactivating immediately after performing the first action.
13-
### brainco_ws
13+
#### brainco_ws
1414

1515
G1 arm IK calculation is based on [Unitree/xr_teleoperate](https://github.com/unitreerobotics/xr_teleoperate/blob/main/teleop/robot_control/robot_arm_ik.py). Dual-arm dual-hand control is based on ROS2.
1616
- Main control [smach_action.py](./brainco_ws/src/control_py/control_py/smach_action.py)
1717
- State machine transition client [keyboard_call.py](./brainco_ws/src/control_py/control_py/keyboard_call.py)
1818

1919

20-
### ros2_stark_ws
20+
#### ros2_stark_ws
2121

2222
Difference between this SDK version and [the original version](https://github.com/BrainCoTech/stark-serialport-example/tree/revo2/ros2_stark_ws):
2323
The BrainCo hands communicates with Unitree G1 via **dual 485** serial ports, i.e., in a single ROS node, the left and right hands communicate simultaneously through `/dev/ttyUSB0` and `/dev/ttyUSB1`.
@@ -28,12 +28,12 @@ The BrainCo hands communicates with Unitree G1 via **dual 485** serial ports, i.
2828

2929
Tutorial video (to be added)
3030

31-
### Robot Startup
31+
#### Robot Startup
3232
1. Power on Unitree G1 by refering to [Unitree Documentation Center|Operational Guidance](https://support.unitree.com/home/en/G1_developer/quick_start). When the robot powered, the hands' LED will light up and the fingers will reset automatically.
3333
2. Wait about 1 minute until G1 enters **Zero Torque Mode**, meaning joints can move freely without resistance.
3434
3. Use the remote controller and press the corresponding buttons to switch the robot sequentially into **Damping Mode****Ready Mode**. (Note: For arm development, do not enter **Motion Mode**.)
3535

36-
### Remote Connection
36+
#### Remote Connection
3737
Based on [Unitree Documentation Center|Quick Start](https://support.unitree.com/home/en/G1_developer/quick_development):
3838
1. For the first connection, use an Ethernet cable to connect G1 and your computer. Set the computer’s IP to the same subnet as G1: `192.168.123.XXX`, e.g.:
3939
```
@@ -79,7 +79,7 @@ sudo nmcli connection down <SSID> && sudo nmcli connection up <SSID>
7979
```
8080

8181

82-
### Environment Dependencies
82+
#### Environment Dependencies
8383
1. Install Miniconda. Visit [Miniconda Pages](https://www.anaconda.com/docs/getting-started/miniconda/main), choose system: `Linux`, architecture: `ARM64`, and install miniconda using the provided commands.
8484

8585
2. Create a conda environment named `g1brainco` with **Python 3.8**:
@@ -102,7 +102,7 @@ pip install empy==3.3.2
102102
pip install lark-parser
103103
```
104104

105-
### Install Unitree ROS2
105+
#### Install Unitree ROS2
106106
1. Based on [Unitree Documentation Center|Ros2 Communication Routine](https://support.unitree.com/home/en/G1_developer/ros2_communication_routine), install and compile `unitree_ros2`.
107107

108108
2. Open `~/unitree_ros2/setup.sh`, change `"enp3s0"` to `"eth0"`
@@ -112,7 +112,7 @@ export CYCLONEDDS_URI='<CycloneDDS><Domain><General><Interfaces>
112112
</Interfaces></General></Domain></CycloneDDS>'
113113
```
114114

115-
### Install BrainCo Hand SDK
115+
#### Install BrainCo Hand SDK
116116
1. Download this repository to G1:
117117
- Method 1:
118118
```sh
@@ -132,13 +132,13 @@ chmod +x ./launch/launch_trans.sh
132132
chmod +x ./launch/launch_robot.sh
133133
```
134134

135-
### Configure BrainCo Hands
135+
#### Configure BrainCo Hands
136136
Open `ros2_stark_ws/src/ros2_stark_controller/config/params_v2_double.yaml`and modify parameters if needed (You can use default settings).
137137
- `port_l, port_r`: Left and right hand serial ports, corresponding to USB-485 adapter`485_A, 485_B`.
138138
- `baudrate`: Baud rate.
139139
- `slave_id_l, slave_id_r`: Default for left hand`0x7e` and for right hand `0x7f`.
140140

141-
### Compile
141+
#### Compile
142142

143143
```sh
144144
# Activate conda env
@@ -156,7 +156,7 @@ python -m colcon build
156156

157157
Open two terminals simultaneously.
158158

159-
### Terminal 1: Start main control node and hand node
159+
#### Terminal 1: Start main control node and hand node
160160
```sh
161161
conda activate g1brainco # activate conda env
162162
cd ~/unitree-g1-brainco-hand/brainco_ws # enter workspace
@@ -175,14 +175,14 @@ If error occurs, check parameters in `ros2_stark_ws/src/ros2_stark_controller/co
175175
Then you can send state transition requests.
176176

177177

178-
### Terminal 2: Start state transition client node
178+
#### Terminal 2: Start state transition client node
179179
```sh
180180
conda activate g1brainco # activate conda env
181181
cd ~/unitree-g1-brainco-hand/brainco_ws # enter workspace
182182
./launch/launch_trans.sh # run launch.sh
183183
```
184184

185-
### State Transition Requests
185+
#### State Transition Requests
186186
Terminal 2 will show current state, available transitions, and corresponding actions.
187187
Enter `string + Enter` to switch states.
188188
After entering **active** state, add `l` or `r` to control left/right hand individually.
@@ -191,5 +191,6 @@ Without `l/r`, both hands are controlled.
191191
<img src="brainco_ws/figs/ros2_statemachine.png" alt="statemachine" width="600"/>
192192
</p>
193193

194+
194195
## FAQ
195196
[FAQ.md](./FAQ.md).

0 commit comments

Comments
 (0)