RI SDK wrapper (autogenerated)
Parse RI SDK docs (https://docs.robointellect.ru/) and autogen Python wrapper.
TODO:
- coverage for ri_sdk_codegen
Install
pip install ri-sdk
Run
Other examples
- GUI Control (PyQt / PySide) example: https://github.com/mahenzon/robohand-gui-control
Minimal example
Full example at examples/robohand-example.py.
Another example with RoboHand class at examples/robohand-class-example.py.
"""
Смотри полный пример в папке examples
"""
from ri_sdk import RoboIntellectSDK, contrib
lib = contrib.get_lib()
ri_sdk = RoboIntellectSDK(
lib=lib,
setup_methods_args=True,
)
ri_sdk.init_sdk(log_level=1)
# pwm_descriptor = init_pwm(ri_sdk)
pwm_descriptor = 0
# i2c_descriptor = init_i2c(ri_sdk, pwm_descriptor)
i2c_descriptor = 0
# led_descriptor = init_led(ri_sdk, pwm_descriptor)
led_descriptor = 0
# Устанавливаем фиолетовый цвет светодиода
ri_sdk.exec_rgb_led_single_pulse(
descriptor=led_descriptor,
r=255,
g=0,
b=255,
duration=0,
run_async=True,
)
# инициализируем сервоприводы
# init_servos(ri_sdk, pwm_descriptor)
# переводим сервоприводы в стартовое положение
# servos_to_start_position(ri_sdk)
servo_rotate_descriptor = 0
# поворачиваем башню на угол 60 со скоростью 30
ri_sdk.exec_servo_drive_turn_with_relative_speed(
descriptor=servo_rotate_descriptor,
# угол 60º
angle=60,
# скорость в градусах в секунду
speed=30,
)
# готовимся к завершению, включаем красный свет
ri_sdk.exec_rgb_led_single_pulse(
descriptor=led_descriptor,
r=255,
g=0,
b=0,
duration=0,
run_async=True,
)
# Красиво завершаем работу через destruct
# destruct(
# ri_sdk=ri_sdk,
# led_descriptor=led_descriptor,
# pwm_descriptor=pwm_descriptor,
# i2c_descriptor=i2c_descriptor,
# )
ri_sdk.destroy_sdk(is_force=True)
Notes
Features to implement
- TODO: handy angle control (like in adafruit-servokit)
- TODO: code tests coverage
Codegen
Install dependencies
poetry install
Full RI SDK codegen:
main.py --update-links --parse-docs --remove-unknown-methods-cache --generate-sdk
Each stage can be used separately:
--update-links--parse-docs [--remove-unknown-methods-cache]--generate-sdk
Add -v flag for verbose output.
Testing
Run tests
hatch run test:run
Run coverage
hatch run test:cov
Run coverage and export html report
hatch run test:cov-html
Metadata
Release files for ri-sdk 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ri_sdk-1.1.1.tar.gz | 38.3 kB | Without provenance | Details for ri_sdk-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ri_sdk-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for ri_sdk-1.1.1-py3-none-any.whl |
Total release size: 105.5 kB
Release files / ri_sdk-1.1.1.tar.gz
| Download URL | ri_sdk-1.1.1.tar.gz |
|---|---|
| Size | 38.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
359a9fda74bf92c85d839823aa4c58578662de1e343434442697e9ef3eaaf21e
|
|
BLAKE2b-256 checksum How to use checksums |
db3ef53a62465e4ece2d4971bc0d5e93111d69ba908817e996877495e1af85fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / ri_sdk-1.1.1-py3-none-any.whl
| Download URL | ri_sdk-1.1.1-py3-none-any.whl |
|---|---|
| Size | 67.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6a9468a9761e0351ca65e380391128ba87b44d16b381bc01a2ea358409a6a72
|
|
BLAKE2b-256 checksum How to use checksums |
bc9c35a0de92901a4f34f4aa17430f4b62d76697d7aeea4ef68dd831eaafed97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for ri-sdk 1.1.1
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.