Skip to main content

What is MotorBridge?

v0.5.0 Rust Core Python Binding MotorBridge is a unified motor control stack with pluggable vendor drivers and a C ABI for cross-language integration.

The Problem We Solve

Every motor vendor has a different protocol:
Without MotorBridge, you need to:
  • Learn 5+ different protocols
  • Maintain separate codebases per vendor
  • Rewrite control logic when switching motors
  • Build your own debugging tools

MotorBridge Architecture

The diagram above is the readable system map. The text diagram below is kept as a compact terminal-friendly reference.

Project Structure

Why “Python Binding” Not “SDK”?

A binding is a thin wrapper that exposes a native library to another language via FFI (Foreign Function Interface).
Key characteristics:
  • Logic lives in Rust, not Python
  • Python is a 1:1 mapping to C ABI functions
  • No duplicate implementation
  • Minimal overhead (direct FFI calls)
The motor_abi crate compiles to a shared library:
Python loads it via ctypes:
This is zero-copy for primitive types - floats and ints pass directly between Python and Rust.
MotorBridge is a Binding because:
  • The “SDK” is the Rust core (motor_core + vendor drivers)
  • Python is just one interface to that core
  • Future: C++, ROS2 nodes will use the same ABI

Why Rust for the Core?

Core Components

Controller

Manages CAN interface and motor lifecycle:
It is recommended to bind each Controller to motors from one vendor. While the Python API allows mixing different vendors, mixed usage depends on the underlying ABI implementation and may have compatibility limitations.

Motor

Handle to a single physical motor:

Mode

Control mode determines how the motor responds:

MotorState

Real-time feedback structure:

Transport Options

CLI Tools

The project includes command-line utilities:

Integrations

WebSocket Gateway

Control motors over WebSocket (useful for browser/remote apps):
From source tree, you can still run:

Motor Calibration

Tool for motor calibration routines:

Comparison with Alternatives

Quick Start

1

Install Python Package

2

Configure CAN Interface

3

Run Your First Program

What Can You Build?

Next Steps

Quick Start Guide

Get your first motor running in 5 minutes

API Reference

Complete API documentation

Tutorials

Step-by-step practical guides

Best Practices

Production-ready patterns