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

set_speed()                 M1 + M2 Forward and Backwards
drive()                     Both motors forwards and backwards at the same time
turn()                      Turn one or the other motor

//Encoders
read_encoder()              Reads the encoder of a specified motor
read_encoder_speed()        Read the speed of the encoder in counts per second
reset_encoders()            Resets both encoders
set_encoder()               Sets the encoder value of a specified motor
read_raw_speed()            Reads the raw speed of the encoders
read_avg_speed()            Reads the average speed of the encoders

//Advanced Commands
set_serial_timeout()        Sets the serial timeout
read_serial_timeout()       Reads the serial timeout

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

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.7.0-cp37-abi3-musllinux_1_2_x86_64.whl (407.3 kB view details)

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

roboclaw_python-0.7.0-cp37-abi3-musllinux_1_2_aarch64.whl (387.3 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.7.0-cp37-abi3-manylinux_2_34_x86_64.whl (437.9 kB view details)

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

roboclaw_python-0.7.0-cp37-abi3-manylinux_2_34_aarch64.whl (438.5 kB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ ARM64

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.7.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 870b869e9f54f969fe47f9afb47aa8034138a3bfbcf7e8aca96ce5c830f0d89e
MD5 e9cfce93c06fe14e5f1d6bb268cfb9dd
BLAKE2b-256 d4d9b76c4d3769c9e293e11f8cac284f7bc1ddc9b9c3efaf68dec098c321baa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.7.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7e2e2b2205cee4bd5c2a86f5a8c397e88b0395bd3fca83afd1cd7ec6f4b75e0b
MD5 cc700f8bb3f6b83fee962d1ff90f035c
BLAKE2b-256 29793fa13e0a8b3e39d25f8695fef1485988f8237a8593910a77f6f4044e7030

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.7.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 30965488d01b43403a3747d5a278bbf9773b8ed14b87380c9a15b57b9a7517bc
MD5 c68f3e8d7cbb675790dd2531b5fcf6fb
BLAKE2b-256 4d0ce905e4fe8564d9d64d84775171d8406b2519133cade60d65733f4b04a768

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.7.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cd280f270e5ebc3c4707ea75838d5c86bb86b508a859c46d1b450b82d9d9ded0
MD5 53180f6ef4e8cfbef1f3b55e4312d6ee
BLAKE2b-256 6994d2321b4cccc9edee0d6c0770b7e87834dc317623960aa9f113bf5e308971

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.7.0-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 6affd34135bf266dc6d98737c98e0644237dcb1d941d41dd4a4d9fa1c75acb82
MD5 1bdbe2a4804f908f6cfb3c0da3332b5b
BLAKE2b-256 4fdda4fa05fa3dcfdcf3f2c74530b8e820cd9bc7220e3083e50890eaad8f2a08

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