An async TCP client wrapper for controlling a gripper with force sensing and callback support.
Project description
控制抓手 (带力传感器) 的 TCP 客户端
基于独立线程+异步 TCP 客户端,支持回调功能
示例
# Expample:
from lzhgripperwithforcesensor import GripperWithForceSensor
GRIPPER_IP = '192.168.0.123'
gripper = GripperWithForceSensor(host=GRIPPER_IP)
gripper.set_mode(1) # 设置抓取模式 (1~4)
gripper.prepare() # 准备抓取
gripper.grip() # 抓取
gripper.release() # 释放
gripper.force() # 查询力值 (kg)
gripper.force_sensor_zeroing() # 力传感器调零
gripper.status() # 抓手当前状态汇总
# 回调函数相关 (非必须)
def callback(kg: float): # 定义一个回调函数
print(f'New force value print from callback : {kg} kg')
gripper.set_force_callback( # 设置差值模式回调
callback = callback,
callback_threshold = 0.1,
single_callback_mode = False
)
gripper.set_force_callback( # 设置单阈值模式回调
callback = callback,
callback_threshold = 3.0,
single_callback_mode = True
)
安装 - PyPI
pip install lzhgripperwithforcesensor
API
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lzhgripperwithforcesensor-0.1.8.tar.gz.
File metadata
- Download URL: lzhgripperwithforcesensor-0.1.8.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1047408845c72ae19f177aec0da206eee45d94f5b75fe9ebaa0d0bcd03c85cda
|
|
| MD5 |
5eee85b83e9cce1785d88042651939d2
|
|
| BLAKE2b-256 |
b872da85fefb26317c76b9b14a55e923ea7977f1f36a85c4bb97737a93df4a14
|
File details
Details for the file lzhgripperwithforcesensor-0.1.8-py3-none-any.whl.
File metadata
- Download URL: lzhgripperwithforcesensor-0.1.8-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
712d7d210a6d50372ca661bf16e348379332c0730cfd7f2929bbd1f03078947f
|
|
| MD5 |
e69e3239dba11fc748fb75b39f9ba6e6
|
|
| BLAKE2b-256 |
0ef9f7a860f7801fbe5f434a134ba75a4ff34c0e8d0f24b7a38f4738709159d4
|