The IoT Web-Controlled Rover was a one-week project which I built with a partner in Intro to Robotics & Mechatronics at Tufts. The rover used the LEGO Spike Prime to control the motors, and the Raspberry Pi 4 for the camera feed, web server, and operating logic.
In the early stages of this project, my partner and I focused on figuring out how to control motors over the internet. We connected the Raspberry Pi 4 to the Spike Prime using a USB cable, and sent commands in MicroPython over the Serial connection. After motor control had been established, I built out the rest of the software.
I wrote a Python control file for the Raspberry Pi, which first sends initialization commands to the Spike Prime, and then hosts a web server to allow for user control. The software pulls the live camera feed using OpenCV, then renders the video on a webpage. The webpage also includes control buttons, which run Python code to send binary messages to the Spike Prime. View the code on GitHub here.
At the end of this project our class held a race through an obstacle course, where the "drivers" remotely operated the rovers from a separate room. Our rover was the only to successfully complete the course.