Relign is a Python software for simulating the active alignment of optical systems. More precisely, Relign can be used to analyze the sensor output of multi-lens systems by changing the relative alignment to the sensor. It also offers an interface for reinforcement learning algorithms to well-known open source libraries such as Gymnasium and Stable-Baselines.
An example of a trained RL agent, aligning a lens system with two lenses within 10 steps can be seen here:
The methodology and results are detailed in our paper, that is currently under review and available as a preprint on arXiv:2503.02075.
Ensure you have the following installed:
- Python 3.10+
- pip
Once cloned, install the package with:
pip install .
pip install .[dev]pytestRun
mkdocs serveto build and serve the docs locally.
To familiarize yourself with using the environment for your own algorithms, see docs/getting_started.ipynb.
To start training a model, use the scripts/train.py script. You can customize the training parameters using command-line options.
python3 scripts/train.py --env="la" --model=PPO \
--learning-rate=1e-3 --ent-coef=0.01 \
--benchmark="b_OD_N000_256"@misc{burkhardt2025relign,
title={Active Alignments of Lens Systems with Reinforcement Learning},
author={Matthias Burkhardt and Tobias Schmähling and Pascal Stegmann and Michael Layh and Tobias Windisch},
year={2025},
eprint={2503.02075},
archivePrefix={arXiv},
primaryClass={cs.RO},
url={https://arxiv.org/abs/2503.02075},
}
This work was funded by the German Federal Ministry of Research, Technology and Space (BMFTR) under grant number 13FH605KX2.
