A Repo to collect and develop algorithms to synthesize modular robot configurations and possibly robot morphologies.
The code in this repository heavily relies on timor-python (repo, docs, PyPI). Timor is available via pip install timor-python
, however at the time of writing this code partially depends on bleeding-edge features of timor which might not always be available in the PyPi version. To install it locally with pip, run pip install -e <path_to_timor_subrepository>
.
Apart from Timor and ompl, which is currently used as a path planning library in dev but not required to run 99% of the code, the dependencies can be set up using conda and pip.
For instructions on how to set up basic python requirements (excluding OMPL [so: path planning] + web visualization), install packagages as defined in the requirements file. We recommend using anaconda or miniconda for that.
The requirements.txt file is supposed to be used with conda and possibly conda-forge, as not all packages are available on pip in the required version. However, stable-baselines3 is only available on pip in the required version currently, so it has to be installed seperately. (see gitlab-ci file)
To download large files contained in the submodules, you need to have git lfs setup at your computer.
This repository has submodules that contain modular robot databases. Set them up via git submodule update --init
or during clone with git clone --recurse-submodules [email protected]:cps-robotics/mcs.git
, and update them via git submodule update --merge
in case they have been changed. They will automatically be updated to the latest version of the crok_format branch, if they have one.
Please make sure to write unittests for every new feature implemented. Gitlab will automatically run all tests placed in the tests/
folder at every push. Merges to main are only possible if the pipeline runs through.
Merge pipelines are evaluated on the merge result, not the latest branch commit.
Code style is enforced by flake8 (custom maximum line length for python code: 120 characters). The CI runner will fail if you don't follow the flake linting guidelines. Check the .gitlab-ci.yml file to see what flake8 command exactly is being used. If you explicitly want to ignore a flake error, use the noqa tag.
Coverage of the unittest is automatically evaluated. If coverage drops under a certain level, the pipeline will fail. (currently, 80% - longt time goal: 90%)
Docstrings: There is a docstring check in place. The CI pipeline fails if you implement a function, method or class without a docstring. For this purpose, pydocstyle is used. For details, see the config file
From inside the root directory run docker run -ti -v $PWD:/builds/unittest/mcs gitlab.lrz.de:5005/cps-robotics/mcs/<type>:<branch> bash
(replace type with base / ompl / render and branch with ref slug of desired branch).
Activate environment: conda activate mcs
Go to mcs base dir in container: cd /builds/unittest/mcs/mcs
Run tests (e.g. those with ompl): python -m pytest -m "ompl" tests
(prepending python -m
needed to get path setup right)
Code style is partially enforced by the CI pipeline. Please also take care to follow the style guide of the mcs repository when writing code.
To include additional robots, scenarios, etc. to be loaded with Timor, you can edit the timor.config file of your local timor installation. For instrocutions on how to find the file, check out the Timor repository. It is advised to include the robots/ subrepository as an additional robot directory there.