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 2.34+ or musl 1.2+. 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
These are the currently supported functions. The number shows which RoboClaw commands it uses. You can see a more detailed description in the Roboclaw User Manual
set_speed() 0 / 1 / 4 / 5
drive() 8 / 9
turn() 10 / 11
//Encoders
read_encoder() 16 / 17
read_encoder_speed() 18 / 19
reset_encoders() 20
set_encoder() 22 / 23
read_raw_speed() 30 / 31
read_avg_speed() 108
read_speed_error() 111
read_position_error() 114
//Advanced motor controls
set_velocity_pid() 28 / 29
set_speed_duty() 32 / 33
drive_duty() 34
//Advanced Commands
set_serial_timeout() 14
read_serial_timeout() 15
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.9.3-cp37-abi3-win_amd64.whl.
File metadata
- Download URL: roboclaw_python-0.9.3-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 171.7 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 |
eb490fb324233e2f80e492100602a67dd206c30c9c4dc1117c7d80d87d8ced68
|
|
| MD5 |
e76b8dea84deb8855b23bc4af2348c90
|
|
| BLAKE2b-256 |
ee0039e06426d7ac22caf0ff94e1bc22f0effa9ece680333e4b43c3c52ced743
|
File details
Details for the file roboclaw_python-0.9.3-cp37-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: roboclaw_python-0.9.3-cp37-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 410.7 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 |
f9cb84847279e47d12bfd1e6ef545ae8034f20f95097d744b555eadec177aa93
|
|
| MD5 |
87e8d8bc8baebf0f9f6b08d442b7fc7e
|
|
| BLAKE2b-256 |
f7e19357edb32ee0fc0b337078e7b9c0491448f012ea71592fb063033d67ac55
|
File details
Details for the file roboclaw_python-0.9.3-cp37-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: roboclaw_python-0.9.3-cp37-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 390.4 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 |
193b43cd8104691fc3c1c8b755ce140c939f14dd266f1915cf44103c0a334abd
|
|
| MD5 |
f29091ebc14e7b0a38c02c973b7b2879
|
|
| BLAKE2b-256 |
079c33937dd2b69c3a9dc44518492b2cb31d079c92fc93413e43b66535143dc4
|
File details
Details for the file roboclaw_python-0.9.3-cp37-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: roboclaw_python-0.9.3-cp37-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 441.4 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 |
5319ecba4e0b5a9d9bd6b139c2e772d39beeb83b04f5b342afe9b224281c057a
|
|
| MD5 |
a0958a26981ab7af8f558e11b0c5f861
|
|
| BLAKE2b-256 |
1af927b45709718b28d8f1d2e21bbef369e9720c3382d125ee609449e3fc43ea
|
File details
Details for the file roboclaw_python-0.9.3-cp37-abi3-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: roboclaw_python-0.9.3-cp37-abi3-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 441.6 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 |
117330fc976519c15107045894b693a215bbf1dae2efed596f0dc4550f49f699
|
|
| MD5 |
66e0704384a80f24ad29420fbe5c1f8f
|
|
| BLAKE2b-256 |
d8d5067a1490d2b50686cfcfac6fe5ff41ea41f37cc1fc6fa5e096b201d4ac29
|