Learn 4: Experiment With Color Sensing

This is the fifth challenge within the Robotics with GoPiGo and Python Curriculum.

Your task is to design a robot program to deliver a selection of mail to the residents of GoPiGo Drive, a small cul-de-sac containing 3 houses.

Learn how to how to use and calibrate the color sensor.

5. Demo: First, Line Follower

Now that we’ve calibrated both sensors, let’s make our robot follow a line until it either loses that line or identifies a given color, then turn around and come back.

In the Main Code cell we have provided you with a copy of the basic proportional line following algorithm from the Robot Operations Manager mission, with the following minor changes made:

      1. The code has been placed inside a main() function.
      2. The init() function has been removed (it's now called in the Interactive Control Code cell).
      3. A global declaration for our variable container instance (var) has been added and the courier’s state has been reset using the reset() function that we wrote.
      4. References to picker have been replaced with courier.
      5. We’ve also added a stopping condition that is linked to the Emergency Stop button.


Tags: