Skip to content

Commit b41958a

Browse files
authored
Merge pull request #28 from FlagOpen/dev
Merge dev into main
2 parents 9614732 + 30999c1 commit b41958a

9 files changed

Lines changed: 1108 additions & 116 deletions

File tree

robodriver/core/monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def send_machine_info_periodically(self, interval_seconds=60):
4545

4646
def start(self):
4747
"""启动后台线程"""
48-
self._thread.start()
4948
self._running = True
49+
self._thread.start()
5050

5151
def stop(self):
5252
"""停止后台线程"""

robodriver/robots/robodriver-robot-realman-aio-ros1/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
### 1.1 Clone the repository / 克隆仓库
66

77
```bash
8-
git clone --recurse-submodules https://github.com/BAAI-EI-DATA/robodriver-robot-realman-aio-ros1.git
9-
cd robodriver-robot-realman-aio-ros1
8+
git clone https://github.com/FlagOpen/RoboDriver.git
109
```
1110

1211
### 1.2 Install the project to RoboDriver / 安装到 RoboDriver 环境
@@ -15,6 +14,7 @@ Make sure you are in the `robodriver` conda env.
1514
确保你已经进入 `robodriver` 的 conda 环境:
1615

1716
```bash
17+
conda create -n robodriver python=3.10
1818
conda activate robodriver
1919
pip install -e .
2020
```
@@ -44,7 +44,7 @@ In this repository directory:
4444
在本仓库目录中运行:
4545

4646
```bash
47-
cd /path/to/your/robodriver-robot-realman-aio-ros1
47+
cd /path/to/your/RoboDriver/robodriver/robots/robodriver-robot-realman-aio-ros1
4848
python -m robodriver_robot_realman_aio_ros1.ros1_zmq_bridge
4949
```
5050

@@ -55,6 +55,7 @@ In your RoboDriver project directory:
5555

5656
```bash
5757
cd /path/to/your/RoboDriver
58+
conda activate robodriver
5859
python robodriver/scripts/run.py --robot.type=realman_aio_ros1
5960
```
6061

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,84 @@
11
# robodriver-robot-realman1-aio-dora
2-
## Get Start
3-
Clone the repository
2+
## 快速开始
3+
克隆代码仓库
44
```
5-
git clone --recurse-submodules https://github.com/BAAI-EI-DATA/robodriver-robot-realman1-aio-dora.git && cd robodriver-robot-realman1-aio-dora
5+
git clone https://github.com/FlagOpen/RoboDriver.git
66
```
7-
Install uv:
7+
8+
安装 Robodriver 环境
89
```
10+
cd /path/to/your/RoboDriver
911
pip install uv
10-
```
11-
Create and activate a virtual environment for realman dora node:
12-
```
13-
uv venv .venv -p 3.9
12+
uv venv .venv -p 3.10
1413
source .venv/bin/activate
15-
```
16-
Install dependencies
17-
```
1814
uv pip install -e .[hardware]
1915
```
20-
Install the project to Robodriver
16+
17+
安装 robodriver-robot-realman1-aio-dora 模块 环境
2118
```
22-
cd /path/to/your/RoboDriver
19+
cd /path/to/your/RoboDriver/robodriver/robots/robodriver-robot-realman1-aio-dora
20+
uv venv .venv -p 3.9
2321
source .venv/bin/activate
24-
cd /path/to/your/robodriver-robot-realman1-aio-dora
2522
uv pip install -e .
26-
source .venv/bin/activate
2723
```
28-
Configure the dataflow.yml
24+
25+
配置 dataflow.yml 文件
2926
```
30-
cd /path/to/your/robodriver-robot-realman1-aio-dora
27+
cd /path/to/your/RoboDriver/robodriver/robots/robodriver-robot-realman1-aio-dora
3128
cd dora
3229
```
33-
Open the dataflow.yml file, then modify the VIRTUAL_ENV path, as well as DEVICE_SERIAL, ARM_IP, and ARM_PORT.
34-
### Parameter explanation:
3530

36-
- VIRTUAL_ENV: The path of the virtual environment used by the realman dora node
37-
- DEVICE_SERIAL: Serial number of the RealSense camera
38-
- ARM_IP: IP of the robotic arm
39-
- ARM_PORT: PORT of the robotic arm
31+
打开 dataflow.yml 文件,修改其中的 VIRTUAL_ENV 路径,以及 DEVICE_SERIAL、ARM_IP 和 ARM_PORT 参数。
32+
### 参数说明:
4033

