Skip to content

Autonomous ⚙️ Arena Simulation using Computer Vision and BFS

Notifications You must be signed in to change notification settings

asood-life/vision-2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vision 2.0

Computer Vision Event organised by Robotics Club of IIT (BHU) Varanasi


Arena Bot


  • The Arena is divided into two distinct paths: INNER Square and OUTER Square. These paths are interconnected by four distinct pathways, each marked with a unique color and leading to the Home Zone at center.
  • The Bot can switch between the OUTER and INNER paths and is mandated to move in clockwise direction.
  • Various shapes (Square, Circle, and Triangle) adorn the Arena, each represented in two distinct colors, Red and Yellow, creating a total of six unique combinations as illustrated in the following figure.


  • TR : Red Triangle

    SR : Red Square

    CR : Red Circle

    CY : Yellow Circle

    SY : Yellow Square

    TY : Yellow Triangle
  • Positioned at the OUTER squares of the Arena are four Black Arrows, indicating the Starting Zone for the bot.
  • At the commencement of each turn, a function generates a shape-color combination. Afterwards, the bot is tasked with navigating to the nearest block that matches the specified criteria from its current position.
  • The heart of the Arena serves as the Home Zone. The Bot's objective is to navigate the Arena, completing a full clockwise circuit and returning to the Home Zone upon successful completion of the circuit.

Approach

  • Leveraged the OpenCV library to implement Computer Vision techniques, including Masking, Erosion, Dilation Thresholding and Contour Approximation, ensuring precise Image Segmentation from the arena. This involved extracting and storing all the shape-color combinations, including their respective center coordinates (x,y).
  • Utilized PyBullet, a renowned physics engine, to simulate the bot's movement within the Arena. Furthermore integrated Aruco Markers onto the bot for ensuring real-time tracking of its position in the arena at any instant.
  • Used Breadth First Search (BFS) on a directed graph (where edges are created in the direction of allowed movement) to secure all possible paths from the current position to the target destination (which is identifiable through output shape-color combination), selecting the route with the minimum length for traversal.
  • Implemented a Two Vectors Approach to guide the bot's movement, one indicating bot heading direction and the other vector between successive grids the bot traverses. User-defined functions like dist() - ang() - rotate() and move() are leveraged for ensuring proper alignment and maneuvering the bot within arena.
  • Altered graph edges after the bot crossed the starting zone to ensure the bot completes a clockwise round and does not retrace its previous path. The simulation concludes upon reaching the central home zone.

Installation

It is recommended to set up a virtual environment to avoid conflicts between package versions installed on your system and keep your workspace organized. To create a virtual environment and activate it, please follow the instructions detailed on python venv page. The procedure to deactivate the environment is also provided here.
Before proceeding with installation, please install Microsoft C++ Build Tools.
  • Clone the git repo using git clone https://github.com/asood-life/Vision-2.0.git
  • Install the required packages using pip install -r requirements.txt
  • Obtain additional environment dependencies using pip install -e vision-arena
  • Execute python vision.py to commence the simulation

Contributors


Aadi Shukla


Akshat Sood


If you find value in this project, please consider giving it a star ⭐ to show your support. Should you encounter any issues or have suggestions for enhancements, feel free to reach out to me or register them under the Issues section.

About

Autonomous ⚙️ Arena Simulation using Computer Vision and BFS

Topics

Resources

Stars

Watchers

Forks

Languages