This project is a simulation of a 2-wheeled robot moving in a 2D environment. The robot can be controlled in three different modes: automatic, manual, and creative. In the automatic mode, the robot will navigate from a starting point to a goal, avoiding obstacles along the way. In the manual mode, the robot can be controlled using keyboard input. In the creative mode, the user can add or remove obstacles to the environment. Finally, in the playback mode, the user can replay the previous simulation.
- Features
- Modes
- Screenshots
- Built With
- Getting Started
- How to Run
- Future Work
- Conclusion
- Contributions
- Acknowledgments
- Realistic movement and rotation based on the angular velocity of the wheels
- Keyboard control in manual mode
- Automatic navigation from starting point to goal while avoiding obstacles
- Obstacle avoidance using a simulated sensor in front of the robot
- Obstacles & goals can be generated randomly or manually
- Obstacles (Right Mouse Button) & goals (Left Mouse Button) can be added in the form of circles
- Free positioning and movement of the robot in creative mode
There are four different modes available in this simulation: automatic, manual, creative, and playback.
In the automatic mode, the robot will navigate from the starting point to the goal while avoiding obstacles along the way. The robot uses a simulated sensor in front of it to detect obstacles and navigate around them.
In the manual mode, the user can control the robot using keyboard input. The user can apply a velocity to the robot's wheels, causing it to move forward or backward.
In the creative mode, the user can add or remove obstacles to the environment. The user can also modify the starting point and the goal.
In the playback mode, the user can replay the previous simulation.
- C++
- Graphics.h library
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need the following software installed on your computer to run this project:
- A C++ compiler (e.g. g++)
- The Graphics.h library
If you don't have a C++ compiler installed on your computer, you can download one from here.
If you don't have the Graphics.h library installed on your computer, you can download it from here.
Or If you're using Visual Studio, follow this tutorial to install the Graphics.h library on your computer and set up the project with Visual Studio.
Clone the repository to your local machine:
git clone https://github.com/AbdoAarab/GraphicsRobotSim.git
Navigate to the project directory:
cd GraphicsRobotSim/Home/src
Compile the code using your preferred C++ compiler:
g++ main.cpp -o simulation -lgraph
Compile and run the code on a C++ compiler to start the simulation. Use the keyboard to control the robot in manual mode, or select automatic or creative mode from the options menu.
- Add more advanced obstacle avoidance algorithms
- Implement a way for the robot to dynamically change its velocity based on the proximity of obstacles
- Add a way to change the size and shape of the robot
- Add more customization options for the simulation environment
This simulation provides a simple and intuitive way to understand the movements of a 2-wheeled robot. By controlling the robot in different modes, the user can gain a deeper understanding of the robot's behavior and the challenges it faces in navigating a 2D environment.
Feel free to contribute to this project by submitting pull requests or by reporting bugs.





