Image Processing WiFi Robot

GOALS: Design a robot that can be controlled over wifi
SKILLS: MicroPython, ESP32, MQTT, CAD, 3D Printing, CV2, Image Processing

This was a project done for my Intro to Robotics Class, where we were tasked to create a robot that could follow an object using image processing!

Image Processing


The robot connects to a Macbook (and then uses AirPlay to connect to an iPhone) over WiFi in order to recieve directional information from the camera. We separated the feild of view into three sections - left, right, and center - in order to identify which direction the robot should turn towards.
My laptop is very old and I think the image processing + wifi + screen recording combo makes the output text really laggy :-( But when not recording it live updates which direction it is sending over to the robot by calculating the distance away the center of the object is from the middle of the screen.

CAD

Hardware

Here's the CAD Model for the robot! It's a pretty simple robot chassis
with two driven wheels in the front, a caster wheel in the back,
and a phone stand on top.

WiFi Integration

I used MQTT to have the computer communicate with our robot's
ESP32. The computer posted to a channel that the robot was
subscribed to so that it could listen in for commands. Once the
computer determined which way the robot should turn based off
of the image processing info, it just some pretty simple motor PWM
control to spin the motors in different ways!

robot code! image processing code!

Everything That Went Wrong and How I Fixed It

  • The first iteration of the robot's chassis had the motors spaced too closely together, and the screw holes that the motor mounts were clipping against the wheels which weakened the motor mounts over time. This was a pretty easy fix by just widening the frame and placing the screw holes somewhere else

  • When I first put the wheels on, they were running at different speeds, and I realized this was becuase I had fiddled around with the gearboxes for a prior project, and had forgotten to change them back. Pretty easy fix of just putting in fresh motors, but will definitely not mix my diy-ed motors and my real motors together again.