This program simulates a robotic algorithm for controlling a two-wheeled differential drive robot in a grid-based environment. The robot is capable of moving forward, backward, turning left, and turning right within a predefined grid.
- Allows users to input commands via a user interface (UI) to control the robot's movements.
- Displays the final position of the robot after executing the commands.
- Provides a visual representation of the robot's movements within the grid.
- Python 3.6 or above
-
Clone the repository to your local machine:
git clone https://github.com/Virgo-Alpha/Robotic_Control_Algorithm
-
Navigate to the project directory:
cd Robotic_Control_Algorithm
-
Activate the venv:
source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the program using Python:
python robot_ui.py &
-
The Tkinter UI window will open, allowing you to input the initial position of the robot (x, y) and its orientation (N, E, S, W).
-
Use the buttons to enter movement commands (F for forward, B for backward, L for turn left, R for turn right) or manually type the commands in the Commands field.
-
Press Enter or click the movement buttons to execute the commands.
-
The final position of the robot will be displayed, along with a visual representation of its movements within the grid.
I have implemented unit tests using pytest in the tests folder
-
Navigate to the tests directory:
cd tests/
-
Run the command:
pytest
-
Sometimes the command above does not work unless you either delete the pycache folder or specify the python files:
pytest *.py
Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the Open Source Licence.