Skip to main content

python API for Buildit Actuator (For Buildit Actuator v1.0.1 and above

Project description

Buildit

Buildit Actuator を制御する為のPython3用ライブラリ

Install

Windows

$ pip3 install pybuildit2

Ubuntu

$ sudo apt-get -y install python3-tk
$ pip3 install pybuildit2

Usage

pybuildit2 library

>>> from pybuildit2 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

pybuildit2-1.0.0.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybuildit2-1.0.0-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file pybuildit2-1.0.0.tar.gz.

File metadata

  • Download URL: pybuildit2-1.0.0.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.2 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9

File hashes

Hashes for pybuildit2-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8d0eea30b2fc3758f26e3624d4d4e9866a2b067ac6f241640b9f6bbcd050e428
MD5 e91389dce4fca690753ad4623d47869e
BLAKE2b-256 6e7451f5c590ddb02c3ca6d6c52aa7b2d560421a3efaea7e2ffaa323f5748019

See more details on using hashes here.

File details

Details for the file pybuildit2-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pybuildit2-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.2 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9

File hashes

Hashes for pybuildit2-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0270d24fa82e31cd479056238025ba2e48f58e12c30235bf3b8c3ab041047c47
MD5 c7464c8cdb399f4527bd6baec4af8df9
BLAKE2b-256 3a167ec4283bee92281d0ac5923169137cf7de82f0508d8ded33b329a3d830ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page