python API for Buildit Actuator
Project description
Buildit
Buildit Actuator を制御する為のPython3用ライブラリ
Install
Windows
$ pip3 install pybuildit
Ubuntu
$ sudo apt-get -y install python3-tk
$ pip3 install pybuildit
Usage
pybuildit library
-
ライブラリについてのドキュメント
-
初期化
- ※ 以下のデバイスファイル名やCOMポート番号は環境に合わせて変更する必要があります
>>> from pybuildit import *
>>> buildit = Buildit(port="/dev/ttyXXXX") #for Linux (例: /dev/ttyUSB0)
>>> buildit = Buildit(port="COMX") #for Win (例:COM8)
>>> deviceId = 1
- 現在の位置や速度といった情報の取得
>>> qss = buildit.query_servo_status(deviceId)
>>> print("position[deg]: ", qss.position(unit="deg"))
>>> print("velocity[rpm]: ", qss.velocity(unit="rpm"))
>>> print("temperature[℃]: ", qss.temperature())
>>> print("state: ", buildit.last_mcp_status().str_state())
- 速度制御と位置制御の方法
>>> buildit.force_ready(deviceId)
>>> buildit.set_ref_velocity(deviceId, 40, unit="rpm")
>>> buildit.set_ref_position(deviceId, 180, unit="deg")
builditctl
builditctl は Buildit の各メソッドをコマンドラインから呼び出す為のツールです。 アクチュエーターの状態を確認する場合は以下のように実行します。
$ builditctl query-servo-status -d 1 -p /dev/ttyXXXX
state: STATE_HOLD
pos: -51636
vel: 0
cur: 0
ref: 0
temp: 26
faults: NO_FAULTS
速度制御を行う場合は以下のように実行します。
$ builditctl ready -d 1 -p /dev/ttyXXXX
$ builditctl set-ref-velocity 2500 -d 1 -p /dev/ttyXXXX # 指定速度の単位は [rpm/100]
0
位置制御を行う場合は以下のように実行します。
$ builditctl stop -d 1 -p /dev/ttyXXXX
$ builditctl set-ref-position 2500 -d 1 -p /dev/ttyXXXX # 指定位置の単位は [360/65536 度]
-39775
builditct-gui
builditctl は Buildit の各メソッドをコマンドラインから呼び出す為のツールです。
$ builditctl-gui
ポートを選択し、Connectボタンを押した後、各種ボタンを使ってデバイスを操作することが出来ます。
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 pybuildit-1.0.1.tar.gz.
File metadata
- Download URL: pybuildit-1.0.1.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
644faf3fe23e9f6db19c9c76b54263114d992e5020dd206e712af40e64522667
|
|
| MD5 |
14694e73a2c7c21aafcee6d05ebb3fe7
|
|
| BLAKE2b-256 |
b450439eaa9edbf676fec4d1d9757a2177837ac3ab1b98048313fb20900d63e0
|
File details
Details for the file pybuildit-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pybuildit-1.0.1-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeb71d4128fa0f7f680a56c1d85d47696145779fe3008543594eabea95e61ff3
|
|
| MD5 |
85cbfc0fef5a4eee92dc6080b915f3f8
|
|
| BLAKE2b-256 |
b074a898bdbf5743fe7ab9bddc342308cb1be8c968e725f89c04a2bb0cbb763b
|