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
read_raw_speed()            Reads the raw 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.6.1-cp37-abi3-win_amd64.whl (167.9 kB view details)

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.6.1-cp37-abi3-musllinux_1_2_x86_64.whl (405.1 kB view details)

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

roboclaw_python-0.6.1-cp37-abi3-musllinux_1_2_aarch64.whl (385.7 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.6.1-cp37-abi3-manylinux_2_34_x86_64.whl (435.8 kB view details)

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

roboclaw_python-0.6.1-cp37-abi3-manylinux_2_34_aarch64.whl (437.1 kB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ ARM64

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8f924a46590e8b291f7179ac68542f6e1b9d7c9e4299894389b9036441d4433b
MD5 2a5bf0ec172e5c84492edaca80fde86f
BLAKE2b-256 0f3012fc5dfeb1bf36a57e85fd709bf32436eefb92ea2b8de8e347e2272f8467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 49524f4094b5f56d9762a9bfdd655f4e27fb27ef1e18d19d853006646473c9bb
MD5 895f6003062f21a515d3e021cb536b40
BLAKE2b-256 10558ac74db01fff20a4e52b975c2ec4240871512408f440f48d0fa32933a1d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.1-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2d21581d43c5c5f988b9b9b12f20678da0e6b444882327bd9e71a44960dbcd4a
MD5 95350f23c6ca95f440247034cf00fa4f
BLAKE2b-256 91b2dfcd667e34ca8e12bdc5bbd0a3839e94b673a7512a09c87bc5d38ab5f9db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.1-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e0ab44b68a768ae4de03f6ba49823cfee7165c767846ec9614e8a6933200fd18
MD5 3455338cafc89a959db4a733458e2a6b
BLAKE2b-256 1e2d8d27f895d58948e25facd94cabbd554a1feec596202a64659626e161a7af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.1-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 6bc8b428a05e590cef754bd656b89facb9982a58271e6f1f84ad182f7d7bd695
MD5 23e057983ccbaf47d6c416b0d4026b35
BLAKE2b-256 3c75fdc15206416d9aabe4b61900d8b1486170b1ef38dcbb07bf8e83cfe1f9b5

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