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

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.10.2-cp37-abi3-musllinux_1_2_x86_64.whl (410.6 kB view details)

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

roboclaw_python-0.10.2-cp37-abi3-musllinux_1_2_aarch64.whl (390.4 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.10.2-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.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.10.2-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.10.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 cd093587142ba973e3613f620bb316c720e393c26249fb8211652465b751d1f2
MD5 02043f201abf494f9482190946eba0e5
BLAKE2b-256 21ac62da9901d7bdb7d79ea0970392a16a6b5615f9178e21b8b5e29da104e03f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.2-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 db52f95ef83f3dd6e428656b4db95af3eb1fdb75f3e89d853642259249673ae2
MD5 da68fdbf9002b3e934dec751a601566b
BLAKE2b-256 083cfc5958f11dc00c8765760b2f3885f431e72c76f2d91b2b6f785b27acc220

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.2-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 cdf9003659218ca61dc268ca7991db15930a3c3d346c355ed3e8d706936dd3f2
MD5 4d33af98ca65fa5660d54ee531e9d67a
BLAKE2b-256 fa36566cca0b929b4283ff6c1edde4bfab18a147aa49df9504c533fa0c1b9376

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.2-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 862edf265f9e1491f1cf8ff6646aa80bd021be4edbd55355ad54a1b28312e265
MD5 d757b3d1c7e72698b11922e5d44aed0f
BLAKE2b-256 822e762feb907d31780e10e1dfe16894aefdd75e2fcf87410ce87179f48feded

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.2-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 2602b074b326b5b14c7a25eda7204963362dd6f61b0575b995d92be30538ae02
MD5 b7092724c659d8cb8f0cdeb12d78b8a6
BLAKE2b-256 d3f8b41625c9779db8e6a3552e27066c0c9f1668b5a10500a17b60ecfba5c9f6

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