Mars Rover Project

Mechatronics 2 Group Project | Year 4 IDE
November 2020 | 4 Weeks

Working in teams of 4, we were required to build a robotic 'mars rover' contained within a plastic sphere and controlled over WiFi using an Arduino Nano 33 IoT. A an overhead 'satellite' (webcam) was mounted facing downwards to capture a live feed of the robot, which could then be processed by a connected 'mission control' laptop to locate the robot and other objects and communicate with the Arduino accordingly. The robot was to be tested in a 30-minute demonstration in which it would move from point to point. In addition, an 'event' of the team's devising was to happen at some arbitrary point during the demonstration which the robot would have to respond to. However, the task was open-ended and we were encouraged to add other elements to make it more interesting and challenging.

The Arduino was programmed using Simulink, MATLAB's block-modelling package, and the mission control program was written in Python using the OpenCV computer vision library and ArUco fiducial marker library.

My role in the team was to write the low-level Python code, which consisted of two parts:

  • The vision system, which processes raw images from the webcam and locates the robot and other objects within them
  • The communication system, which takes high-level (go to xy) instructions and communicates with the Arduino as necessary based on the robot's current position

Gallery

This project has no images :(

The finished prototype had several notable features (those I personally developed are in bold):

  • Active damping of lateral oscillations using front- and rear-mounted pendulums
  • Anti-reflection filtering to eliminate problems with detecting the robot's ArUco marker through the plastic sphere under different lighting conditions
  • Bidirectional motion - the robot selects whether to drive forwards or in reverse to minimise the amount of turning
  • Active course correction during moves, which compares the robot's trajectory with the target direction and adjusts the motor speeds to keep it on track
  • Line tracking to locate 'walls' (strips of tape), which averages across multiple frames for stability
  • A* pathfinding to find a route around the walls to a target location, with fallback methods for robustness