Previous Page TOC Index Next Page

BeeSoft User's Guide and Reference

2.3 Starting Up the Servers and Sensors


Let’s get ready to put your robot through its paces. First, you need to start up the robot’s 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 robot’s 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:

 cd ~
 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 you’ll 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 demo’s 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 robot’s motors and sensors without worrying exactly where the programs are actually running or how they are communicating with the robot’s resources. Simply, they put these resources at the command of you and the programs you write.

Now, let’s start up baseServer and tcxServer. The baseServer controls the robot’s 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 robot’ssystem.

To start these servers, type at the prompt (yes, case is important!)

 tcxServer
 baseServer 
NOTE: After you type these commands, a great stream of text messages will be displayed. Don’t worry; this is normal.

If your robot has been equipped with a speech synthesizer, start up the speechServer, too. Just type:

 speechServer

At any time, to see which servers are running, type the command

 bCheck

Now, you’re ready to test your robot’s 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 robot’s "base")includes 32 such switches. Pressure on one of these points (for example, by bumping against a person or an object) registers in your robot’s 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

 ./tactileTest

Now, press against any corner of any of the robot’s doors. On your screen, you’ll see two numbers. (If you don’t see anything, try pushing a bit more firmly.) The first is the longitudinal location of the "bump switch," that is, its position around the robot’s 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:

 9  3

This indicates that the bump switch behind the upper right corner of the fifth panel clockwisefrom the rear left of the robot’s 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, it’s not very elegant to detect an obstacle only by bumping into it! In the next few sections, you’ll see why "bumping around" is neither a necessary nor a desirable robot behavior.

When you’re 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 you’re 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

 killall tcxServer.

Undisplayed Graphic

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 robot’s 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, you’ll need to restart tcxServer and baseServer ,and speechServer if your robot has a speech synthesizer, first.) To run the sonar test, just type:

 ./sonarTest

Stand, or just place your hand, in front of one of the sonars. You’ll 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:

 14 427

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. You’ll 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 object’s 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 you’re 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 you’re 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:

 killall tcxServer

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 robot’s 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 obstacle’s 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, you’ll need to restart tcxServer and baseServer ,and speechServer if your robot has a speech synthesizer, first.) To run the infrared sensor test, just type:

 ./irTest

Again, present an obstacle -- yourself, your hand, a notebook -- to the infrared sensors. You’ll 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 robot’s 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 IR’s perception of the obstacle’s 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. You’ll discover that the IR’s 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 robot’s top row of infrareds has detected an object with a reflectance value of 83, indicating the object is quite close.

Don’t 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. You’ll learn more about this topic in Chapter 5.

When you’re 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 you’re 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:

 killall tcxServer

Previous Page Page Top TOC Index Next Page