MAZE SOLVING ROBOT
The Project
The project's aim was to find a goal location within a maze using only monocular Camera input. There were 2 phases of the project.
Exploration Phase: This phase allowed us to explore the maze without being timed.
Navigation Phase: A timed phase where we had to minimize the time of reaching the goal location
Evaluation Criteria
-
Time taken to reach the goal position
-
Accuracy of the goal position
-
Method implementation
-
Submission time
Challenge
-
The goal position was defined by 4 Camera views (Left, Right, Front, Back) taken from the goal position
-
The 4 camera views were revealed after the Exploration phase was over
-
The accuracy of the position reaches was measured by the squares defined around the goal location which was not visible to the participants of the challenge
Method : Exploration Phase
-
First, within see() Function, we check if we are within the exploration phase
-
If so, we write each frame to self.all_fpv and write every 5th frame to the explore_phase folder
-
Subsequently, we perform template matching on consecutive frames by calling our self.slam attribute which is instantiated with our SLAM() object from VisualSlam.py
-
If enough matches are found, we call the get_pose() method from the self.slam object.
-
Then, we check via our last action if a rotation is performed, i.e, Action.LEFT or Action.RIGHT or if a translation is performed- i.e, Action.FORWARD or Action.BACKWARD
-
If only a rotation is formed we extract and use only the rotation matrix. If a translation is performed we use the full transformation matrix.
-
Else, if we were idle, i.e, Action.IDLE, nothing is done.
-
We store the current pose in self.cur_pose
-
This is then appended to the self.estimated_path list.
-
Furthermore, we append the frame count and the calculated pose to the self.location_db dictionary.
-
self.estimated_path is used for the pose graph and self.location_db is used for place recognition
-
The process hierarchy is shown in the flowchart
-
We use ORB and FLANN for feature extraction and matching ( These are used for their speed and efficiency when compared to sift or surf for extraction and Bfmatcher for matching )
Method : Navigation Phase
-
Pass annotated frame to self.fpv to be displayed within pygame
-
Check if the graph is generated,
-
If not, create Bag of words object, self.bovw
-
Make the codebook via sel.bovw.makecodebook()
-
Perform tf_idf calculations via self.bovw.generate_tf_idf_vectors()
-
Compare target images to other images via cosine similarity via self.bovw.search()
-
The search function will return an integer with the frame count from the explore_phase database, this
frame is the closest match. -
Parse this integer to the location_db {} dictionary as a key and store the returned value
-
The list of 4 returned values is passed to visualize_paths() to generate the graph
-
The graph highlights these 4 points in red and computes the centroid in blue, this should correspond to our target location
-
-
The video feed shows some matches and the target location to demonstrate how this annotation helps us.
Underlying Math
Epipolar Geometry: