I Tried Teaching a Robot Federer's Tennis—From Inside a PC, Until It Returned 117 Out of 200 Balls
The author explains a tutorial-style challenge in which they used imitation learning to teach a virtual robot tennis swing based on Roger Federer's form. Using MuJoCo and Google Colab, the experiment extracted human motion from public videos, translated it to robot joint movements, and practiced in a simulated environment. Initial attempts with the GR00T model failed (0/10), so the author switched to the ACT lightweight model and increased success records to ~1,000 per shot type. A comparison showed that directly providing ball position and speed yielded 11/50 returns versus 0/50 when relying on camera images. The best configuration achieved 117/200 returns (about 60%) on unseen balls in simulation. The author emphasizes that this is a virtual court test, not a real-robot deployment, and provides links to open-source tools and models used.
Can you teach a robot to play tennis?
I made a video of the challenge of teaching it tennis form. In this article, I will talk about the flow of that challenge in order.
What I did this time
Using Roger Federer's form as a reference, I taught the robot a tennis swing using a "learning by imitation" method.
AI that moves a physical body in the real world, not just on a screen, is called "Physical AI."
There are 3 steps to teaching a robot
Find human model movements
Translate those movements to the robot's body
Practice repeatedly in a virtual world inside a PC
Humans and robots have different body shapes. Therefore, using the movements from publicly available practice videos of Federer as a reference, I extracted only the human movements like a stick figure and translated them into the robot's joint movements.
The practice location is a virtual court inside a PC. It is a realistic physical world called a simulation.
Here, I tried many different swings against incoming balls and kept only the ones that successfully returned to the opponent's court. This is called a "record of success." The robot learns by imitating these records.
The first attempt was a total failure
The first one I chose was GR00T, a large and smart public model. A model is the AI that acts as the robot's brain. I thought that if I left it to a large, smart model, it would surely go well.
However, when I tested it with 10 unknown balls, it returned 0.
When I looked into it, there were only 3 records of success available. No matter how smart the model is, it cannot learn well if there are too few records.
I switched to a lighter model and increased the records
So, I switched to ACT (a lightweight model that outputs movements in batches). Because it is light, it can be tested many times. Thinking that the records might be insufficient, I increased the records of success to about 1,000 for each of the two types of shots.
On top of that, I also did a small comparison.
Version that sees the ball only through camera images: 0 out of 50 unknown balls
Version that directly teaches the ball's position and speed: Returned 11 out of 50 balls
This is to investigate the cause by separating it one by one.
The lesson here is that when things don't go well, don't rely on big solutions immediately; instead, verify in small steps and isolate the causes one by one. This time, perhaps what was lacking was not intelligence, but the amount of data recorded. However, this was not compared under the same conditions.
The Finished Robot and the Results
The finished robot observes the ball's position and speed, then chooses between a forehand or backhand to swing. Forehand is hitting with the dominant side, and backhand is hitting with the opposite side; I had it learn them separately.
The result was that out of 200 new balls not used in practice, it was able to return 117. That is about 60%.
Honest Conditions
I will tell you the numerical conditions honestly.
These are the results in a virtual court inside a computer. I have not tested it with a real robot yet.
The robot is not seeing the ball with a camera. The virtual world directly provides the ball's position and speed.
I used the same 200-ball evaluation repeatedly to measure after each improvement. The 117 balls is the result of the best combination among several I tried, not an average, but the best.
The footage at the beginning of the video is a compilation of successful returns. It is not a single continuous match. The robot in the back is a static display.
Everything used is available to anyone
Physics simulator MuJoCo (publicly available for free)
Google Colab (you can borrow high-performance computers on the internet from the free tier)
Already published, finished models
The first step is to try making a robot stand up in MuJoCo.
The next challenge is to hit the ball by seeing it with a camera. Someday, I want to make it so the robot can see and hit with its own eyes.
Have you become a little interested in trying Physical AI? Please also watch the video.
https://youtu.be/cS_khozN6jM
Sources/Links
MuJoCo: https://mujoco.org/ / https://github.com/google-deepmind/mujoco
Google Colab: https://colab.research.google.com/
ACT (Paper): https://arxiv.org/abs/2304.13705 / (Implementation) https://github.com/tonyzhaozh/act
Voice: VOICEVOX: Shikoku Metan https://voicevox.hiroshiba.jp/
The program was written while consulting with an AI assistant.
About Roger Federer
This is a personal challenge that used Federer's form as a reference. It is not affiliated with, supervised by, endorsed by, or partnered with Federer or any related parties. No images, photos, voices, or caricatures of the individual were used. The stick figure on the screen is a self-made illustration.
*The header image and the illustrations in the video are AI-generated images and self-made diagrams.