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.8-cp311-cp311-win_amd64.whl (164.3 kB view details)

Uploaded CPython 3.11Windows x86-64

roboclaw_python-0.5.8-cp311-cp311-manylinux_2_34_x86_64.whl (430.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

roboclaw_python-0.5.8-cp311-cp311-manylinux_2_34_aarch64.whl (431.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

File details

Details for the file roboclaw_python-0.5.8-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.5.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aac78e0b2b624974646cec1045be07e7c92e30e65aa2adcd504fc14179f7aa9b
MD5 ed1a543bd96ac52103d1f9d1eefc1374
BLAKE2b-256 b617ceae48b3968c90993547c5167ba879091a7f70a64c59aa0e5c7bf5d2ddfc

See more details on using hashes here.

File details

Details for the file roboclaw_python-0.5.8-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.5.8-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 aa4dfd4018f3ce8b27b981b29f914f57f25daae54a69dccf5c5c90032e3802a8
MD5 b83e95298e7309db435113f663e3cbcc
BLAKE2b-256 526d6e206d2d42c5f2e202c244e0c29f5ebc44940d2b18fb17cf0ae8aca50f7f

See more details on using hashes here.

File details

Details for the file roboclaw_python-0.5.8-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for roboclaw_python-0.5.8-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 28f0cdfe5a08ef1bf5a751e22c9c4d5a71b897736acb1aa09b69c71d227b2a55
MD5 3f28135cc4c6a68b750f49d7a13f1a94
BLAKE2b-256 6a01aaa4fbcfdbfa64ded232e4f6d9ec69f7fc02ca0de852cb600fb50bcbe22f

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