41-
## Start collecting
42-
Activate environment
34+
- VIRTUAL_ENV:realman dora 节点使用的虚拟环境路径
35+
- DEVICE_SERIAL:RealSense 相机的序列号
36+
- ARM_IP:机械臂的 IP 地址
37+
- ARM_PORT:机械臂的端口号
38+
39+
## 开始数据采集
40+
激活环境
4341
```
4442
cd /path/to/your/RoboDriver
4543
source .venv/bin/activate
4644
```
47-
Start Dora
45+
46+
启动 Dora 服务
4847
```
4948
dora up
5049
```
51-
Start dataflow
50+
51+
启动数据流
5252
```
53-
cd /path/to/your/robodriver-robot-realman1-aio-dora
53+
cd /path/to/your/RoboDriver/robodriver/robots/robodriver-robot-realman1-aio-dora
5454
dora start dora/dataflow.yml --uv
5555
```
56-
Launch RoboXStudio
56+
57+
启动 RoboDriver 主程序
5758
```
5859
cd /path/to/your/RoboDriver
5960
source .venv/bin/activate
6061
python robodriver/scripts/run.py \
6162
--robot.type=realman1_aio_dora
6263
```
6364

64-
## Bug Fixes
65-
1. Rerun video replay failure:
66-
Edit `RoboDriver/robodriver/core/coordinator.py`, change `visual_worker(mode="distant")` to `mode="local"`.
65+
## 问题修复
66+
1. 视频回放功能重新运行失败:
67+
编辑 `RoboDriver/robodriver/core/coordinator.py` 文件,将 `visual_worker(mode="distant")` 中的模式改为 `mode="local"`
6768

68-
2. OpenCV cvShowImage error on launch (`python robodriver/scripts/run.py --robot.type=realman1_aio_dora`):
69-
Comment out `cv2.imshow(key, img)` and `cv2.waitKey(1)` in `robodriver/scripts/run.py`.
69+
2. 启动时出现 OpenCV cvShowImage 错误(执行 `python robodriver/scripts/run.py --robot.type=realman1_aio_dora` 时):
70+
注释掉 `robodriver/scripts/run.py` 文件中的 `cv2.imshow(key, img)` `cv2.waitKey(1)` 两行代码。
7071

72+
## 数据说明
73+
RealMan 机械臂的数据由 Dora 节点进行传输。每个机械臂节点会发送**14 维数据信息**,具体组成如下:
7174

72-
## Data Information
73-
RealMan robotic arm data is transmitted by the Dora node. Each robotic arm node sends **14-dimensional information** with the following composition:
75+
- 关节角度:1-7 号关节的角度值(7 维)
76+
- 夹爪状态:夹爪的开合程度
77+
- 末端执行器位姿:末端欧拉角(3 维,分别表示绕 X/Y/Z 轴的旋转角度)
78+
**如需修改数据信息,可调整 dataflow.yml 和 config.py 文件**
7479

75-
- Joint angles: Values of joints 1-7 (7 dimensions)
76-
- Gripper state: Gripper opening/closing degree
77-
- End-effector pose: End Euler angles (3 dimensions, representing rotation around X/Y/Z axes) \
78-
**When you need to modify the data information, you can modify dataflow.yml and config.py**
80+
### 总结
81+
1. 部署流程分为克隆代码、安装双环境(RoboDriver 主环境 + realman1-aio-dora 模块环境)、配置核心参数三步;
82+
2. 启动采集需依次激活环境、启动 Dora 服务、运行数据流、启动主程序;
83+
3. 已知两个常见问题的修复方案:修改视频回放模式、注释 OpenCV 显示代码;
84+
4. 机械臂传输 14 维数据,核心维度包含关节角度、夹爪状态和末端位姿,可通过配置文件调整数据结构。
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# robodriver-robot-realman1-aio-dora
2+
## Get Start
3+
Clone the repository
4+
```
5+
git clone https://github.com/FlagOpen/RoboDriver.git
6+
```
7+
8+
Install the project to Robodriver
9+
```
10+
cd /path/to/your/RoboDriver
11+
pip install uv
12+
uv venv .venv -p 3.10
13+
source .venv/bin/activate
14+
uv pip install -e .[hardware]
15+
```
16+
17+
Install the project to robodriver-robot-realman1-aio-dora
18+
```
19+
cd /path/to/your/RoboDriver/robodriver/robots/robodriver-robot-realman1-aio-dorarobodriver-robot-realman1-aio-dora
20+
uv venv .venv -p 3.9
21+
uv pip install -e .
22+
source .venv/bin/activate
23+
```
24+
25+
Configure the dataflow.yml
26+
```
27+
cd /path/to/your/RoboDriver/robodriver/robots/robodriver-robot-realman1-aio-dorarobodriver-robot-realman1-aio-dora
28+
cd dora
29+
```
30+
31+
Open the dataflow.yml file, then modify the VIRTUAL_ENV path, as well as DEVICE_SERIAL, ARM_IP, and ARM_PORT.
32+
### Parameter explanation:
33+
34+
- VIRTUAL_ENV: The path of the virtual environment used by the realman dora node
35+
- DEVICE_SERIAL: Serial number of the RealSense camera
36+
- ARM_IP: IP of the robotic arm
37+
- ARM_PORT: PORT of the robotic arm
38+
39+
## Start collecting
40+
Activate environment
41+
```
42+
cd /path/to/your/RoboDriver
43+
source .venv/bin/activate
44+
```
45+
46+
Start Dora
47+
```
48+
dora up
49+
```
50+
51+
Start dataflow
52+
```
53+
cd /path/to/your/RoboDriver/robodriver/robots/robodriver-robot-realman1-aio-dorarobodriver-robot-realman1-aio-dora
54+
dora start dora/dataflow.yml --uv
55+
```
56+
57+
Launch RoboDriver
58+
```
59+
cd /path/to/your/RoboDriver
60+
source .venv/bin/activate
61+
python robodriver/scripts/run.py \
62+
--robot.type=realman1_aio_dora
63+
```
64+
65+
## Bug Fixes
66+
1. Rerun video replay failure:
67+
Edit `RoboDriver/robodriver/core/coordinator.py`, change `visual_worker(mode="distant")` to `mode="local"`.
68+
69+
2. OpenCV cvShowImage error on launch (`python robodriver/scripts/run.py --robot.type=realman1_aio_dora`):
70+
Comment out `cv2.imshow(key, img)` and `cv2.waitKey(1)` in `robodriver/scripts/run.py`.
71+
72+
73+
## Data Information
74+
RealMan robotic arm data is transmitted by the Dora node. Each robotic arm node sends **14-dimensional information** with the following composition:
75+
76+
- Joint angles: Values of joints 1-7 (7 dimensions)
77+
- Gripper state: Gripper opening/closing degree
78+
- End-effector pose: End Euler angles (3 dimensions, representing rotation around X/Y/Z axes) \
79+
**When you need to modify the data information, you can modify dataflow.yml and config.py**

