Autonomous Robot With Vision
This is an autonomous routine that I programmed for my high school team’s robot for the First Tech Challenge 2023-2024 Center Stage game. The goal of the autonomous portion of this game is for a robot to spot the red cone at one of three possible positions (indicated by the three red tape lines) and place a marker piece next to it on the tape, then to go over to the backdrop board and place a second piece on the board. The robot in the video achieves this using a mounted webcam in combination with my routine. It is not instructed where the cone is placed before it starts.
To write the code for this routine, I had to familiarize myself with OpenCV and basic image processing. I learned about color spaces and the pros and cons of the RGB, YCrCb, and HSV color spaces in image processing. In the end, I went with YCrCb. I also had to implement an AprilTag scanning API to count the markers on the board.
To me, the biggest challenge of this robot game was the precision necessary for success. It was all or nothing: even the smallest mistake could massively devalue the autonomous routine. For instance, if you mixed up the yellow and purple pieces when loading them into the robot before a match, then a routine worth 50 points would suddenly be worth just 15. If the robot missed its mark placing any of the pieces during the routine, it would lose a massive number of points. For all my work to be worth anything, I had to get everything exactly right.