CANdle-SDK
CANdle-SDK is the official C++ and Python toolkit from MAB Robotics for configuring, testing, and controlling:
- MD motor controllers — compact brushless servo drives for legged and mobile robots
- CANdle / CANdle HAT — USB/SPI-to-CAN-FD dongles that connect up to 16 devices to a PC or single-board computer
- PDS (Power Distribution System) — modular power management and monitoring for mobile robots
The SDK includes two ready-to-use apps for working with your hardware without writing any code:
- candletool — a command-line tool for configuring, calibrating, and diagnosing devices
- mdgui — a graphical tool for tuning MD motion control gains
It also provides C++ and Python libraries so you can build your own applications on top of the same drivers.
📖 Full documentation: MD80 x CANdle Documentation
Getting started
Pick the path that matches what you want to do:
| I want to... | Go to |
|---|---|
| Configure and test my hardware, no coding required | Install candletool & mdgui |
| Control MD/PDS from Python | Python quick start |
| Build CANdle-SDK yourself | Building from source |
| Use CANdle-SDK in my own project | Use CANdle-SDK in your project |
Install candletool & mdgui
Prebuilt installers for both apps are published on the Releases page — no build tools or source checkout required.
Windows
Download the latest candletool-<version>-Windows-<arch>.exe and/or mdgui-<version>-Windows-<arch>.exe installer from Releases and run it.
Swap default USB driver manually (only if the installer's automatic driver setup fails)
Install the WinUSB driver for CANdle (one-time setup per PC):
- Download and run Zadig
- Options -> List All Devices
- Select
MD USB-TO-CANfrom the dropdown menu - Change the driver type to
libusb-win32 - Click Replace Driver and wait for it to finish
Linux
Download the .deb package matching your architecture (x86_64, arm64, or armhf) from Releases, then install it:
sudo apt install ./candletool_<version>_<arch>.deb
sudo apt install ./mdgui_<version>_<arch>.deb
Once installed, run candletool --help to get started, or launch mdgui from your applications menu.
Python quick start
The Python bindings are published on PyPI as candlesdk — no compiler or source checkout needed.
Performance note: the Python bindings wrap the C++ library and carry some overhead, so they don't match its performance. For high-frequency control loops or other performance-critical applications, use the C++ library directly.
On some systems (e.g. recent Debian/Ubuntu) pip refuses to install system-wide, so installing into a virtual environment may be required:
python3 -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
pip install candlesdk
import pyCandle as pc
candle = pc.attachCandle(pc.CANdleDatarate_E.CAN_DATARATE_1M, pc.busTypes_t.USB)
md_id = pc.discoverMDs(candle)[0]
md = pc.MD(md_id, candle)
if md.init() == pc.MD_Error_t.OK:
md.zero()
md.setMotionMode(pc.MotionMode_t.IMPEDANCE)
md.enable()
# ... your control loop ...
md.disable()
Running the Python examples
Ready-to-run scripts covering both MD and PDS control are in examples/py, e.g. md_impedance.py and pds_example_basic.py. Grab the folder (or the whole repo) with the git clone instructions below, then, with candlesdk installed and your hardware connected, run:
python3 examples/py/md_impedance.py
Building from source
This section is for developers building the C++ library, candletool, or mdgui themselves — e.g. to modify the SDK or to target a platform without prebuilt packages. If you just want to configure hardware or write Python code, see Install candletool & mdgui or Python quick start instead.
Get the source
git clone https://github.com/mabrobotics/CANdle-SDK.git
cd CANdle-SDK
git submodule update --init --recursive
Note: a zipped download of the repository will not work, since it relies on git submodules.
Prerequisites
Linux
sudo apt install build-essential git cmake libusb-1.0-0-dev
Windows
Building requires w64devkit, which can be downloaded and configured automatically by the build script below.
You'll also need the WinUSB driver for CANdle — see the driver setup steps in Install candletool & mdgui above.
Build
Linux
Using the build script:
./launch/buildForLinux.sh
Or build manually:
mkdir build && cd build
cmake ..
make -j6
Or using Docker (x86_64 only; see installing Docker on Ubuntu):
./launch/runDockerForLinux86-64.sh
Note: you'll also need to install udev rules so CANdle can be used over libUSB from userspace (no
sudorequired afterwards). This is a one-time setup per PC, and may require a restart to take effect:cd build sudo make install_rules
Windows
Natively, from PowerShell:
./launch/buildForWindows.bat
Or cross-compile from Linux using Docker:
./launch/runDockerForWindows.sh
Both produce a build/ directory containing the candlelib library and, by default, the candletool, mdgui, and example binaries.
C++ examples
Example programs demonstrating MD and PDS usage — impedance control, diagnostics, PDS power stage/braking resistor handling, and more — are in examples/cpp. Each file builds into its own executable as part of the normal build above; run one directly from the build output, e.g.:
./build/examples/md_example_impedance
Building the Python module from source
Most users should just pip install candlesdk — see Python quick start. Build it yourself only if you need an unreleased change or a platform not covered by the published wheels.
Dependencies are listed inside pyproject.toml. To build a wheel for the current system, run python -m build inside the repository with your preferred Python binary.
To build wheels for multiple libc/Python version combinations at once, use:
./launch/pythonBuildWheel.sh
Then install the wheel matching your platform, e.g. python -m pip install ./dist/candlesdk-1.5.0-cp310-cp310-linux_x86_64.whl for CPython 3.10, glibc, x86-64.
Use CANdle-SDK in your project
The recommended way to consume CANdle-SDK from another C++ project is as a git submodule:
git submodule add git@github.com:mabrobotics/CANdle-SDK.git
git submodule update --init --recursive
Then link against the candle target (built from candlelib) in your own CMakeLists.txt:
cmake_minimum_required(VERSION 3.15)
project(myCandleProject)
add_subdirectory(CANdle-SDK) # added as a submodule
add_executable(myCandleProject main.cpp)
target_link_libraries(myCandleProject candle)
Documentation
For more information check out our documentation page here.
License
CANdle-SDK is released under the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file candlesdk-1.5.0.tar.gz.
File metadata
- Download URL: candlesdk-1.5.0.tar.gz
- Upload date:
- Size: 91.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e7b7a30d23b36dc081b1d33e6cd8d0c8f68acac15a47d4e10ce7fc1b0c23e68
|
|
| MD5 |
326444f27771c1cda003dcd43ae88bd1
|
|
| BLAKE2b-256 |
ef87cd0c8cc46fe151cfe790337d4a23ed3731463dcedd0b54576d965ca50b1e
|
File details
Details for the file candlesdk-1.5.0-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: candlesdk-1.5.0-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 744.1 kB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1e0a7f54381f16825f69397037c3299819d58dbd85328fbb9ac6ef1f2388393
|
|
| MD5 |
caf4c8bfe3124f1e4f48707a5bc76a52
|
|
| BLAKE2b-256 |
6ee70539acef424c0c6aaad41093b91e66844c2a9d8fdae03b311170343d0a9f
|
File details
Details for the file candlesdk-1.5.0-cp314-cp314-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: candlesdk-1.5.0-cp314-cp314-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5e0acdc0a28b562ec9532c277e2dd839460ca0977116576bd168b203596a9dc
|
|
| MD5 |
be04c53736a350dfb14c6c89a374d562
|
|
| BLAKE2b-256 |
5d0471504d93b9cdb641ef0bfd69ed50fd6cab0c91904be8330459b6272d3539
|
File details
Details for the file candlesdk-1.5.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: candlesdk-1.5.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 718.2 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a711fa735053ebb49b874697997a64c4eaf46c1b08dd685edf31da57e9af425
|
|
| MD5 |
d4b3821f457035e224e845ebe51c8e00
|
|
| BLAKE2b-256 |
ce8daae5fda3da27266e7ae9f03dc9304e91c87c61a72701482bc835791f56ac
|
File details
Details for the file candlesdk-1.5.0-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: candlesdk-1.5.0-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0b15281e17a4888e6381d94adca1842db882cdff109d18c637ee9d4c32d2068
|
|
| MD5 |
763f82dc88ec6fa5c7c5339d7db8f62b
|
|
| BLAKE2b-256 |
631c28cc38fada811ea5acbd9f3909602ec2db9fbe2f4cdd54cf44efbfb62cd4
|
File details
Details for the file candlesdk-1.5.0-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: candlesdk-1.5.0-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1341fd6485c96751c2791cc58a970e8c98d5c4a12a87a5267a97ffc906c9783
|
|
| MD5 |
3b0bbd9f8f0ad4ef1fe82d9223e3e86a
|
|
| BLAKE2b-256 |
02b2d03e3850fdf8dacaaf02d511b2c21060bf4c81010d275f8bbd24f21c3852
|
File details
Details for the file candlesdk-1.5.0-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: candlesdk-1.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b918abbdcf0e11d60d01b993e69afe533e590e647d8d5e4d4350012ebdd6b22
|
|
| MD5 |
2af0a4d4952dbe9933a4a5d882eba169
|
|
| BLAKE2b-256 |
e3451ecb1e8d9bf2152df2c9d387a722b87b337d762493863d176efb2c893a8c
|
File details
Details for the file candlesdk-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: candlesdk-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39aea361dd089cb0975c857af9eee1f3f7511e8a76f87f7c5eb1dccab2cbba77
|
|
| MD5 |
eda1863631b3d087ad920a0739d3d4bb
|
|
| BLAKE2b-256 |
217a82b9e92be13c521fc969d6ee5e26c42be6d93333f82ad11a3591da285c2d
|