Skip to main content

No project description provided

Project description

RoboClaw Driver

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


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.10.1-cp37-abi3-win_amd64.whl (171.5 kB view details)

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.10.1-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.10.1-cp37-abi3-musllinux_1_2_aarch64.whl (390.3 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.10.1-cp37-abi3-manylinux_2_34_x86_64.whl (441.2 kB view details)

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

roboclaw_python-0.10.1-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.10.1-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.10.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f9e9af77513e0c9b18708a3fbef374a7bd66e1d279d25940e049ff809196c7d4
MD5 24ea2f9e1f785f96d7ad05b83bd3303e
BLAKE2b-256 bec34bb2e75fa5a9c26dfd97ffa9221dea1f30b2828e28fb4b2ede4f04df0823

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6f1c249b70a3e96b1e29b624a6361f0cb669783a9dfec3f8613fe700abe22724
MD5 a3f60c39852b4204af1c9bab623412be
BLAKE2b-256 b797b899c446ff22cfd012319a4a033fd71a2681e33b8e0c115d89b2a2584a69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.1-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2e68d529b6b2bad3ef0a9e69ac78f39e96dc264a26bf8a02a9e387209cb0c617
MD5 c8b758b92e00c13dd2761a0dca461fbc
BLAKE2b-256 7be1f90257867ea870c557d88e1e6712c72a1e507f31bd073bc128d155f29357

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.1-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 81cd0a84cdd4d9525cf24a71b304545c8b4db9c73f64c3e4edad0a87e5a445d4
MD5 8ec2b1becb831c4087ae21cab6b6e8ef
BLAKE2b-256 e8dce3faa50370567149d7a2a753dff41416a517d334668d36a73549bebf8d56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.1-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 0d2c657e98232ca2a1d2554b8dbbe8336d9f374334fd2c3f997b929ad849b7ff
MD5 3acfc1ea2eac56107cc63861d4547201
BLAKE2b-256 7a0877faf4227b8d05a71717e64d71ae8ef605c8b1b00279d3d09a6e38b99744

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