Lab 8: Line Following Solution



Lab Objectives

By the end of this lab you should be able to:

    1. Use what you have learned about the Scribbler 2 to create a program that enables your

  • robot to exhibit line-following behavior.

Putting It All Together

For this lab, you will need to use all of the programming skills you have gained from the previous labs to develop a program that enables your robot to autonomously navigate a line-following course that will be provided by your instructor. Since the previous labs have equipped you with all of the tools you will need, you will be given very little instruction as to how you

should accomplish this task.

While the structure of the program is up to you, there are some required behaviors that your robot must perform in order for you to receive full credit for this lab. Your robot must:

    1. Successfully complete at least one lap in each direction around the line-following course.

    2. Be able to autonomously get back on the course if it loses the line.

    3. Use its LEDs to indicate whether its left, right, or both line sensors detect the black line

  • of the course.

What to Turn In

You will turn in your complete line-following program. This includes all CON, VAR, OBJ and PUB

sections of your code. At the beginning of your code, you should include a paragraph or two that explain how your program executes the required task. This explanation must illustrate your strategy for keeping the robot on course and your strategy for getting the robot back on course if it loses the line. You should also sufficiently comment your code so it is clear what each part of your program does.

Extra Credit

Accompanying the basic oval line-following course will be a more difficult course that requires a much more robust feedback control program to complete. Extra credit will be given to any and all groups that can successfully complete a full lap in either direction around the more difficult course .

When it comes to programming and engineering in general, the simplest solution is usually the best solution. With this in mind, extra credit will be given to the group in each lab section that is able to get their robot to complete the three basic requirements with the fewest lines of code. In the event of a tie, the group that was checked-off first will get the extra credit.

Note: There are many examples of line-following robots and programs online. While it is acceptable to use these resources to come up with a strategy for how to complete this task, it is unacceptable to directly copy code. All of the code you turn in for this lab should be solely the work of you and your group members.

error: Content is protected !!