Fast Wonder SDK
The Fast Wonder SDK is a Python library that facilitates communication with the Hiwonder TurboPi controller. It provides easy-to-use functions for controlling various peripherals such as RGB LEDs, buzzers, infrared sensors, and more, while ensuring reliable communication with checksum validation using CRC-8.
Features
- Control RGB LEDs: Easily control the colors of RGB LEDs using indexed tuples.
- Control BUZZER: Simple API to control the buzzer.
- Control Infrared Sensors: Interface with infrared sensors to detect obstacles or follow lines.
- Control Motors:
- Reliable Communication: Ensures data integrity with CRC-8 checksum validation for communication.
- Configurable Serial Communication: Adjust serial communication parameters such as baud rate, timeout, etc.
Installation
To get started with Fast Wonder SDK, follow these steps:
- Clone the repository:
git clone https://github.com/dmberezovskyii/fast-hiwonder.git
Usage
- Infra red sensors
from fast_hi_wonder import InfraredSensors # Initialize the sensor with the default I2C address and bus sensors = InfraredSensors() # Read sensor data sensor_states = sensors.read_sensor_data() # Process sensor states for i, state in enumerate(sensor_states): print(f"Sensor {i+1} is {'active' if state else 'inactive'}")
- Mecanum wheels
Polar Coordinates
In polar coordinates, we describe a point (or movement) in space using two parameters:
- Radius (r): The distance from the origin (0,0) to the point.
- Angle (θ): The direction of the point relative to the X-axis (horizontal axis) in degrees or radians.
In the case of your mechanism:
- Velocity: The distance the robot moves per unit of time.
- Direction: The angle at which the robot is moving, measured from the X-axis.
Trigonometry and Coordinate Transformation
To control the robot's movement, we break the velocity down into two components — vx and vy:
- vx: The velocity component along the X-axis (horizontal axis).
- vy: The velocity component along the Y-axis (vertical axis).
To calculate these components, we use trigonometric functions:
-
vx (component along the X-axis) is calculated using the cosine of the direction angle: [ vx = \text{velocity} \times \cos(\text{direction}) ]
-
vy (component along the Y-axis) is calculated using the sine of the direction angle: [ vy = \text{velocity} \times \sin(\text{direction}) ]
Example
If the robot needs to move at a speed of 100 mm/s in the direction of 30 degrees (from the X-axis):
-
( vx = 100 \times \cos(30^\circ) )
-
( vy = 100 \times \sin(30^\circ) )
chassis = Motors() # Move forward at 100 mm/s in the direction of 0 degrees (forward along the X-axis) chassis.set_velocity(100, 0, 0) # Rotate the chassis at an angular rate of 30 degrees per second chassis.set_velocity(100, 0, 30) # Translate the chassis based on Cartesian coordinates (e.g., moving diagonally) chassis.translation(50, 50) # Stop all motors and reset movement attributes chassis.reset_motors()
External Links
You can find more information about the TurboPi robot here.
Metadata
Release files for turbopi-fast-sdk 0.3.6
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 |
|---|---|---|---|---|
| turbopi_fast_sdk-0.3.6.tar.gz | 12.0 kB | Without provenance | Details for turbopi_fast_sdk-0.3.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| turbopi_fast_sdk-0.3.6-py3-none-any.whl | Python 3 | none | any | Details for turbopi_fast_sdk-0.3.6-py3-none-any.whl |
Total release size: 27.3 kB
Release files / turbopi_fast_sdk-0.3.6.tar.gz
| Download URL | turbopi_fast_sdk-0.3.6.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
468611eff25ee94b4de9f25fc6e1023631fd29a4e63259c755513a633db9cfd0
|
|
BLAKE2b-256 checksum How to use checksums |
97a244eac56369278148ba8ae7b4312e588b7504b40aba65b35bb8b014a7b051
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / turbopi_fast_sdk-0.3.6-py3-none-any.whl
| Download URL | turbopi_fast_sdk-0.3.6-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2302639f886c29714dd8ad4bbf803e64ab84a1cf6215a58417e86078a8f0a2c7
|
|
BLAKE2b-256 checksum How to use checksums |
32032017116f7a90c5f10229e1302684913a44c87089c819ac333116327f6182
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for turbopi-fast-sdk 0.3.6
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.