Instruction Guide: Line Following

Printer-friendly version

In this lesson students extend the idea of embedding a switch block inside a controlled-loop in order to enhance their navigation options through line following. Line following is an iconic robot capability, and its optimization his studied even at the university level.

Have students work through the "Line Following" lesson on the Behaviors page in NXT Video Trainer 2.0.


As students progress through, have them document their milestones in the Line Following Task Assignment Sheet.

The final sign-off for the video lesson is the RoboSlalom Challenge. The layout for the course is flexible, but it should include curves in both directions (some sharper than others) and some straight stretches. The course should be long enough that a "slow" line follower (slow turns/forward progress) that can negotiate the sharpest turns is unable to complete the course within the time limit - the goal is to have students optimize the line following strategy for different parts of the course.

Some key items to look for during this sign-off are:

  • A flow chart that gives an overall view of the program
    • Ask how they developed this flow chart
  • NXT-G program details to see how each block in the flow chart was implemented (including comments that identify the flow chart blocks)
    • Ensure they have no lag in their core Switch block
    • Have them describe the switch block branches for line following
      • Do students understand that line following (as developed in NXT Video Trainer 2) is actually "edge following"? The Switch block at the heart of the their program is basically saying, "If I'm on the line, get off - if I'm off the line, get back on" - thus, they waddle along the edge of the line.
    • Ask how they optimized for different parts of the course
      • What other way could they further optimize performance (e.g. - multiple thresholds to turn less when you are just a little off the line and more if you're way off the line, etc.)
  • What obstacles did they encounter and how did they overcome them.

This Line Following Task Assignment Sheet also includes several extended challenges.  The Obstacle Course Challenge, The Capain's Buried Treasure, Part 3, and Extreme Line Following all combine many of the skills covered in "NXT Video Trainer 2.0."