Instruction Guide: Follow the Leader

This lesson ties together all the learning to date. The students must work as a class to design and program a Follow-the-Leader formation.  All the robots will follow a line on the floor, and the lead robot will stop when it encounters an obstacle.  The follower robots must strive to maintain a constant spacing with the robot in front of them. 

This "Problem Solving with Programming" pdf  from the "Challenges" page in "NXT Video Trainer 2.0" discusses the incremental design.  This approach of breaking a large task down, and then incrementally designing/testing one piece at a time is a great antidote to most students' compulsion to jump right in at try to write a complex program all in one step. 

This Advanced Flow Charts PowerPoint describes using Process Blocks to design a hierarchical flow chart of a program.  Each My Block in a student's program would be a Process Block in their flow chart.  Insisting on a hierarchical flow chart as part of the Planning step before NXT-G coding (Prototyping) begins will greatly aid in the software design. 

Follow the Leader Challenge

This challenge is laid out in the Follow the Leader Challenge PowerPoint:

  • A very long line (hallway, cafeteria, gym, etc.) will be needed for an effective demonstration
  • Robots will need a large flat surface in the rear so the the trailing robot's US sensor will get a reliable/consistent measurement
  • Similarly, the line following routine should avoid abrupt swing to the left/right
    • Do not use high power swing turns to implement the line follower
  • The leader program will be different than the follower program.
    • The leader must stop when it encounters an obstacle
    • The leader should not be set to full power, otherwise, the followers will never be able to catch-up when there is a disturbance
  • Students are required to use Advanced My Blocks, passing data from one level of the program hierarchy to another
    • This will likely be the US sensor reading to adjust the speed of a line following My Block
  • This will result in some interesting behavior, as seen in this video
    • Have students try the disruptions shown in the video and create their own.

Have students document the steps of the Engineering Process (restate challenge in their own words, identify related web sites, etc.) that they use in developing their robots. This Engineering Process Log Word hardcopy file may be used to document these steps in writing, or this electronic version may be used for a softcopy.