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

Uploaded CPython 3.7+Windows x86-64

roboclaw_python-0.6.0-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.0-cp37-abi3-musllinux_1_2_aarch64.whl (385.8 kB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

roboclaw_python-0.6.0-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.0-cp37-abi3-manylinux_2_34_aarch64.whl (437.2 kB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ ARM64

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 eeb5d00ebeadb340fbf4adf01238c09285e0a43e1c6f25463744d0c115251166
MD5 4410f713ecd601a2d212bcca8cf90e5f
BLAKE2b-256 c945fcd4d68bb9e19a5d25deaef0e927d887e43ecaee338060f9800fd5d9e111

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ccb45afae38fd952623ce773fc615ccce10c405dd1bb5484016a037bc35ca90a
MD5 1e243fc424469c0e3b0855ab8daf1501
BLAKE2b-256 93eb1ccae33559d3c6b28e379b0804ae93be706adf529b5acfa3857ceb975d9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 af9d0a929ed3ccdd457e875a64ff6fa2d612d4ed94fd6d953b8ab9e405084d0d
MD5 9750ff7e04906b302f3e8f65163345a3
BLAKE2b-256 bbdb99e026aff4b6ef536f96988959c005edc12d4148d4dff607e1097eb72c6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 15271c6a0675efee9a83f13efb868fcb937ea636f830ee813882aa903744e44a
MD5 7cd408ae9ecd02ffd818c8069f556457
BLAKE2b-256 b83fd9a12548fd04945ded69f50903b2a398118c1d5d56191ad84a5da2958a91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.6.0-cp37-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a639a84ea618dfc43fc107976b9c0b5b546b969c8140ac16a43671be42a71800
MD5 9c35b697218f641cde2e6fc5f926884c
BLAKE2b-256 e5350eb3d302f0e86c3eb5d695d06344e35d63b95e6a012fe3d3744f95c0a899

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