A 2D mobile robot simulator with autonomous and remote-controlled navigation capabilities. Built as a university project for ICP course 2024.
- Interactive map creation with drag-and-drop functionality
- Autonomous robots that navigate and avoid obstacles automatically
- Click on any robot to take manual control via keyboard or GUI buttons
- Customizable robot parameters (detection range, rotation angle, speed)
- Obstacle placement system
- Save/load map configurations from text files
- Real-time simulation with pause/resume functionality
- Visual feedback with color-coded robot selection
- Language: C++
- GUI Framework: Qt5
- Graphics: Qt Graphics View Framework
- Build System: Make, qmake
- Documentation: Doxygen
make build./robotsOr combined:
make runmake doxygenLaunch the application to access the main menu where you can create new maps or load existing ones.
- Select "Create New Map" from the main menu
- Choose an existing map or create a new one
- Set map dimensions
- Drag and place robots and walls on the map
Each robot can be configured with different parameters:
- Initial direction
- Rotation direction (left/right)
- Detection distance (how far the robot can see obstacles)
- Rotation angle (angle to rotate when detecting an obstacle)
- Modify robot configurations at any time during map creation
- Save the map to a
.mapfile
- Load an existing map
- Click "Start Simulation"
The simulation can be paused at any time to add/remove robots or walls, or change robot configurations.
- Click on any robot to select it (selected robot turns green)
- Use the control buttons at the bottom of the screen to manually control the selected robot
The application supports creating maps where robots and obstacles can be added interactively. Each robot can be configured with the following parameters:
- Robot name: Unique identifier for the robot
- Rotation direction: Clockwise or counter-clockwise rotation preference
- Detection distance: The range at which the robot detects obstacles
- Rotation angle: The angle by which the robot rotates upon detecting an obstacle
- Initial angle: The orientation angle at which the robot starts when simulation begins
Maps can be saved to .map files in a readable text format and loaded later. The simulation window demonstrates robot behavior in real-time, with the ability to pause at any moment. Any robot can be controlled by clicking on it - the selected robot changes color from red to green, and manual control buttons become available.
The simulator uses simplified physics operating with:
- Discrete time steps: Simulation advances in fixed time intervals
- Continuous 2D space: Robots move in a continuous coordinate system
- Uniform linear motion: Constant velocity forward movement
- Uniform rotation: Constant angular velocity rotation
- No physical forces: Mass, inertia, and acceleration are not considered
Time steps are sufficiently fine relative to movement speed to ensure:
- Robots detect obstacles before collisions occur
- Visualization appears smooth and continuous
All robots start in autonomous mode, navigating using a simple collision avoidance algorithm:
- Move forward in a straight line
- Continuously scan for obstacles within configured detection range
- Upon detection, rotate by the configured angle in the configured direction
- Continue forward motion after rotation
Clicking on any robot switches it to manual control mode (indicated by green color). In this mode, the robot can be in one of four states:
- Stationary: No movement
- Moving forward: Advances in the current direction
- Rotating counter-clockwise: Turns left
- Rotating clockwise: Turns right
Safety feature: Robots in manual mode automatically halt forward motion when obstacles are detected within the detection range.
- Map size can exceed screen resolution, potentially causing the application window to extend beyond screen boundaries
- Manual edits to
.mapfiles may cause undefined behavior - Collision detection is performed at discrete time steps, requiring appropriate step size configuration
├── src/ # Source code
│ ├── Pages/ # GUI pages (Menu, Create, Simulation)
│ ├── assets/ # Qt resources
│ └── *.cpp/hpp # Core classes (Robot, Map, Controller, etc.)
├── maps/ # Saved map configurations
├── examples/ # Example map files
├── docs/ # Documentation and images
├── build/ # Build artifacts
└── Makefile # Build configuration
- olexamatej - Game logic, pathfinding, and map creation system
- megy123 - Main menu, map and config loading/saving and pixel art sprites
This project was created as a university assignment for the ICP course. See ASSIGNMENT.md for the original project requirements.






