Skip to content

hugoassisj/movingRobots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Moving Robots

Hits C++ Qt 6 QML Concurrency Synchronization

A multithreaded concurrency and synchronization demo written in C++ / Qt 6 / QML.

Three simulated position sources (IMU, GPS, Odometry) run on independent threads, each producing noisy readings for three robots moving inside a bounded grid. Readings are pushed into a semaphore-based bounded buffer (classic producer–consumer pattern), consumed by a processor thread that averages all three sources per robot, and then displayed in a fully responsive QML interface.

Architecture

Architecture

Component Role
Source Generates random position deltas for each robot on a dedicated thread.
Buffer Thread-safe bounded FIFO using QSemaphore + std::mutex.
Processor Accumulates readings in a [robots × sources] matrix; computes the mean and snaps to the grid once all sources report.
Robot QObject exposing position properties to QML with cross-thread signal safety.
BackendController Owns all domain objects and threads; exposes properties and invokable actions to the QML UI.

Features

Application screenshot

  • Card-based dashboard with dark / light theme toggle.
  • Live arena: 4 : 3 grid with smooth animations and click-to-select robots.
  • Live coordinates: real-time X / Y readouts for every robot.
  • Thread controls: enable / disable each source or the processor and adjust delays.
  • Keyboard control: move the selected robot with arrow keys.
  • Buffer monitor: color-coded progress bar with manual remove and print-state actions.

Prerequisites

Tool Version
C++ compiler C++17 support (GCC 9+, MSVC 2019+, Clang 10+)
CMake 3.16+
Qt 6.5+ (Core, Quick, QuickControls2)

Building

# Configure
cmake -S movingRobots -B build -DCMAKE_PREFIX_PATH=<path-to-qt6>

# Build
cmake --build build

# Run
./build/movingRobots        # Linux / macOS
build\movingRobots.exe      # Windows

Tip: If you use Qt Creator, open movingRobots/CMakeLists.txt as the project file.

License

This project is provided for educational purposes.

About

A multithreaded concurrency and synchronization demo written in C++ / Qt 6 / QML

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors