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
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Python bytecode/cache files
__pycache__/
*.py[cod]
*$py.class

# Python build/package artifacts
build/
dist/
*.egg-info/
*.egg

# Python tooling caches
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
htmlcov/

# Virtual environments
.venv/
venv/
env/

# Local agent/tooling state
.omx/
Binary file removed LinkerHand/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file removed LinkerHand/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed LinkerHand/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed LinkerHand/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed LinkerHand/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed LinkerHand/core/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file removed LinkerHand/core/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed LinkerHand/core/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed LinkerHand/core/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed LinkerHand/core/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed LinkerHand/core/can/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/mapping.cpython-310.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/mapping.cpython-311.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/mapping.cpython-312.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/mapping.cpython-38.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/mapping.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/open_can.cpython-38.pyc
Binary file not shown.
Binary file removed LinkerHand/utils/__pycache__/open_can.cpython-39.pyc
Binary file not shown.
8 changes: 4 additions & 4 deletions LinkerHand/utils/mapping.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#---------------------------------------------------------------------------------------------------
# L6 L
l6_l_min = [0, 0, 0, 0, 0, 0]
l6_l_max = [0.99, 1.39, 1.26, 1.26, 1.26, 1.26]
l6_l_min = [0, -0.087266, 0, 0, 0, 0]
l6_l_max = [0.837758, 1.256637, 1.134464, 1.134464, 1.134464, 1.134464]
l6_l_derict = [-1, -1, -1, -1, -1, -1]
# L6 R
l6_r_min = [0, 0, 0, 0, 0, 0]
l6_r_max = [0.99, 1.39, 1.26, 1.26, 1.26, 1.26]
l6_r_min = [0, -0.087266, 0, 0, 0, 0]
l6_r_max = [0.837758, 1.256637, 1.134464, 1.134464, 1.134464, 1.134464]
l6_r_derict = [-1, -1, -1, -1, -1, -1]
#---------------------------------------------------------------------------------------------------
# O6 L
Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LinkerHand Python SDK


## Installation
  You can run the examples after installing the dependencies in requirements.txt. Only Python 3 is supported.
  You can run the examples after installing the SDK and dependencies from `pyproject.toml`. Only Python 3 is supported.
- download

```bash
Expand All @@ -31,7 +31,7 @@ $ git clone https://github.com/linker-bot/linkerhand-python-sdk.git

```bash
$ cd linkerhand-python-sdk/
$ pip3 install -r requirements.txt
$ pip install -e ".[all]"
```

- 快速使用示例 by CAN
Expand All @@ -50,11 +50,8 @@ $ python3 gui_control.py
Edit the config/setting.yaml configuration file and modify the parameters according to the comments inside. Set MODBUS: "/dev/ttyUSB0", meaning the "modbus" parameter in the configuration file should be "/dev/ttyUSB0". The USB-RS485 converter usually appears as /dev/ttyUSB* or /dev/ttyACM* on Ubuntu.
modbus: "None" or "/dev/ttyUSB0"
```bash
# Ensure requirements.txt dependencies are installed
# Install system-level related drivers
$ pip install minimalmodbus --break-system-packages
$ pip install pyserial --break-system-packages
$ pip install pymodbus --break-system-packages
# Ensure the SDK and dependencies are installed from pyproject.toml
$ pip install -e ".[all]"
# View the USB-RS485 port number
$ ls /dev
# You should see a port similar to ttyUSB0. Grant permissions to the port:
Expand Down Expand Up @@ -154,5 +151,3 @@ When launched, a UI interface will pop up. You can control the corresponding Lin
## API Documentation
[Linker Hand API for Python Document](doc/API-Reference.md)



