A cross-platform motion control library for Thorlabs systems, written in Rust.
- Designed for robotics, automation, and scientific applications.
- Python and Rust API
- Fast and efficient, with minimal overhead.
- Runs on macOS, Linux, and Windows.
This project is still growing. We are happy to add support for any new devices and functions as needed. Please open a new GitHub issue to make a request.
Python users
Install from PyPI using Pip:
pip install thormotionThen import the package at the top of your python file:
import thormotionRust users
Run the following Cargo command in your project directory:
cargo add thormotionOr add Thormotion to your Cargo.toml file:
[dependencies]
thormotion = "*" # Check for the latest version on crates.ioPlease 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.
Amelia Fraser-Dale. (2025). MillieFD/thormotion: Thormotion v0.4.0
Zenodo. https://doi.org/10.5281/zenodo.17064172A complete list of the supported Thorlabs devices and functions can be found on docs.rs.
Thormotion implements the Thorlabs APT communication protocol. For full details, please refer to the APT protocol documentation.
Thormotion uses the log crate to record information at runtime. This lightweight logging API is compatible with a variety of backends, allowing users to select the most appropriate logging implementation for their use case.
| Level | Description |
|---|---|
trace |
The raw bytes sent and received |
debug |
Low-level activity common to all device types |
info |
High-level activity specific to each device |
warn |
Issues that do not preclude the request |
error |
Issues that terminate the application |
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. Note that all code submissions and pull requests are assumed to agree with the BSD 3-Clause Licence.
This project is licensed under the BSD 3-Clause Licence. Opening a pull request indicates agreement with these terms.