Skip to content

Object detection — build an AI that chases

Teach the robot to recognize an object and chase it — the perception → control loop behind every "follow me" robot. No notebooks needed: you build it with the AI tutor, piece by piece.

1. Detect

Ask the tutor in the panel:

"Write a script that runs YOLO on the camera and prints what it sees with confidences."

Run it and watch the detections stream in. Put a ball or a cone in front of the robot (in the simulator, the built-in worlds have both) and confirm it shows up.

2. Aim

Detection gives a box; behavior needs an error:

"Now steer toward the highest-confidence sports ball: box center vs frame center → steering."

Drive it. The robot should turn to face the ball wherever you put it.

3. Chase

Distance comes from box size:

"Add speed control: bigger box = closer = slower, and stop at a safe size. Stop the robot when I interrupt the script."

Now move the ball — the robot follows and keeps its distance. Congratulations: perception → control, closed.

Make it yours

  • Swap the target class (person? cone?) and see what breaks.
  • Show detections in your own MyApp view.
  • Take it to the real robot — lighting will fight you.

How detectors work → Learn: object detection

AI