Our project was to create a line following robot car that could follow two different colored lines. Whenever we put a piece of paper in front of our robot, the robot would stop following the current line and search for a different colored line to follow. To follow the line, we used a high speed camera and image analysis to track the center of the colored line.
The main program used for the robot car was LabView, since the robot car used the myRio. Using program blocks in LabView, we were able to aquire an image through the high speed camera and process the data from the high speed camera directly in LabView. For image analysis purposes, we used a HUE spectrum. One we selected the correct ranges for hue, value, and saturation, we could filter out all of the image except for the color of the line that we wanted the robot to follow.
We also utilized code and knowledge from our previous labs to complete the task of following the robot. We incorporated a turn value, which was determined by where the center of the line was. Using this turn value, the robot could follow the desired lines. In addition, we created a state variable for the different states of the robot. One such state was when the robot would stop and turn 360 degrees until the robot saw the other colored line. To ensure the robot would be looking for the new line, we created a variable new_color which was the desired color the robot would be seeking. This variable switched every time the robot entered the searching state to ensure the robot would keep switching between the two colored lines.
Finally, the group utilized the MSP430 to add turn lights. This was added such that whenever the robot car turned right, the right LED would turn on. Whenever the robot car turned left, the left LED would turn on. And if the robot car was in the search state, both LED lights would turn on. This was created by transferring the turn variable and state variable from the myRio to the MSP430 via I2C. Then, depending on the value of state variable, if the robot was in the search state, both LED lights would turn on.
We have included links to the videos below. We would like to briefly thank Professor Daniel Block and our TA's Yu Chen and Chad Li for all their help with the project.
Video: click here
MSP430 LED Turn Lights: click here