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

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.10.0-cp37-abi3-musllinux_1_2_x86_64.whl (1.3 MB view details)

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

roboclaw_python-0.10.0-cp37-abi3-musllinux_1_2_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.10.0-cp37-abi3-manylinux_2_34_x86_64.whl (1.2 MB view details)

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

roboclaw_python-0.10.0-cp37-abi3-manylinux_2_34_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ ARM64

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1ee1debdb078e8cbd2a918089a0f5e64eced455595774178f43b8e4ca1067bc1
MD5 3757b79083bc88f3539bc26489f4653d
BLAKE2b-256 7d20d86917a263f985b376f324667625fd9b749c6e06634907dec6f2627e363f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6e01f4ccb4643960030073cfec72cffde88fe27e0fc86ecfa6e3350c12111d6c
MD5 763fd27a3cd060c0b20a1fb5c21436de
BLAKE2b-256 300059be1da05d9b3ac4c206b5a30e2a6ff72bb85a668327e19cec8632e2426b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c854c0a5c14fa49461fa7e7d2256699d423863febf49bea8b329e69c2b8d3a4c
MD5 434c0adc78615ef855cff97e23cc02b2
BLAKE2b-256 0d1455899dd1febbb904c1a364553b124eee0822bf13ef0fc4d19f75c1f44bbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8a1919f266d75932ae44e0f959d750a934e283e6b98f64eb9714dc3d343cb1ef
MD5 528540a3812071adb8473b193526b20c
BLAKE2b-256 16abdf2a629b62c6f9159e04a0eb87f5a9a8996708f30cc887a818224fd0472a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.10.0-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 5f527c9c49239ab5036156aafe40130e0a95c64df2c68d371bbf5d0faf60f56a
MD5 1c3d732546152d81c431c202527f2488
BLAKE2b-256 4b7993acd57c50813c84636cd1c19611a724976af9d65f5f0d3546c25a6b11f3

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