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.

Installation

Clone the repository:

git clone cd

Add dependencies to your Cargo.toml:

[dependencies] pyo3 = "0.18" anyhow = "1.0"

Build the project:

cargo build

Usage

Example in Python using the PyO3 bindings

from roboclaw 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}")

License

This project is licensed under the MIT License.

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 Distribution

If you're not sure about the file name format, learn more about wheel file names.

roboclaw_python-0.2.1-cp311-cp311-manylinux_2_34_aarch64.whl (394.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

File details

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

File metadata

File hashes

Hashes for roboclaw_python-0.2.1-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 fe41e4a8cae1103f97dc23e34b857292074906cdd0e652c665dea8ba559215fc
MD5 443d6110dc7aa8d3abbe0c12ffe7a682
BLAKE2b-256 161f8b4a943061a3eaed21e3bf20c4e4003df0e9729a68568abc9054365ebd07

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