This project implements a G1-continuous path smoothing algorithm (Fly-by / Rounding) for a 2-DoF robot using Quadratic Bezier Curves. It includes an interactive dashboard to explore smoothing parameters like radius (
This project manages its dependencies and virtual environments using uv, an extremely fast Python package installer and resolver.
You must have uv installed on your system.
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"For other installation methods (Homebrew, Pip, etc.), please refer to the official uv documentation.
Clone the repository and sync the dependencies. This will automatically create a virtual environment and install the exact versions defined in uv.lock.
# Clone the repository
git clone https://github.com/Nico-Sander/robotprogramming-project-2526.git# Enter the repository
cd robotprogramming-project-2526# Sync dependencies
uv syncThis project is designed to be explored interactively using Visual Studio Code.
Open the cloned folder robotprogramming-project-2526 in VS Code.
To run the notebooks, ensure you have the following extensions installed:
- Python (
ms-python.python) - Jupyter (
ms-toolsai.jupyter)
Navigate to the notebooks/ folder in the file explorer. There are three notebooks available depending on your needs:
-
Flyby-Optimization-with-documentation.ipynb(Recommended)The fundamental implementation and step-by-step execution of the optimization logic without the UI widgets. Documentation and answers to the questions from the underlying task are provided directly in the notebook
-
Flyby-Optimization-Interactive.ipynbThis notebook is the easiest and most intuitive way to play around with differnt parameters for the Flyby optimization and see the effects on the path and performance in real-time. However to achieve this, most of the underlying logic is hidden in
interactive_widgets.py -
Flyby-Optimization-Interactive-with-documentation.ipynbThe same interactive notebook but with documentation and answers to the questions from the underlying task directly in the notebook.
To use the dependencies installed by uv, you must select the correct virtual environment:
- Click on Select Kernel (usually at the top-right of the notebook editor).
- Choose Python Environments.
- Select the environment marked as .venv (or
.venv/bin/python). This environment was automatically created by theuv synccommand.
Execute the cells one-by-one, play with the paramters via the sliders and see how the optimized paths are affected.
The project logic is modularized within the src/ directory to separate algorithmic logic, visualization, and data generation.
-
optimize_path.pyContains the coreOptimizeFlybyclass. It implements:- The Inverse Rounding logic to calculate virtual control points (
$P_{2n}$ ). - The iterative relaxation loop to propagate changes across neighbors.
- The collision handling strategy (radius reduction) and the global/individual
$k$ optimization algorithms.
- The Inverse Rounding logic to calculate virtual control points (
-
collision_checker.pyHandles all geometric validation. It interfaces withshapelyto check intersections for points, lines, and curves (via discretization). It also contains the Visualization logic (usingmatplotlib) to draw environments, paths, and optimization artifacts. -
interactive_widgets.pyManages the Jupyter Notebook UI. It implements a caching system to pre-calculate parameter sweeps (e.g., testing all radii values) to ensure the sliders respond instantly without re-running the heavy planner logic during interaction. -
benchmarks.pyDefines the standard testing environments (1 through 4). It includes utilities likefillet_corner_if_existsto procedurally generate rounded obstacles for testing. -
evaluation.pyProvides metrics and plotting tools. It captures performance data (execution time, collision check counts) and calculates the physical length of the optimized G1-continuous paths.
IPBasicPRM.py: A basic Probabilistic Roadmap planner used to generate the initial collision-free path.IPPerfMonitor.py: A decorator utility for profiling function calls and execution time.
-
This project was developed according to underlying tasks and requirements. The tasks can be found in documentation/Task.md.
-
Answers to the Questions from the task can either be seen in the notebooks:
-
Flyby-Optimization-with-documenation (Recommended)
-
or without any code in the Markdown file Documentation.md
-
-
A non-interactive way to see the results of our work and the documentation is by viewing the HTML-version of the first notebook. documentation/Flyby-Optimization-with-documentation.html
- Marlon Leitschuh - lema1046@h-ka.de
- Pascal Pawliczek - papa1021@h-ka.de
- Nico Sander - sani1019@h-ka.de