https://github.com/itayshaul111/smart-vacuum-robot-simulation
Assignment 2 - SPL course, BGU
https://github.com/itayshaul111/smart-vacuum-robot-simulation
java singelton-pattern synchronization threads
Last synced: about 1 month ago
JSON representation
Assignment 2 - SPL course, BGU
- Host: GitHub
- URL: https://github.com/itayshaul111/smart-vacuum-robot-simulation
- Owner: ItayShaul111
- Created: 2025-02-24T14:42:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-24T16:35:33.000Z (about 1 year ago)
- Last Synced: 2025-06-22T17:10:05.097Z (12 months ago)
- Topics: java, singelton-pattern, synchronization, threads
- Language: Java
- Homepage:
- Size: 341 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π€ Smart Vacuum Robot Simulation
**Concurrent Perception & Mapping System β SPL225 @ BGU**
A modular simulation of an autonomous vacuum robotβs perception and mapping system, developed as part of the **Systems Programming Course** at Ben-Gurion University.
The system models real-time sensor fusion using **multithreaded Java Microservices** and a custom **MessageBus framework**.
---
## π§ Technologies Used
- **Java 8** β Core implementation using threads, lambdas, and generics
- **Custom MessageBus** β Publish/subscribe, event routing & futures
- **Multithreading & Synchronization** β Thread-per-service model
- **GSON** β For JSON parsing of input sensor data
- **JUnit** β Test-driven development for core components
- **Maven** β Build automation and dependency resolution
- **Docker-compatible** β Tested in isolated environments
---
## π‘ Project Structure
### `bgu.spl.mics.application`
- **`messages/`**
Contains all system messages (Events and Broadcasts) used in the pub/sub framework:
- `DetectObjectsEvent.java`
- `TrackedObjectsEvent.java`
- `PoseEvent.java`
- `TickBroadcast.java`
- `CrashedBroadcast.java`, `TerminatedBroadcast.java`
- **`objects/`**
Data representations of sensors, tracked objects, the robot pose, and statistics:
- `Camera.java`, `LiDarWorkerTracker.java`, `GPSIMU.java`
- `DetectedObject.java`, `TrackedObject.java`, `LandMark.java`
- `StampedCloudPoints.java`, `StampedDetectedObjects.java`
- `FusionSlam.java`, `Pose.java`, `CloudPoint.java`, `StatisticalFolder.java`
- `STATUS.java`, `LiDarDataBase.java`
- **`services/`**
Microservice implementations:
- `CameraService.java`
- `LiDarService.java`
- `FusionSlamService.java`
---
## β¨ Features
- Fully event-driven concurrent design
- Global system timer using `TickBroadcast`
- Real-time pose-aware mapping with coordinate transformation
- Supports multiple sensors with different frequencies
- Fault detection & emergency shutdown using broadcast messages
- Generates a final JSON output containing runtime statistics, detected landmarks, and crash report (if applicable)
---
## π How to Run
### 1. Build
```bash
mvn clean compile
```
### 2. Run Tests
```bash
mvn test
```
### 3. Run Application
To run the simulation, provide the path to a valid configuration JSON file:
```bash
mvn exec:java -Dexec.mainClass=bgu.spl.mics.application.GurionRockRunner -Dexec.args="/path/to/configuration_file.json"
```
---
## π Output Description
Generates an `output_file.json` in the same directory as the configuration file, containing:
- Runtime statistics
- Final map (landmarks)
- Crash report (if applicable)
---
## π§ͺ Testing
```bash
mvn test
```
Includes unit tests for core components:
- `MessageBusImpl` β Publish/subscribe mechanisms and future resolution
- `FusionSlam` β Landmark transformation and pose estimation
- Sensor services (`CameraService`, `LiDarService`) β Message handling and event generation
---
## π Directory Structure
```
src/
βββ main/
βββ java/
βββ bgu/
βββ spl/
βββ mics/
βββ application/
βββ messages/
βββ objects/
βββ services/
```
---
## π Example Configuration
For testing the system, several input sets are provided under the following folders:
- `example_input/`
- `example_input_2/`
- `example_input_with_error/`
Each folder contains a `configuration_file.json` and supporting sensor data (`camera_data.json`, `lidar_data.json`, `pose_data.json`, etc.).
---
## π Course Information
- **Course:** SPL225 β Systems Programming Lab
- **Institution:** Ben-Gurion University of the Negev
- **Year:** 2025
- **Environment:** Linux CS Lab, Docker-compatible
---
## π§βπ» Authors
**Ben Kapon**
Student at BGU
[LinkedIn](https://www.linkedin.com/in/ben-kapon1/)
**Itay Shaul**
Student at BGU
[LinkedIn](https://www.linkedin.com/in/itay-shaul/)
---
## π Important Note
This project was designed and tested on a **Docker-compatible environment**.
Ensure file paths and JSON formats are valid when running in local or CI environments.
> This project demonstrates real-time sensor integration using advanced concurrent programming techniques in Java.