#automation #research #mechatronics #thorlabs

thormotion

A cross-platform motion control library for Thorlabs systems, written in Rust

1 unstable release

new 0.3.0 Mar 11, 2025

#43 in Robotics

BSD-3-Clause

120KB
1.5K SLoC

Thormotion

A cross-platform motion control library for Thorlabs systems, written in Rust.

[!WARNING] Thormotion is currently pre-release and offers limited functionality for KDC101 devices only. To request additional functions and device types, please open a new GitHub discussion.

🚀 Features

  • Designed for robotics, automation, and scientific applications.
  • Fast and efficient, with minimal overhead.
  • API supports Python and Rust to simplify your experiments.
  • Runs on macOS, Linux, and Windows.

🛠️ Installation

Python users

Install from PyPI using Pip:

pip install thormotion

Then import the package at the top of your python file:

import thormotion

Rust users

Add Thormotion to your Cargo.toml file:

[dependencies]
thormotion = "0.3.0" # Check for the latest version on crates.io

⚙️ Libusb

Thormotion dynamically binds to libusb in order to communicate with USB devices. You may already have libusb installed. If not, follow the instructions below.

MacOS

Install libusb using homebrew:

brew install libusb

Linux

Install libusb using your package manager:

sudo apt update
sudo apt install libusb-1.0-0-dev

Windows

Install libusb using vcpkg:

vcpkg install libusb

📝 Citing Thormotion

Please cite Thormotion in your research. To find the correct DOI for the version of Thormotion you are using, visit Zenodo and search for thormotion. Alternatively, You can cite all versions by using the generic DOI 10.5281/zenodo.15006067 which always resolves to the latest release.

MillieFD. (2025). MillieFD/thormotion: v0.3.0 Stable Pre-Release (v0.3.0). Zenodo. https://doi.org/10.5281/zenodo.15006067

📖 Documentation

Thormotion implements the Thorlabs APT communication protocol. For full details, please refer to the APT protocol documentation.

🤝 Contributing

Thormotion is an open-source project! Contributions are welcome, and we are always looking for ways to improve the library. If you would like to help out, please check the list of open issues. If you have an idea for a new feature or would like to report a bug, please open a new issue or submit a pull request. Please ask questions and discuss features in the issues if anything is unclear. Note that all code submissions and pull requests are assumed to agree with the BSD 3-Clause License. Make sure to read the contributing guidelines before getting started.

🧑‍⚖️ License

This project is licensed under the BSD 3-Clause License. Opening a pull request indicates agreement with these terms.

Dependencies

~9–19MB
~299K SLoC