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

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.9.1-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.1-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.1-cp37-abi3-manylinux_2_34_x86_64.whl (441.3 kB view details)

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

roboclaw_python-0.9.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.9.1-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.9.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d64fb639200d0e0f62eab02e1744f520e42b13989bffee9d1ea9be892ef72245
MD5 17a6439cf0fede962ba8737bd245061e
BLAKE2b-256 cffcbb967af216bdf044de4f9ee3374ce15f9292966c8e323a38f6e73d56ff52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2f5db59db19b0e7771e1cf8ae55b04c841bde27cd60324aea88604dd8a23d2c8
MD5 d4f94f677d381e54a96eef6f78797fde
BLAKE2b-256 2408dccf16e1fa42e7e2f24959cec8517aba974cb394c7ac8d07e2bda5820848

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.1-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3dc1b683bb1092c8ce288b1e0a91ddab860a4d06b7974a6924f62d658e181bfd
MD5 20abd32779b234a5134ca31e404e4275
BLAKE2b-256 f75a2a2b096ddf0357a894b7391499a57b1f01692cf21d93d6505fd49be829c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.1-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a2aabc1387339a48c1319b103975c4e5adc425daec0a123a5ca74494c1184a0c
MD5 211cccaf080703f06de3cfec3eb445d8
BLAKE2b-256 cc269269af30be05a7e45d289cca0742cf809208918a521e6151e0f87c077947

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.9.1-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 1f2e84af721eda2ad55db9ae8ed1eba5d342b87d7fc961fb7c85fb5039606924
MD5 5df3cfcb80b5507719e53ff55f32a032
BLAKE2b-256 3ea43f99ec6a8decf93d397e7bb831f8db8eab386785ec7668962c17aaf93ba2

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