This project aims to utilize camera vision and artificial intelligence to maneuver through and solve a 2D maze. Our group hopes to create a fully functional maze-solving robot. Using the feed of an ESP32 camera mounted onto the robot, the program will read the track and junctions along the maze path and use artificial intelligence to solve the maze
- Build a rover robot equipped with a camera.
- Program Arduino to traverse lines and execute left or right turns when necessary.
- Interpret the camera stream with OpenCV to learn about the environment.
- Program rover to traverse the maze along the left-hand side.
- Develop an algorithm to optimize the stored path and come up with a solution for the maze.
- Program rover to execute the solved path onto the maze.
- Access to a computer with COM ports
- Access to Arduino environment
- Access to PyCharm (or a similar IDE) and Python environment.
- Maze creation
- Readjust robot for 2nd attempt
- Note the displaying information of junctions and turns through python terminal
- Traverse any user-made maze
- Relay information about turns and junctions
- Save path
- Solve maze on 2nd attempt
-
Given the processed image, assess if there is a left turn
- Take a left turn if available, and add ‘L’ to the path taken
-
If there is no left path, asses if there is a straight path
- Take the straight path, and add ‘S’ to the path taken if there is no ‘S’ at the front of the path
-
If there is no straight or right path, asses if there is a right path
- Take the right path and add ‘R’ to the path taken
-
After any action, check if there is at least a sequence of 3 actions
-
Try to reduce the last 3 actions into an optimal action:
- LBR → B
- LBS → R
- LBL → S
- SBL → R
- SBS → B
- RBL → B
Every time the image process algorithm returns the available actions, the maze algorithm will determine which action the robot should take. Actions are added to the path and at the same time, a value will be serialized and sent to the Arduino using the COM port. There are 5 values that are sent over the COM port to trigger the robot's movement function. The message sent over the port is parsed to an int and a switch statement is used to choose which action to trigger.
- COM port values:
- ‘0’: Triggers a stop action
- ‘1’: Triggers a left action
- ‘2’: Triggers a right action
- ‘3’: Triggers a turnaround action
- ‘4’: Triggers a straight action