Using the principles of Image processing, the bot deciphers the arena grids that are covered with blocks of varying shapes and colors. It then identifies the shortest path using Dijkstra's Algorithm and traverses along it in order to perform the tasks of the problem statement.
You can find the problem statement here —— Problem Statement
The arena contains 9 * 9 grids of varying shapes and colors as shown in the image below:
- Blue blocks — Azkaban Prison.
- White blocks — Death eaters guarding the horcruxes or Weapons guarding the identity of the horcrux that a particular weapon can destroy.
- Remaining blocks — Distractions that have the identity of horcruxes i.e., fake horcruxes to distract the bot.
The bot should use the feed from the camera that is overhead the arena. It should then identify the death eaters and transfer them to the Azkaban prison in order to reveal the horcruxes underneath. The bot should remove the weapon blocks and uncover the identity of the horcrux that the weapons can destroy. It should then deliver the weapon blocks to their respective horcruxes in order to destroy them.
- Blue LED — When a death eater is placed in the Azkaban cell.
- Green LED — When a weapon is picked.
- Red LED — When a weapon is delivered to its respective horcrux.
- The bot uses the feed from the overhead camera and applies image processing techniques to decipher the arena grids and segregate them into groups of varying colors and shapes.
- A (9 * 9) will be created to represent the arena. A unique number is assigned to each of the blocks of a particular shape and color.
- As the optimal scoring trajectory is along the path of least distractions (i.e., if the target horcrux is a red circle, the bot should traverse along the path of least red circles but also in the quickest time), therefore, the grids containing the same color and shape as the horcrux are given lower priority values in the matrix.
- Dijkstra's algorithm is implemented on the obtained matrix and the shortest path is determined. The bot then traverses along the shortest path to fulfil the task.
- After the task is fulfilled, the matrix values get reassigned for the next task. This process continues till all the tasks are completed i.e., all the death eaters are transferred to the prison and the horcruxes are destroyed using the weapons.
- Aruco marker and PID control system are used to make the bot traverse in a straight line and take sharp 90 degree turns.