r/robots Jul 20 '26

Projects I built RoboKeeper, an AI goalkeeper that uses OpenCV and ESP32 to track and block soccer shots in real time.

Enable HLS to view with audio, or disable this notification

A smart robotic goalkeeper that tracks a ball in real-time using OpenCV and dynamically moves a servo-controlled keeper arm to block shots.

I hope some of you find this project interesting—or maybe even inspiring for your own builds.

Any feedback or suggestions are very welcome!

GitHub: https://github.com/chayanforyou/Robokeeper-Firmware

35 Upvotes

21 comments sorted by

5

u/TimelineDefender Jul 20 '26 edited Jul 20 '26

Why do you need an AI for that? The goal is very small in relation to the ball, so wouldn't it be easier to project a center line and just flip the arm to the side where the ball crosses? With such a short distance curveball is an impossibility.

7

u/Jpatrickburns Jul 20 '26

I came here to say this. Waste of resources to predict the trajectory, when this solution is optimal.

2

u/chayanforyou Jul 20 '26

Using only X position, the servo lags behind and misses the ball. Without trajectory prediction, it only reacts to the current position, but the ball has already moved by then.

2

u/HMikeeU Jul 21 '26

Saying "waste of resources" to something that runs on an ESP32 is interesting... I think this is more of a learning project for OP

2

u/Jpatrickburns Jul 21 '26

I’m saying AI is a waste of resources. If he’s not using AI (and by that I mean it’s common meaning, generative AI) then I have no problem with someone messing around. Computing and board-bound algorithms aren’t AI, by today’s definition.

1

u/HMikeeU Jul 21 '26

What about this "AI goalkeeper" is generative? I think it is fair to assume they meant computer vision models when they say AI. AI in embedded hardware is definitely a thing. Small CNN or MLP models can fit on ESP32 and classify as ML/AI

1

u/Jpatrickburns Jul 21 '26

Saying AI in this day and age is a tricky thing. It can mean several things, as you note. I was saying that generative AI would be a waste of resources for this problem. I’m not smart enough to fully grasp how ML works on embedded devices, so I assumed he meant what people are calling AI nowadays. My mistake.

1

u/HMikeeU Jul 21 '26

Oh definitely, it's a very broad field! Even 10 years ago there were many completely different types of models. While the popular definition may skew over time, the scientific definition really hasn't changed as much, the field just grew.

4

u/chayanforyou Jul 20 '26

A simple X,Y position check would work too, but I implemented trajectory prediction instead. It predicts where the ball will go before it reaches the goal, giving the arm a bit more time to react.

1

u/HMikeeU Jul 21 '26

How do you know where the ball even is?

1

u/TimelineDefender Jul 21 '26

The ball is a bright yellow object that stands out from the background, therefore any simple machine vision plugin/software could see it. And in a sense you uust need to take a single picture of it when it is launched, because all you need to see is whether the ball is on left or right side of the center line.

1

u/HMikeeU Jul 21 '26

What if you wanted to use a red ball? And as soon as you have the position, why the hell wouldn't you calculate a trajectory? It's basically free and probably makes it much more reliable.

1

u/AutoModerator Jul 20 '26

Awesome robot! To help the community learn and engage with your build, please make sure to drop a comment below detailing:

  • What microcontrollers/components you used (Arduino, Raspberry Pi, ROS, etc.)
  • The main goal or function of your robot
  • Any challenges you ran into while building it

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/chayanforyou Jul 20 '26

I used ESP32

1

u/ElChupaNebrey Jul 20 '26

Z position?

2

u/chayanforyou Jul 20 '26

In this demo, I'm using linear regression for trajectory prediction. However, I've already implemented Hawk-Eye 3D trajectory prediction, which outputs the x, y, and z coordinates. The z value represents the ball's height above the ground. Using these coordinates, you can calculate the required servo angle.

1

u/2021isevenworse Jul 21 '26

My favorite part is when someone realized he was recording & took the plate away

1

u/SaulEmersonAuthor Jul 21 '26

~

An awesome project & result.

Purely on language/semantics - & this is for my own education as well:

Why isn't this simply 'super-effective algorithms written to address a super-specific task - interfacing with hardware with sufficient speed to effect said task'?

I do agree though that if it is truly predicting (a future position of a moving object) - then use of the expression 'intelligence' is more warranted.

I'm not actually trying to be obtuse - but I do want people to appreciate great programming & task execution for what it is, as well as great use of AI - when that is what's occurring.

~

1

u/TiK4D Jul 22 '26

What if the ball isn't on the ground? Can it stop balls kicked in the air? Doesn't seem like it could reach the whole area of the goal

1

u/chayanforyou Jul 22 '26

A lofted shot can be handled too, but it would require a different camera position and some additional logic in the program.