Skip to main content

CANdle-SDK

License: MIT Latest release Docs

CANdle-SDK is the official C++ and Python toolkit from MAB Robotics for configuring, testing, and controlling:

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 candletool
  • mdgui — a graphical tool for tuning MD motion control gains mdgui

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):

  1. Download and run Zadig
  2. Options -> List All Devices
  3. Select MD USB-TO-CAN from the dropdown menu
  4. Change the driver type to libusb-win32
  5. 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 sudo required 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.

Metadata

Release files for candlesdk 1.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for candlesdk 1.5.1
File Size Uploaded Provenance Actions
candlesdk-1.5.1.tar.gz 97.2 MB Without provenance Details for candlesdk-1.5.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for candlesdk 1.5.1
File Actions
candlesdk-1.5.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for candlesdk-1.5.1-cp314-cp314-win_amd64.whl
candlesdk-1.5.1-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for candlesdk-1.5.1-cp314-cp314-manylinux_2_28_x86_64.whl
candlesdk-1.5.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for candlesdk-1.5.1-cp313-cp313-win_amd64.whl
candlesdk-1.5.1-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for candlesdk-1.5.1-cp313-cp313-manylinux_2_28_x86_64.whl
candlesdk-1.5.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for candlesdk-1.5.1-cp312-cp312-manylinux_2_28_x86_64.whl
candlesdk-1.5.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for candlesdk-1.5.1-cp311-cp311-manylinux_2_28_x86_64.whl
candlesdk-1.5.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for candlesdk-1.5.1-cp310-cp310-manylinux_2_28_x86_64.whl

Total release size: 105.5 MB

Release files / candlesdk-1.5.1.tar.gz

Download URL candlesdk-1.5.1.tar.gz
Size 97.2 MB
Tags Source
SHA-256 checksum
How to use checksums
8219bcea04944b322064d4babda5b05602c6fb3a4c3e4bb3245846abf3f18023
BLAKE2b-256 checksum
How to use checksums
9fbc103cc874f196b5665e6ae353ac58cd2c9b125e170e3915ffd526b10b6c34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / candlesdk-1.5.1-cp314-cp314-win_amd64.whl

Download URL candlesdk-1.5.1-cp314-cp314-win_amd64.whl
Size 744.4 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
05d7d22379de69bd26794938846855298533c10860e7f82361919a35a93d164c
BLAKE2b-256 checksum
How to use checksums
dc14d8d02844d1c24cc8138dc8bfb72007e2abb7a399fe846b073d7b22bbed08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / candlesdk-1.5.1-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL candlesdk-1.5.1-cp314-cp314-manylinux_2_28_x86_64.whl
Size 1.4 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c388d4af2a4ae3e6b02bfcdac5fcf1c19153f260001665d913184fed3077fbab
BLAKE2b-256 checksum
How to use checksums
751124b7791394611f4dca2df3975be8b6d87d36ef041642f4409046e4787ef6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / candlesdk-1.5.1-cp313-cp313-win_amd64.whl

Download URL candlesdk-1.5.1-cp313-cp313-win_amd64.whl
Size 718.7 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
316834f7e7eb12eaa44b554bd4e411e291bcb28d234e214800f1fa24da8454e2
BLAKE2b-256 checksum
How to use checksums
4cc48de38f10948b29cfce82828a7e7c54ec91a29cb098067b7c75657872b7fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / candlesdk-1.5.1-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL candlesdk-1.5.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 1.4 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8f08c753aef9cc90378fbff4644767aec9dabf5a52ea69fc25cc7b0093f92561
BLAKE2b-256 checksum
How to use checksums
fe16ec5f23293756b8481c6ec457e2bab5c723d86b5b65a2aa02be0a042b16b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / candlesdk-1.5.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL candlesdk-1.5.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 1.4 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bb34bfa28eea5e170a94cf20459178b776700658d18b869c6c7088e797e1f43d
BLAKE2b-256 checksum
How to use checksums
e535b342d66fa546a8372a24414f3f820e1e8891434bc791110661ad7d33327a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / candlesdk-1.5.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL candlesdk-1.5.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b919f07a7eaf8690e6f5623e1c3fc11d1b99edc473a6ff2dcd76cd7b65ba5ad0
BLAKE2b-256 checksum
How to use checksums
f3cb7388c917947d8052432a0b568cdf08e47ddbbdca2418d9580ba425720fc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / candlesdk-1.5.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL candlesdk-1.5.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 1.4 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1d92fe520086994fe95bb534dd943409cacf5f7b146f0bccd44fad7a9e9fd718
BLAKE2b-256 checksum
How to use checksums
ba9f8e65f1e9241218344040121e9ad88818e968d46ee8433c8ca0354ee9e5a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for candlesdk 1.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page