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

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.9.4-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.9.4-cp37-abi3-musllinux_1_2_aarch64.whl (390.4 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.9.4-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.4-cp37-abi3-manylinux_2_34_aarch64.whl (441.7 kB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ ARM64

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.4-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a342643c5d038ad61962d9f8611b45324f896fac0a6afcb4f17324d2a9b8477b
MD5 6620bc3984a1efec32af743d178df8ba
BLAKE2b-256 962699ef0dde12a95e1578c8daf59465e477f53a56b6697b948e6461c573ffe5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.4-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 986f1c1c72acd54bf3ac82a9a03f9e7101560b59c3f412be9074606336ec5add
MD5 dfe9dad4a1f4c2ef5c9f691b8c64a4ea
BLAKE2b-256 3b8bd23b90f582418bb6d3e7fa3b4b67b1a169d2bdc74d797a9835ae038cec36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.4-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4b4f96666c2e5c5e38ea707b6f91d9d51f92188a40f490a687b38dfe1cdd893c
MD5 c92b89b66462b191470602061b29db8b
BLAKE2b-256 6e61869a81247764590658b851754100efc7cf3fe88ee0f0c49b98698b5de8fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.4-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ee15426a2ebac1b073eed08810da1c4412c0332d14e845a4793cf7e30997d139
MD5 70f76ffdcc93e9adf4714f0af435675a
BLAKE2b-256 6a9836ef3ca4cc65309dfc1d8ae264c8a57d7633837843350e5939d050bcbd26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.4-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f0badd18570ef2cfd76b042155c52ebc23a9971a78cf173941306483c7ab88cb
MD5 60c0276321fa0a094658a2b697b72ec5
BLAKE2b-256 323ef377028522e0c192b68ebd790d044e38d60b8c13be4466e718401ed90ed3

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