robodriver/robots/robodriver-robot-realman1-aio-dora/dora/dataflow.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ nodes:
77
- image
88
- image_depth
99
env:
10-
VIRTUAL_ENV: /home/rm/robodriver-robot-realman1-aio-dora/.venv
10+
VIRTUAL_ENV: ../.venv
1111
DEVICE_SERIAL: 150622072280
1212
IMAGE_WIDTH: 640
1313
IMAGE_HEIGHT: 480
@@ -20,7 +20,7 @@ nodes:
2020
- image
2121
- image_depth
2222
env:
23-
VIRTUAL_ENV: /home/rm/robodriver-robot-realman1-aio-dora/.venv
23+
VIRTUAL_ENV: ../.venv
2424
DEVICE_SERIAL: 216322070529
2525
IMAGE_WIDTH: 640
2626
IMAGE_HEIGHT: 480
@@ -33,36 +33,36 @@ nodes:
3333
- image
3434
- image_depth
3535
env:
36-
VIRTUAL_ENV: /home/rm/robodriver-robot-realman1-aio-dora/.venv
36+
VIRTUAL_ENV: ../.venv
3737
DEVICE_SERIAL: 152222072189
3838
IMAGE_WIDTH: 640
3939
IMAGE_HEIGHT: 480
4040

4141
- id: arm_realman1_aio_left
42-
path: nodes/dora_arm_realman/dora_arm_realman/main.py
43-
build: pip install -e nodes/dora_arm_realman
42+
path: ../../../../components/arms/dora-arm-realman/dora_arm_realman/main.py
43+
build: pip install -e ../../../../components/arms/dora-arm-realman/dora_arm_realman
4444
inputs:
4545
get_joint: dora/timer/millis/33
4646
action_joint: realman1_aio_dora/action_joint
4747
outputs:
4848
- joint
4949
env:
50-
VIRTUAL_ENV: /home/rm/robodriver-robot-realman1-aio-dora/.venv
50+
VIRTUAL_ENV: ../.venv
5151
ARM_IP: 169.254.128.18
5252
ARM_PORT: 8080
5353
ARM_NAME: RealMan-aio-left
5454
ARM_ROLE: aio
5555

5656
- id: arm_realman1_aio_right
57-
path: nodes/dora_arm_realman/dora_arm_realman/main.py
58-
build: pip install -e nodes/dora_arm_realman
57+
path: ../../../../components/arms/dora-arm-realman/dora_arm_realman/main.py
58+
build: pip install -e ../../../../components/arms/dora-arm-realman/dora_arm_realman
5959
inputs:
6060
get_joint: dora/timer/millis/33
6161
action_joint: realman1_aio_dora/action_joint
6262
outputs:
6363
- joint
6464
env:
65-
VIRTUAL_ENV: /home/rm/robodriver-robot-realman1-aio-dora/.venv
65+
VIRTUAL_ENV: ../.venv
6666
ARM_IP: 169.254.128.19
6767
ARM_PORT: 8080
6868
ARM_NAME: RealMan-aio-right

robodriver/robots/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ def make_robot_from_config(config: RobotConfig) -> Robot:
4646

4747
def safe_update_status(robot: Robot) -> str:
4848
if hasattr(robot, "update_status"):
49-
robot.update_status()
49+
return robot.update_status()
5050
else:
5151
return RobotStatus().to_json()

0 commit comments

Comments
 (0)