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 will only work on devices with the AArch64 architecture running linux/gnu. Here's a list of example devices:

  • Raspberry PI 3/4/5 (Requires a 64-bit OS)
  • Raspberry PI Zero 2 W
  • NVIDIA Jetson Series

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

//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.5.19-cp37-abi3-win_amd64.whl (167.4 kB view details)

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.5.19-cp37-abi3-musllinux_1_2_x86_64.whl (404.5 kB view details)

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

roboclaw_python-0.5.19-cp37-abi3-musllinux_1_2_aarch64.whl (385.3 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.5.19-cp37-abi3-manylinux_2_34_x86_64.whl (435.3 kB view details)

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

roboclaw_python-0.5.19-cp37-abi3-manylinux_2_34_aarch64.whl (436.6 kB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ ARM64

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.5.19-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 49c80a70f5183b0ec9685293634a52e57bb675517fd9d957163dab11c5c75ac3
MD5 8e7240c64f556fcba70bfa9dfd172e10
BLAKE2b-256 8bedde097f95c82d50b59798223957d5da1879114ffb82f1452f09688101f0e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.5.19-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7831ba01558b1f741d0c54647ae1b77fd07122183ff65610f7497a80dc634562
MD5 01c721908517a44d336dac745dae2d6e
BLAKE2b-256 22887885ea081f3a6a17f474d75133022794d85922c4016728dbe2c4b11c5559

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.5.19-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0ff27967114b5d722584ad7a511c728c793010e24589fd5f6122978c6e0669c5
MD5 cae4396d8175783d35122ba8ae86dfc3
BLAKE2b-256 a2eef01ff7c60ab6cfe64232830a4c1ad86e83e06be3d822fe2381a1f1fe5000

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.5.19-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0f4141a61fb8e63960f8f921c5783561781c384df9c389f5cb827099fb3d3994
MD5 86eb73ccd93e26a7b947e67bccca5f62
BLAKE2b-256 9d1be48812e68d5e488c5ab7b6c060c9e9cf31103c5036a700c63be6670492fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.5.19-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d9f2176eae81a00fe71cfcf9e0f4735499957a58aecf2fb83df7ba056eaae16f
MD5 cb14575df0abb1a6a8a3ef355f853e38
BLAKE2b-256 26508f4b04cd50806574a21531e2a6de5d32545d27c74e1556b6254dda81827d

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