No project description provided
Project description
RoboClaw Encoder Interface
This project provides an interface for controlling and reading encoder values from RoboClaw motor controllers. It allows you to set motor speeds, control motor movement, and read encoder values with proper handling of overflow, underflow, and direction. Features
Control Motors: Set speed for individual motors (M1, M2).
Drive Both Motors: Control both motors at the same time with forward or backward movement.
Turn Both Motors: Control turning by adjusting motor speeds in opposite directions.
Read Encoder: Accurately read encoder values, adjusting for overflow and underflow.
System Requirements
This library works on windows x86, linux x86 and linux aarch64 machines. Linux supports glibc or musl. Python version needs to be 3.7 or higher.
Installation
pip install roboclaw-python
Usage
Example in Python using the PyO3 bindings
from roboclaw_python import RoboClaw, Motor
Initialize RoboClaw
roboclaw = RoboClaw(port_name="/dev/ttyUSB0", baud_rate=115200, timeout=20, retries=128, address=128)
Set motor speed
roboclaw.set_speed(Motor.M1, 100)
Read encoder value
encoder_value_m1 = roboclaw.read_encoder(Motor.M1)
print(f"Motor M1 Encoder: {encoder_value_m1}")
Currently supported
set_speed() M1 + M2 Forward and Backwards
drive() Both motors forwards and backwards at the same time
turn() Turn one or the other motor
//Encoders
read_encoder() Reads the encoder of a specified motor
read_encoder_speed() Read the speed of the encoder in counts per second
reset_encoders() Resets both encoders
set_encoder() Sets the encoder value of a specified motor
read_raw_speed() Reads the raw speed of the encoders
read_avg_speed() Reads the average speed of the encoders
read_speed_error() Reads speed error
read_position_error() Read position error
//Advanced Commands
set_serial_timeout() Sets the serial timeout
read_serial_timeout() Reads the serial timeout
External links
License
This project is licensed under the MIT License.
This is an unofficial roboclaw driver for python. I'm not affiliated with Basic Micro.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 roboclaw_python-0.8.0-cp37-abi3-win_amd64.whl.
File metadata
- Download URL: roboclaw_python-0.8.0-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 169.3 kB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a397a7c709e43c3d2aa5b26fba1b954351740dc52d11a757639433a3af6532d
|
|
| MD5 |
84c0994dcf0c9856ec2c2373c6667a89
|
|
| BLAKE2b-256 |
fc1a211cdbd5d65c540fe67d9a3e1e9de0f3eb3c2dfe2feb2d794753839af1f4
|
File details
Details for the file roboclaw_python-0.8.0-cp37-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: roboclaw_python-0.8.0-cp37-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 408.2 kB
- Tags: CPython 3.7+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe6c51504a8ac74c9320664efb8c956b6cc5b152743e80978ff8e4bfeaad5f76
|
|
| MD5 |
1a68a32b960a263d2d55941d6010a070
|
|
| BLAKE2b-256 |
5dd9c4f7f0804fb9d76d9ee37d4e5ea31e5c5b493f4fba3ada7fdc36a1a45339
|
File details
Details for the file roboclaw_python-0.8.0-cp37-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: roboclaw_python-0.8.0-cp37-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 388.1 kB
- Tags: CPython 3.7+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cda11eadeb6ce11882e64b359226bf8ee8136c5065295cbad4f20f6c4f5171e
|
|
| MD5 |
6193375e475f23d42f323b16fb4362b3
|
|
| BLAKE2b-256 |
4234f51783526deefca4be31799996bae4cfe2ec4a4ee2707e478e14d0a5e4f6
|
File details
Details for the file roboclaw_python-0.8.0-cp37-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: roboclaw_python-0.8.0-cp37-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 438.9 kB
- Tags: CPython 3.7+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1419120e717703cc0e6f9a87bc71fffebdc82470c84a61c4dcb26a1f3829a35a
|
|
| MD5 |
279f23c2f0cbd8c9addcfe203c61364b
|
|
| BLAKE2b-256 |
fcc6e0bbc09a3178eec61ddd709d6d7438257026429ecd1611df6f8d0319c860
|
File details
Details for the file roboclaw_python-0.8.0-cp37-abi3-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: roboclaw_python-0.8.0-cp37-abi3-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 439.2 kB
- Tags: CPython 3.7+, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60b3df83b891fe2bffb20ea3de3e14ce028fc22125c65b0546584562d23167c3
|
|
| MD5 |
b2d8bde9c92a8dabf71365ae9c164db2
|
|
| BLAKE2b-256 |
f35067612ed31e5bd7ad72a5866b01ef8832459df128e9695869e346c8252f18
|