Inspiration

We watched a video of a CV expert using a raspberry pi to follow a tennis ball and thought we could apply it to a robot.

What it does

Recognizes if a tennis ball is in front of it. If yes, track the ball and get close enough to it. To track the ball the raspberry pi will calculate the distance and angle away from the ball. A control loop is used to drive the difference between the desired position and actual distance to zero. Put together, the robot rotates to find the tennis ball, the drives towards the ball, and corrects itself if slightly off.

How we built it

We used a raspberry pi to do the computer vision and control calculations. The raspberry pi will send motor commands to a motor controller which operates the motors.

Challenges we ran into

Our biggest challenge At first we were using an Arduino to perform the motor control, and using the raspberry pi to only send distance away from ball calculations. Unfortunately, the delay in the serial communication between the two systems was too high, and the control loop kept overshooting the ball. We had to figure out how to make the raspberry pi control the Arduino-based motor controller to get rid of a lot of the lag in the system. Because there was still too much lag, we had to slow the system down so that the system had time to react to the computer vision distances.

Other challenges: Connecting hardware to internet Filtering objects that look like tennis balls Opencv has steep learning curve

Accomplishments that we're proud of

That we were able to successfully implement a computer vision on a robot. We didn't realize how big of a problem getting rid of lag from a control system could be. But creatively finding ways to reduce lag was rewarding.

What we learned

How to use opencv and implement a real life control system.

What's next for Robot Object Recognition and Tracking

Would like to figure out faster communication protocols between the Arduino and the raspberry pi so that the arduino can go back to doing motor control. Also interested in applying ROS to our system.

Built With

Share this project:

Updates