Skip to main content

Python SDK for the Motor-Drive-Layer C++ ABI

Project description

motor-drive-layer

Python bindings for the Motor-Drive-Layer native C++ Damiao motor driver.

The package loads the bundled C ABI library through Python ctypes and exposes SocketCAN, SocketCAN-FD, Damiao serial bridge, and optional DM_Device transports.

Use Motor.request_fresh_state(timeout_ms=50) when the caller must wait for a newly requested feedback frame. For multiple motors, Controller.request_feedback_all(timeout_ms=50) sends every request with the configured TX pacing and waits against one shared deadline; a timeout reports the missing motor IDs. The lower-level request_feedback(), get_state(), and poll_feedback_once() methods remain non-blocking asynchronous/cache operations.

The wheel includes py.typed and .pyi declarations for editor completion and static type checking. The main public APIs are:

  • Controller(...), from_socketcanfd(...), from_dm_serial(...), and from_dm_device(...).
  • Controller.add_damiao_motor(...), enable_all(), disable_all(), request_feedback_all(), set_tx_gap_us(), shutdown(), and close_bus().
  • Motor.enable(), disable(), ensure_mode(), all four control-mode send methods, fresh/cached feedback methods, typed register access, parameter aliases, and store_parameters().
  • MotorState, FeedbackStats, Mode, register metadata/constants, and SDK exception classes.

Motor is a logical child of its creating Controller. After the parent closes, motor operations raise CallError; motor.close() can still release the handle. Both classes support context managers. Leaving a Motor context only frees its handle, while leaving a Controller context attempts to disable all motors before closing the bus.

See the project README for build instructions, architecture, configuration, safety guidance, and examples.

This package is distributed under the MIT License. The optional DM_Device vendor runtime is distributed separately and may have its own license terms.

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.

motor_drive_layer-0.5.2-py3-none-manylinux_2_34_x86_64.whl (103.0 kB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

File details

Details for the file motor_drive_layer-0.5.2-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for motor_drive_layer-0.5.2-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f88cc280ced53ec98b8ac152bbc6ce5809bd8fc441ed0f36fb21aadfb8f5252a
MD5 ee76a603eb4bd4447833f63992630643
BLAKE2b-256 b3b1734c32d6c9b4fdccfd294512cdfa687d27f3f4b25cd9eeccbe45228a5bd9

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