Activity 14- Obstacle Avoidance

In this activity, we are going to improve upon some of the work we’ve already done with the navigation of the Scribbler.  One of the key problems so far is that even with our sensors detecting objects on the left and right, the Scribbler still ends up in situations where it will hit a wall or an object and get stuck.  The wheels keep turning but the robot is moving nowhere. 

 

There is another sensor we have at our disposal; The Crash Sensor.  Sometimes called a stall sensor, the crash sensor is located in the rear of the scribbler in the back wheel in the center.  Even though this wheel isn’t powered by motors and we can’t programmatically control it, we can read what it is doing by using a question Tile.  Just like we can check for objects or lines, we can check to see if the rear wheel is moving or if it is stalled. 

 

 

If the rear wheel isn’t moving and the front wheels are, Scribbler assumes that the robot is stuck.  One way you can test this stall senor is by placing the Scribbler on a block and programming it to move forward.  Since the wheels are moving, but the rear wheel with the stall sensor isn’t moving, Scribbler will think it is stalled and return a TRUE answer when the question Tile for the stall sensor is used. 

 

View the Stall Sensor Experimentation section before starting this activity.

 

 

Pre-Activity Check List:

 

  • Fresh/Charged Batteries installed into the Scribbler 2 robot.
  • Scribbler Connected to your computer via USB cable and USB to Serial Adapter. 
  • An area where Scribbler can move around safely.
  • Review the Observe a Sensor section of the Scribbler Tips Documentation.

 

 

 

Activity Steps:

 

  1. Open the Scribbler Program Maker on your computer.
  2. Start with a blank program or use the Clear button to clear the program
  3. Create this program below. 
    1. Note: You will notice the new Crash Question Tile is used first.  This is because if was used later in the question series, it may never be checked. 

 

 

  1. Insert the Motion Tiles for each of the different conditions.  Hint: There should be 5 different cases. 
  2. Make sure you utilize either lights or sounds to debug your obstacle sensors. You could play a different note for each condition or flash the lights a number of times to show which condition you are sensing.  What ever you use, it will make testing your robots movements that much easier!
  3. The goal of this activity is to improve upon our last program and make it so the Scribbler moves as freely as possible and rarely gets stuck.
  4. Upload the program and test it out!
  5. Save your program.

 

 

>>Update the Lesson Worksheet with your observations.