Mechatronics Final Project

Matlab

Instead of using Microsoft Visual Basic to display the necessary information for the contest, we implemented our VB application functionality into Matlab. The working Matlab application was to display the overall course outline, location of the robot, trace of where the robot has been, and location/color of the golf balls picked up. Using the handles structure of Matlab GUI's, we could simply send/receive data to/from the robot car and update locations and arrays of the handles plotted in the figure using markers.

The course outline and points of interest within the course (5 goal points, blue chute, and orange chute) were simply drawn in the initialization of the Matlab figure by setting the handles within the figure using line-series and circle markers. The robot car was programmed to send/receive a data array of 10 floats to/from Matlab periodically. Utilizing flags and interrupts, the robot would send its dead-reckoned and Kalman-filtered location to Matlab. The location of the robot would then be re-plotted in Matlab every millisecond represented by a square. We also told Matlab to store all previous locations of the robot car in an array to consistently be plotted in the figure using small circles representing the trail of the car. If there were any golf balls detected by the color vision code, the robot would calculate the distance the golf ball was away from the location of the car using the camera and send a calculated X-Y position of the golf ball to Matlab with the color detected (blue or orange). Matlab would then simply plot the golf ball location and color while storing all previous locations in an array.

The end result of our Matlab application was very successful (with much help from our amazing TA Jeff Arena). All golf balls were accurately represented by location and color in our Matlab figure. In addition, the robot car location and trail were spot on for the entire contest. A working example of our Matlab application is shown.

File Icons