Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

roboclaw_python-0.9.2-cp37-abi3-win_amd64.whl (171.7 kB view details)

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.9.2-cp37-abi3-musllinux_1_2_x86_64.whl (410.5 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ x86-64

roboclaw_python-0.9.2-cp37-abi3-musllinux_1_2_aarch64.whl (390.5 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.9.2-cp37-abi3-manylinux_2_34_x86_64.whl (441.4 kB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ x86-64

roboclaw_python-0.9.2-cp37-abi3-manylinux_2_34_aarch64.whl (441.6 kB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ ARM64

File details

Details for the file roboclaw_python-0.9.2-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.9.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6ce5a9c78f14c309dc81d7c1e9c39e6bf405627474167608277aabd50797fc24
MD5 8ef48ee00c6e051108fb616ee594c93b
BLAKE2b-256 f452b8622cffa4eaa67f8c30fa5597bbe34287eb50c1eb101340960bc8089f13

See more details on using hashes here.

File details

Details for the file roboclaw_python-0.9.2-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.9.2-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 55b8f153aa83c19dbbf66c99a164ea7fbb96d8e320a459237ca3ac26e09f22d8
MD5 151db3b1e6acd5a52acc159bb5dfe47d
BLAKE2b-256 a567ed7434340fd16dd807c340494ab1121903e672c80cb3539237e733e2b04d

See more details on using hashes here.

File details

Details for the file roboclaw_python-0.9.2-cp37-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.9.2-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a707f21211e0c8b5244768c69d8dd3093392be1d98a1e9687a03d34837b0c47e
MD5 f8d5a58fba9e9014a5d1dc8cdf32bd01
BLAKE2b-256 e9bc898558249580a0d4d1164b9972de447ed6425e6c9a09e78e4fa8cdd6ffb3

See more details on using hashes here.

File details

Details for the file roboclaw_python-0.9.2-cp37-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.9.2-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9b384924e03aa44f65f9d0656ad8ef6f3fa313177f9e48a902c1754c7413fb54
MD5 3c01c12cdd4adcb24b162a64b9f8ff97
BLAKE2b-256 3c463152b2eb081c16aaf75599ce8aceca2dabe655f06ae0feee43c1c7d1244f

See more details on using hashes here.

File details

Details for the file roboclaw_python-0.9.2-cp37-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.9.2-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 131f3bb4cd76af9b72d29aadbacafd0af1334bf792b26386d10f4a8385b2dfae
MD5 0d599852cc19715f31d91ff9598f2d2c
BLAKE2b-256 e278f3d513db30a169935cebdeff7429545bfbff5053de106990de562f6d528d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page