Skip to main content

AmarettoPy

Python library to control Buildit servo actuators (only for python3)

Install

Windows

$ pip3 install amarettopy

Ubuntu

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

Usage

amarettopy library

>>> from amarettopy import *
>>> amaretto = AmarettoPy(port="/dev/ttyXXXX", timeout_ms=3000) #for Linux
>>> amaretto = AmarettoPy(port="COMX", timeout_ms=3000) #for Win
>>> deviceId = 1
  • 現在の位置や速度といった情報の取得
>>> (position, velocity, current, referenceValue, temperature, faults) = amaretto.query_servo_status(deviceId)
>>> print(state2str(amaretto.state()))
  • 速度制御と位置制御の方法
>>> #amaretto.clear_fault(deviceId)
>>> amaretto.ready(deviceId)
>>> amaretto.set_ref_velocity(deviceId, fromRPM(42.5))
>>> amaretto.set_ref_position(deviceId, fromDegree(180))

amrtctl

amrtctl は AmarettoPy の各メソッドをコマンドラインから呼び出す為のツールです。 アクチュエーターの状態を確認する場合は以下のように実行します。

$ amrtctl query-servo-status -d 1 -p /dev/ttyUSB0
state: STATE_HOLD
pos: -51636
vel: 0
cur: 0
ref: 0
temp: 26
faults: NO_FAULTS

速度制御を行う場合は以下のように実行します。

$ amrtctl ready -d 1 -p /dev/ttyUSB0

$ amrtctl set-ref-velocity 2500 -d 1 -p /dev/ttyUSB0 # 指定速度の単位は [rpm/100]
0

位置制御を行う場合は以下のように実行します。

$ amrtctl stop -d 1 -p /dev/ttyUSB0

$ amrtctl set-ref-position 2500 -d 1 -p /dev/ttyUSB0 # 指定位置の単位は [360/65536 度]
-39775

amrtct-gui

amrtctl は AmarettoPy の各メソッドをコマンドラインから呼び出す為のツールです。

$ amrtctl-gui

ポートを選択し、Connectボタンを押した後、各種ボタンを使ってデバイスを操作することが出来ます。

Metadata

Release files for amarettopy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amarettopy 0.1.0
File Size Uploaded Provenance Actions
amarettopy-0.1.0.tar.gz 27.1 kB Without provenance Details for amarettopy-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amarettopy 0.1.0
File Interpreter ABI Platform Actions
amarettopy-0.1.0-py3-none-any.whl Python 3 none any Details for amarettopy-0.1.0-py3-none-any.whl

Total release size: 60.9 kB

Release files / amarettopy-0.1.0.tar.gz

Download URL amarettopy-0.1.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3f4e4ee4bce81a69c7ae1a98622e22c430edf10a6beec072764e68a07087c672
BLAKE2b-256 checksum
How to use checksums
f4717d393f2e6a284e3a8635bb387178988cd43349c9f4374e4fd07afbe5ba55
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / amarettopy-0.1.0-py3-none-any.whl

Download URL amarettopy-0.1.0-py3-none-any.whl
Size 33.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c0c1b59a27cdc0521083268357a16885662a36822dfdd8de0694b972ec1c200
BLAKE2b-256 checksum
How to use checksums
251858e663dd7c1f3c7fdaaaa393d0e6c95805331078075e750fe2555130500b
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for amarettopy 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page