2.3 Starting Up the Servers and Sensors
Lets get ready to put your robot through its paces. First, you need to start up the robots tactile ("bump"), sonar and infrared sensors, if they are not already switched on.
If you have a B14 robot, turn on the sensor control switch, the leftmost toggle switch in the row of four toggle switches located on top of the robot.
If you have a B21 robot, turn on the middle toggle switch in the bank of six toggles behind the right rear door of the robots enclosure.
Next, build the example programs. Remember, you are logged in as demo, so the cd~ command will take you to the home directory for demo. Type:
cp -r ~bee/src/beeExamples . (be sure to type the dot at the end!) cd beeExamples make
This make command makes all the test and example programs youll be using in this Quick Start Guide. Therefore, you need only run the make once. However, nothing bad will happen if you run it multiple times.
The first cp command above copies the beeExamples directory into demos home directory on the robot.
Now, you need to start up some special programs called servers. These programs establish a mechanism through which you can talk to the robots motors and sensors without worrying exactly where the programs are actually running or how they are communicating with the robots resources. Simply, they put these resources at the command of you and the programs you write.
Now, lets start up baseServer and tcxServer. The baseServer controls the robots mobile base -- its motors for moving forwards and backwards and rotating about its axis and the robots sonar sensors, infrared sensors, and tactile or "bump" sensors. The tcxServer manages communication flow among all programs running on all computers in your robotssystem.
To start these servers, type at the prompt (yes, case is important!)
NOTE: After you type these commands, a great stream of text messages will be displayed. Dont worry; this is normal.
If your robot has been equipped with a speech synthesizer, start up the speechServer, too. Just type:
At any time, to see which servers are running, type the command
Now, youre ready to test your robots sensors.
2.3.1 Tactile Sensor Test
The upper enclosure of your robot contains 24 so-called "bump switches;" 4 on each door, located more or less behind the corners. The lower enclosure (the robots "base")includes 32 such switches. Pressure on one of these points (for example, by bumping against a person or an object) registers in your robots consciousness as a piece of sensory data. To find out how these "bump switches" work, try this simple test. (Be sure baseServer and tcxServer are running, and speechServer is running if your robot has a speech synthesizer!) Just type
Now, press against any corner of any of the robots doors. On your screen, youll see two numbers. (If you dont see anything, try pushing a bit more firmly.) The first is the longitudinal location of the "bump switch," that is, its position around the robots perimeter. Switch zero is located at the left rear; numbers ascend clockwise. The second number tells you the latitude of the touched bump switch, that is, its distance from the top of the robot. The top row of switches is represented as 1; the lowest row as 4. The screen display might look like this:
This indicates that the bump switch behind the upper right corner of the fifth panel clockwisefrom the rear left of the robots base was bumped.
Experiment with these tactile sensors for a while. Useful as they are, RWI, Inc. likes to think of these bump switches as "sensors of last resort." After all, its not very elegant to detect an obstacle only by bumping into it! In the next few sections, youll see why "bumping around" is neither a necessary nor a desirable robot behavior.
When youre ready to go on to the next test, just type <CTRL-C> on your computer. This will terminate the currently-running test.<CTRL-C> stops only the test program (also called the client program). The servers will still be running.
Remember: When youre all through testing, or want to take a break before going on to the next section, you can stop all running servers and client programs simply by typing
Figure 2-1: Sonar Numbering on the B21 and B14 robots.
2.3.2 Sonar Sensor Test
Your robot is equipped with an array of sonar sensors. (They are the gold colored circular disks running around the perimeter of the robots upper enclosure; on the B21, the 24 sonarsare about 74 centimeters above the floor; the B14's 16 sonars are 50 centimeters above the floor.) The robot "reads" its sonars about three times per second.
To begin to appreciate the capabilities of these sensors, run this simple test. (If you ran killall tcxServer before, youll need to restart tcxServer and baseServer ,and speechServer if your robot has a speech synthesizer, first.) To run the sonar test, just type:
Stand, or just place your hand, in front of one of the sonars. Youll see two numbers on your screen. The first represents the sonar which is closest to a detected obstacle -- in this case, you or your hand. The second number is the distance, in millimeters, from the obstacle to the center of the robot. Like bump switches, sonars are numbered; sonar zero is at the left rear of the robot; numbers ascend clockwise around the outer perimeter. (See Figure 2-1.) The screen display might look like this:
This indicates that the fifteenth sonar sensor, clockwise from the rear left of the robot, thinks it has detected an obstacle 427 millimeters away from the center axis of the robot..
Experiment with positioning obstacles for the various sonars to detect. Youll notice that each sonar detects obstacles in a cone-shaped range that starts out, close in to the robot and spreads outwards at about 15 degrees. Observe how an objects surface characteristics (smooth or textured, for example) affect the way it is detected. Then, vary the angles of obstacles presented to the sonars (you can use a flat notebook for this, for example) to see how the presentation of an obstacle at a steep angle affects its "visibility" to the sonar sensors.
When youre ready to go on to the next test, just type <CTRL-C> on your computer. This will terminate the currently-running test. <CTRL-C> stops only the test program (also called the client program.) The servers will still be running. Remember: When youre all through testing, or want to take a break before going on to the next section, you can stop all running servers and client programs simply by typing:
2.3.3 Infrared Sensor Test
Your robot also carries one or two rows of infrared sensors. These are in the rectangular openings arrayed around the robots perimeter, along the lower section of the upper enclosure, and -- on the B21 robot -- around the lower part of the mobile base. On the B21 robot, there are 56 (24 on the enclosure and 32 on the base); the B14 carries 16. These sensors estimatethe approximate proximity to an obstacle by emitting light and measuring the intensity of the reflection bounced back off the obstacles surface. The robot "reads" these IR sensors about ten times per second. To experiment with the capabilities of these sensors, run this little test. (If you ran killall tcxServer before, youll need to restart tcxServer and baseServer ,and speechServer if your robot has a speech synthesizer, first.) To run the infrared sensor test, just type:
Again, present an obstacle -- yourself, your hand, a notebook -- to the infrared sensors. Youll get 3 numbers this time. The first two tell you the position of the infrared sensor that "sees" something. As with the "bump switches," the first number is the longitudinal location of the reporting sensor around the robots perimeter. IR zero is located at the left rear; numbers ascend clockwise. The second number tells you the latitude of the detecting IR; that is, its distance from the top of the robot. The top row of IR sensors is represented as 0; ascending numbers are lower down.
The third number is the actual measurement of the IRs perception of the obstacles reflectance. Values range from zero (no reflectance) to 100 (full reflectance). With this value, you can approximate the distance from the robot to the obstacle. Try a few simple experiments. Youll discover that the IRs have a fairly short range (about ½ meter) and that the reflectance value is heavily dependent on the color of the object detected. Try white objects, and solid black objects, for example, and note the results carefully. The screen display might look like this:
6 1 83
This indicates that the seventh infrared sensor clockwise from the rear left of the robots top row of infrareds has detected an object with a reflectance value of 83, indicating the object is quite close.
Dont worry too much if you get some strange results in these sensor tests; learning to properly interpret and use sensor readings takes a bit of practice. Youll learn more about this topic in Chapter 5.
When youre ready to go on to the next section, just type <CTRL-C> on your computer. This will terminate the currently-running test. <CTRL-C> stops only the test program (also called the client program.) The servers will still be running. Remember: When youre all through testing, or want to take a break before going on to the next section, you can stop all running servers and client programs simply by typing: