Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LinkerHand/config/setting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LINKER_HAND: # 手部配置信息
LEFT_HAND:
EXISTS: False # 是否存在左手
TOUCH: True # 是否有压力传感器
CAN: "can0" # 配置CAN端口 默认can0 如果MODUBS不为"None",则CAN配置失效。 如果是win系统则类似于 PCAN_USBBUS1。注:蓝色盒子为Linux下can0,WIN下位PCAN_USBBUS1。透明盒子Linux下为can0,WIN下为0
CAN: "can0" # 配置CAN端口 默认can0 如果MODUBS不为"None",则CAN配置失效。 如果是win系统则类似于 PCAN_USBBUS1。注:蓝色盒子为Linux下can0,WIN下为PCAN_USBBUS1。透明盒子Linux下为can0,WIN下为0
MODBUS: "None" # 通讯协议是否为485 默认None 如果启动485,则是设备端口 /dev/ttyUSB* CAN配置失效 当前只支持O6/L6.后续版本正在努力增加中
JOINT: O6 # 左手型号 O6/L6/L7/L10/L20/G20/L21/L25/
NAME: # 默认值,不用修改
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ LinkerHand Python SDK
- download

```bash
$ git clone https://github.com/linker-bot/linkerhand-python-sdk.git
git clone https://github.com/linker-bot/linkerhand-python-sdk.git
```

- install

```bash
$ cd linkerhand-python-sdk/
$ pip3 install -r requirements.txt
cd linkerhand-python-sdk/
pip3 install -r requirements.txt
```

- 快速使用示例 by CAN
- Quick Start Example via CAN
Edit the config/setting.yaml configuration file and modify the parameters according to the comments inside. Set CAN:"can0" and Set MODBUS: "None"
```bash
# Open the CAN port
$ sudo /usr/sbin/ip link set can0 up type can bitrate 1000000 # USB-to-CAN device blue light stays solid. This step can be skipped on Ubuntu systems after modifying setting.ymal as required.
$ cd examples/gui_control
$ sudo chmod a+x gui_control.py
$ python3 gui_control.py
sudo /usr/sbin/ip link set can0 up type can bitrate 1000000 # USB-to-CAN device blue light stays solid. This step can be skipped on Ubuntu systems after modifying setting.ymal as required.
cd example/gui_control
sudo chmod a+x gui_control.py
python3 gui_control.py
```
<img src="doc/gui.png" width="400">

Expand Down
28 changes: 14 additions & 14 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ $ git clone https://github.com/linker-bot/linkerhand-python-sdk.git
- install

```bash
$ cd linkerhand-python-sdk/
cd linkerhand-python-sdk/
# win下需要安装python-can-candle用于适配透明CAN设备candle协议
$ pip install python-can
$ pip install python-can-candle
$ pip3 install -r requirements.txt
pip install python-can
pip install python-can-candle
pip3 install -r requirements.txt
```

- 快速使用示例 by CAN
编辑config/setting.yaml配置文件,按照配置文件内注释说明进行参数修改,配置CAN: "can0"(根据实际硬件情况来确定,一般第一个为can0),配置MODBUS:"None"
```bash
# Open the CAN port
$ sudo /usr/sbin/ip link set can0 up type can bitrate 1000000 # USB-to-CAN device blue light stays solid. This step can be skipped on Ubuntu systems after modifying setting.ymal as required.
$ cd examples/gui_control
$ sudo chmod a+x gui_control.py
$ python3 gui_control.py
sudo /usr/sbin/ip link set can0 up type can bitrate 1000000 # USB-to-CAN device blue light stays solid. This step can be skipped on Ubuntu systems after modifying setting.ymal as required.
cd example/gui_control
sudo chmod a+x gui_control.py
python3 gui_control.py
```
<img src="doc/gui.png" width="400">

Expand All @@ -56,15 +56,15 @@ modbus: "None" or "/dev/ttyUSB0"
```bash
# 确保requirements.txt安装依赖
# 安装系统级相关驱动
$ pip install minimalmodbus --break-system-packages
$ pip install pyserial --break-system-packages
$ pip install pymodbus --break-system-packages
pip install minimalmodbus --break-system-packages
pip install pyserial --break-system-packages
pip install pymodbus --break-system-packages
# 查看USB-RS485端口号
$ ls /dev
ls /dev
# 可以看到类似ttyUSB0端口后给端口执行权限
$ sudo chmod 777 /dev/ttyUSB0
sudo chmod 777 /dev/ttyUSB0
# GUI控制示例
$ python3 example/gui_control/gui_control.py
python3 example/gui_control/gui_control.py

```

Expand Down