Skip to content

Master Thesis Project in Computer Engineering at Aarhus University 2024 on "Simulating Multi-agent Path Planning in Complex environments using Gaussian Belief Propagation and Global Path Finding". Available here (https://drive.google.com/file/d/12g-7bqcy_yfkZdpKzxQAErayFJQhu4sE/view?usp=sharing)

License

Notifications You must be signed in to change notification settings

AU-Master-Thesis/magics

Repository files navigation

magics

image

Master Thesis Project in Computer Engineering at Aarhus University 2024 on "Simulating Multi-agent Path Planning in Complex environments using Gaussian Belief Propagation and Global Path Finding". Available here (https://drive.google.com/file/d/12g-7bqcy_yfkZdpKzxQAErayFJQhu4sE/view?usp=sharing)

Motivating Example

Waypoint Tracking

waypoint.webm

Path Tracking

path.webm

Demo

The video below demonstrates some of the features of the simulation tool, and shows how the GBP algorithm can handle complex scenarios such as a multi-lane twoway junction.

magics-functionality-demo-trimmed-for-github.webm

Thesis

The accompanying thesis is available online here.

Getting Started

Supported Platforms

All development has been done on Linux, but both Windows and MacOS is supported as well. The compilation instructions are the same for all platforms.

Prerequisites

  • Rust toolchain stable channel
  • Cargo build system
  • External dependencies for graphics (see External Dependencies)

Installation

  1. Clone the repository
  2. Install the required dependencies for your platform

Keyboard Controls

UI Controls

Key Function
H Toggle Left Panel
L Toggle Right Panel
K Toggle Top Panel
J Toggle Bottom Panel
D Toggle Metrics Window
U Change Scale Kind

Camera Controls

Key/Mouse Function
Arrow Keys Move Camera
C Toggle Camera Movement Mode (Pan/Orbit)
Tab Switch Camera
R Reset Camera
Mouse Wheel Zoom In/Out
Left Mouse Button + Mouse Movement Move Camera (Pan or Orbit depending on mode)
Middle Mouse Button Pan Camera
Right-click Drag Rotate Camera

Simulation Controls

Key Function
F5 Reload Current Simulation
F6 Load Next Simulation
F4 Load Previous Simulation
Space Pause/Play Simulation

General Controls

Key Function
T Cycle Theme
G Export Graph
Ctrl+S Save Settings
Ctrl+P Take Screenshot
Ctrl+Q Quit Application

External Dependencies

Most dependencies used are available through the crates.io registry. And should work on all major platforms supported by the cargo build tool. Still some external dependencies are needed for the graphical session.

Dependencies Platform Specific
alsa-lib Linux
egl-wayland Linux + Wayland
fontconfig Linux
freetype Linux
libxkbcommon Linux + X11
udev Linux
vulkan-loader Linux
wayland Linux + Wayland
xorg.libX11 Linux + X11
xorg.libXcursor Linux + X11
xorg.libXi Linux + X11
xorg.libXrandr Linux + X11

The exact name of the dependency might vary between platforms, and even between Linux distributions. Consult the respective package management tool used on your system for their exact names.

Nix/NixOS

The ./flake.nix file provides a development shell with all the necessary dependencies to run the project. If you have direnv installed you can simply use the provided .envrc and type direnv allow to automatically enter it. Otherwise you can run:

# To enter the development environment
nix develop

Build

The entire project can be build with the following command:

cargo build --release

Run

Available Scenarios

The simulator comes with several pre-configured scenarios to demonstrate different aspects of multi-agent path planning:

  • Circle Experiment: Robots arranged in a circle swap positions
  • Junction Experiment: Robots navigate through a four-way junction
  • Structured Junction: A more complex junction with structured paths
  • Collaborative Complex: Multiple robots collaborating in a complex environment
  • And many more...

Use the --list-scenarios command to see all available scenarios.

Important: When specifying a scenario, use the exact name as shown in the --list-scenarios output. Do not use file paths.

WSL Configuration (Windows 10.)

When running in Windows Subsystem for Linux (WSL), you need to configure an X server:

  1. Install an X server on Windows (VcXsrv, Xming, or X410)
  2. Launch the X server with "Disable access control" checked
  3. Set the following environment variables in WSL:
export DISPLAY=:0
export WINIT_UNIX_BACKEND=x11
# Open the simulator with the first
cargo run --release
cargo run --release -- --list-scenarios # List all available scenarios

# Run a specific scenario
cargo run --release -- -i <SCENARIO_NAME>
# See ./config/scenarios/ for all distributed scenarios
cargo run --release -- -i "Junction Twoway"

Troubleshooting

Common Issues

Display Issues in WSL

  • Problem: "Failed to build event loop: Os(OsError { ... error: WaylandError(Connection(NoCompositor)) })"
  • Solution: Set export DISPLAY=:0 and export WINIT_UNIX_BACKEND=x11 and in Cargo.toml under bevy remove wayland:
bevy = { version = "0.13", default-features = true, features = [
-  "wayland",
] }

ld linking problem in WSL

  • Problem: cannot find 'ld',
  • Solution: You will have to go into .cargo/config.toml and disable the use of mold:
[target.x86_64-unknown-linux-gnu]
rustflags = [
-  "-Clink-arg=-fuse-ld=mold", # Use mold Linker
  "-Ctarget-cpu=native",
]

Credits

The primary algorithm for GBP path planning is based on gbpplanner by Aalok Patwardhan from Imperial College London and Dyson Robotics Lab. As part of this thesis we have reimplemented and extended upon in Rust!

Cite

@misc{jensen2025multiagentpathplanningcomplex,
      title={Multi-Agent Path Planning in Complex Environments using Gaussian Belief Propagation with Global Path Finding},
      author={Jens Høigaard Jensen and Kristoffer Plagborg Bak Sørensen and Jonas le Fevre Sejersen and Andriy Sarabakha},
      year={2025},
      eprint={2502.20369},
      archivePrefix={arXiv},
      primaryClass={cs.RO},
      url={https://arxiv.org/abs/2502.20369},
}

About

Master Thesis Project in Computer Engineering at Aarhus University 2024 on "Simulating Multi-agent Path Planning in Complex environments using Gaussian Belief Propagation and Global Path Finding". Available here (https://drive.google.com/file/d/12g-7bqcy_yfkZdpKzxQAErayFJQhu4sE/view?usp=sharing)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •