Now that your BallyBot can detect faces, it's time to take it to the next level! Imagine you're at a robotics competition, and you want your robot to interact with the audience. With face following, your BallyBot can track and follow a person's face, creating a more engaging experience.
In this lesson, you'll learn how to program your BallyBot to follow a face using its motors. This will enable your robot to pivot to keep faces centered in view, making it perfect for applications like security, surveillance, or even social robotics.
By combining face detection with motor control, you'll create a more dynamic robot that can respond to its environment. Get ready to bring your BallyBot to life!
Step 0: Starting CodeBegin with your working code from Lesson 9 (Face Detection). Remove any web server or streaming components to free up system resources for motor control. This simplifies the code and improves performance.
Modify the face detection loop to calculate the horizontal center position of detected faces. You'll need to:
- Access the face's bounding box coordinates
- Calculate its center point (X-position)
- Compare this to the center of the camera frame
This gives the positional data needed for tracking decisions.
Double-check that all web server components from previous lessons are fully removed. This ensures maximum processing power is dedicated to face detection and motor control.
Step 6: Upload & TestThis section is assuming you are using the BallyBot's breakout Board to upload:
- Connect FTDI uploader
- Make sure Arduino IDE has AI Thinker ESP32-CAM board selected
- Select the correct port for the ESP32-CAM
- Click the Upload Button
- Turn the BallyBot upload switch up and then turn the power switch off -> on
- Once Arduino IDE finished upload turn BallyBot upload switch down and power off -> on
Your BallyBot now actively follows faces! This breakthrough enables:
- Social robotics that engage with people
- Intelligent surveillance tracking
- Interactive competition entries
Comments
Please log in or sign up to comment.