34 changes: 14 additions & 20 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@
| ROS SDK | ![SDK Version](https://img.shields.io/badge/SDK%20Version-V3.0.1-brightgreen?style=flat-square) ![Python 3.8+](https://img.shields.io/badge/Python-3.8%2B-blue?style=flat-square&logo=python&logoColor=white) ![Ubuntu 20.04+](https://img.shields.io/badge/OS-Ubuntu%2020.04%2B-E95420?style=flat-square&logo=ubuntu&logoColor=white) ![ROS Noetic](https://img.shields.io/badge/ROS-Noetic-009624?style=flat-square&logo=ros) | [![GitHub 仓库](https://img.shields.io/badge/GitHub-grey?logo=github&style=flat-square)](https://github.com/linker-bot/linkerhand-ros-sdk) |
| ROS2 SDK | ![SDK Version](https://img.shields.io/badge/SDK%20Version-V3.0.1-brightgreen?style=flat-square) ![Python 3.11](https://img.shields.io/badge/Python-3.11-3776AB?style=flat-square&logo=python&logoColor=white) ![Ubuntu 24.04](https://img.shields.io/badge/OS-Ubuntu%2024.04-E95420?style=flat-square&logo=ubuntu&logoColor=white) ![ROS 2 Jazzy](https://img.shields.io/badge/ROS%202-Jazzy-00B3E6?style=flat-square&logo=ros) ![Windows 11](https://img.shields.io/badge/OS-Windows%2011-0078D4?style=flat-square&logo=windows&logoColor=white) | [![GitHub 仓库](https://img.shields.io/badge/GitHub-grey?logo=github&style=flat-square)](https://github.com/linker-bot/linkerhand-ros2-sdk) |

## Installation
  您可以在安装requirements.txt后的情况下运行示例。仅支持 Python3。
## Installation
  您可以通过 `pyproject.toml` 安装 SDK 及其依赖后运行示例。仅支持 Python3。
- download

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

- install

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

- install

```bash
$ cd linkerhand-python-sdk/
$ pip install -e ".[all]"
```

- 快速使用示例 by CAN
编辑config/setting.yaml配置文件,按照配置文件内注释说明进行参数修改,配置CAN: "can0"(根据实际硬件情况来确定,一般第一个为can0),配置MODBUS:"None"
Expand All @@ -53,12 +50,9 @@ $ python3 gui_control.py

编辑config/setting.yaml配置文件,按照配置文件内注释说明进行参数修改,将MODBUS:"/dev/ttyUSB0",配置文件中"modbus"参数为"/dev/ttyUSB0"。USB-RS485转换器在Ubuntu上一般显示为/dev/ttyUSB* or /dev/ttyACM*
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
```bash
# 确保已通过 pyproject.toml 安装 SDK 及依赖
$ pip install -e ".[all]"
# 查看USB-RS485端口号
$ ls /dev
# 可以看到类似ttyUSB0端口后给端口执行权限
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "linkerhand-python-sdk"
version = "3.1.0"
description = "Python SDK for LinkerHand dexterous hands."
readme = "README.md"
requires-python = ">=3.8"
authors = [
{ name = "Linker Hand" },
]
dependencies = [
"python-can",
"python-can-candle",
"pymodbus==3.5.1",
"pyserial",
"numpy",
"PyYAML",
]

[project.optional-dependencies]
all = [
"PyQt5",
"pyqtgraph",
"matplotlib",
"dm-control",
"dm-env",
"pyagxrobots",
"pyquaternion",
"h5py",
"ipython",
"mediapipe",
"minimalmodbus",
"pexpect",
"pycryptodome",
"tqdm",
"uvicorn",
"wandb",
]

[project.urls]
Homepage = "https://github.com/linker-bot/linkerhand-python-sdk"
Documentation = "https://github.com/linker-bot/linkerhand-python-sdk/blob/main/doc/API-Reference.md"

[tool.setuptools.packages.find]
include = ["LinkerHand*"]

[tool.setuptools.package-data]
"LinkerHand.config" = ["*.yaml"]
21 changes: 0 additions & 21 deletions requirements.txt

This file was deleted.