In this lab you will use a real robot, called the Scribbler, in
the physical world. Do an update81 to get the starting point
files for this lab.
Check out all of the capabilities of the Scribbler robot. Identify each of the sensors on the robot.
Also find out what
the Fluke can
do. Identify each of the sensors on the Fluke.
In order to use your robot you'll need to do the following:
% python >>> from myro import * >>> init("/dev/rfcommNUM")
If you get the following error message:
Serial element not found. If this continues, remove/replace serial device...Check for the following problems:
After a successful connection you will see a message like this (the name may be different) and your robot will emit a series of beeps:
You are using fluke firmware 2.9.1 You are using scribbler firmware 1.0.2 Hello, I'm Scribby!
The Scribbler robot uses 6 AA batteries, and only works well when it has enough power. The first command you should run each time you begin using the robot is to check its current battery level:
>>> getBattery()If the battery level is below 6.2, replace the batteries. Put the old batteries into the small green battery recycling bin.
The Scribbler is controlled through a python library called Myro. Read through the Myro reference manual trying the commands iteractively in the python interpreter as you go. Not all of the commands will work as described.
For example, the speak command turns a string into spoken
words that will be output through the computer's speakers, not from
the robot. Some computers do not have speakers so you will not hear
anything. Some computers do have speakers, but the volumne control is
set very low.
After you've tried all of the Myro commands interactively in python, explore the obstacle detection sensors available to you in more detail. We would like to write a simple wander and avoid program. There are IR sensors on both the scribbler and the fluke. Which ones work more reliably to detect obstacles? Read about the setIRPower command in the Myro reference manual. You may need to tweak the power setting of the Fluke's IR sensors in order to get reasonable values for obstacle detection.
Edit the program avoid.py in your cs81/labs/2
directory. Using Myro commands, write a program that will cause the
robot to move around and avoid obstacles. You may also want to detect
stalls for situations where the IR sensors don't detect an
obstacle.
Get a big piece of white paper. Insert a pen into the Scribbler's pen port and put it on top of the paper. As the Scribbler moves it will draw a line.
When you are done, run handin81 to turn in your completed lab work.