FRC Vision

роботы + зрение・ロボット+ビジョン・Robots + Vision

Infinite Recharge

Every year, FIRST creates a game for students. The game involves making a robot from scratch inside a 2 month time frame. The 2020 game involved a robot shooting yellow balls into a hexagon target with a smaller circle in the back which gives teams more points. For more information on the game check out the game manual

How it works

To get accurate vision readings, our camera shines a green ring light(which is around the robot) at the target (which is lined with retroreflective tape). By doing so, we can identify the target as a blob after turning down the camera’s exposure. From there, we take the width of the blob and find the distance and angle to the target.

Finding the distance and angle to the target lets the robot line up perfectly with its target and calculate the speed required in order to shoot inside the target consistently

This is a replacement for the limelight camera that most teams use. This variability in the placement of the shots taken allows the people who drive the robot ease in shooting and makes their job much easier.

In the example below the robot’s turret follows the target around using a PID Loop to keep the motion smooth and optimal.

Target

The lower half of the hexagon above is lined with reflective tape

By putting a ring light around the OpenMV camera, the light reflects back at the camera and filters the blob well.

Distance and angle measurements

This is the formula to get the distance to the blob, this tells the robot’s flywheel what speed it should be spinning at in order to get in the goal

FRC Vision Distance Calculation

This is the formula for the angle to the target in x degrees, this information tells the robot how much it needs to turn the turret to line up with the target

FRC Vision Angle Calculation

In order to identify the flywheel speeds necessary to make our shots with consistency, we plotted different speeds and distances to apply a curve fit. When shooting, we take these values and rotate the flywheel by that many radians per second.

Resources

We used an OpenMV camera and used the techniques highlighted here to process targets and get the data points we need. To communicate these values we use USB over serial and recieve those values in the Java code.

Here’s a CAD of how the ring light was implemented on our turret

Here’s the code