Skip to main content

Raspberry Pi client library for the Delibot STM32 motor controller UART protocol

Project description

Delibot-Controller-RPi-Library

Raspberry Pi Python client for the Delibot STM32 motor controller's UART protocol (USART2, 115200 8N1, App/Src/rpi_link.c / host_commands.c in Delibot-Controller).

Install

pip install delibot

or from source:

pip install -e .

Usage

from delibot import DelibotController, Param

with DelibotController("/dev/ttyAMA0") as robot:
    robot.set_velocity(linear_mm_s=300, angular_mrad_s=0)

    telemetry = robot.telemetry
    if telemetry is not None:
        print(telemetry.yaw_deg, telemetry.left_wheel_mm_s, telemetry.motors_on)

    track_width = robot.get_param(Param.WHEEL_TRACK_WIDTH_MM)
    robot.set_param(Param.WHEEL_TRACK_WIDTH_MM, 210.0)
    robot.save_params()

    ticks = robot.get_encoder_ticks()
    robot.zero_encoders()

    robot.stop()

set_velocity is kept alive internally by a background heartbeat thread, so the STM32's 500 ms deadman watchdog (RPI_LINK_TIMEOUT_MS) never trips between calls — call it once per desired speed change, not on every control-loop tick.

telemetry is updated asynchronously from a background reader thread at the firmware's 50 Hz push rate; pass on_telemetry= / on_debug= callbacks to DelibotController to react to updates and firmware debug prints as they arrive instead of polling the property.

Protocol

  • Frame: SOF(0xFF) LEN CMD PAYLOAD... CRC, CRC = CMD ^ PAYLOAD[0] ^ ... ^ PAYLOAD[n-1].
  • No sequence numbers or NACKs on the wire — request/response calls (get_param, get_encoder_ticks, get_crsf_channels, ping) apply a client-side timeout (DelibotTimeoutError) instead.
  • See src/delibot/protocol.py for the full command and parameter ID tables.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

delibot-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

delibot-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file delibot-0.1.0.tar.gz.

File metadata

  • Download URL: delibot-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for delibot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 755708ce701751d42ddfeca7cb998fd97342b68cc97a77d2233f19e544f41775
MD5 a805fae65d6f586bc46f215990f78e78
BLAKE2b-256 c6ee0c89787bcf61e9d0eac3fb05e9cb09400e6e158de6295db2d52e303048a9

See more details on using hashes here.

File details

Details for the file delibot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: delibot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for delibot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ae39d72c408f2358d405ebf14eeec604de7b338030d8a81164fa624de35d2b2
MD5 de968e71d06191f8e60760e05aaa6a42
BLAKE2b-256 374934bec9cf9d447cac5a21231d19928d50eb0e1ab70fea8eb9b6c24c9ee40d

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