Previous Page TOC Index Next Page

BeeSoft User's Guide and Reference

3.9 The wander Application: A BeeSoft Demo


In this application, you’ll use a BeeSoft-supplied API called baseClient, that gives you a simple way to address the robot’s sonar sensors, infrared sensors and tactile ("bump") sensors, as well as to control the motions of the robot’s base.

Now, you’ll study and run a BeeSoft-supplied example program called wander. (You’ll find the complete source code for wander in ~bee/src/beeExamples.). This simple demonstration program sets your robot wandering around within a confined area. Wander collects sonar, tactile and infrared (IR) sensor information into a list of obstacle points that it stores as world coordinates. Each time wander gets a motion control status update from baseServer, it scans the lists of obstacles it’s seen for the one that’s closest, and within a 180 degree arc directly in front of the robot. Wander then calculates a translate velocity and rotate velocity to avoid that obstacle.

Wander’s strategy is typical of robotic operations: check current observations, continue or alter ongoing actions as appropriate, and then recheck, iteratively. To do this, wander is incorporated into a module under the control of the BeeSoft Scheduler.

Study wander carefully, especially if you are a novice roboticist. Once you have a feel for what the code is doing, you can use it as a handy template, expanding it and modifying it to experiment with various robot motion commands.

Running wander

Wander accepts the following arguments on its command line:

-safetyMargin=X : Try to go no closer than X cm to the closest obstacle
-exploreRange=X : Wander no further than X cm from the start point.
-transSpeed=X : Go no faster than X cm per second.
-transAccel=X : Accelerate and decelerate at X cm per second squared.
-rotSpeed=X : Rotate no faster than X degrees per second. (wander will convertthe degrees per second to radians per second.)
-rotAccel=X : Accelerate and decelerate the rotate axis at X degrees per second squared.

To run wander, type the following. (Remember, if you already ran a make while performing the tests and demos in the BeeSoft Quick Start Guide, you don’t have to do it again.) Include any optional command line arguments you like from the above list.

 cd ~/beeExamples
 make
 ./wander 
Watch your robot’s progress closely; be ready to intervene if it might be in danger of colliding with an obstacle the sensors can’t detect. If you’re concerned at any time that the robot might get into trouble, hit the kill switch immediately. Then, follow the directions in the box below to restart the robot. If you’ve prepared your test area properly, though, this should never happen.

To terminate the wander program, just type <CTRL-C>.

Once you have wander up and running, try making a few simple modifications, one at a time, to experiment with different types of callbacks, varying polling intervals, motion controls, etc. With a bit of experience, you’ll gain a intuitive sense for controlling your robot’s behavior. The calls you’ll need are described below, and in Chapter 4, Making the Robot Move.

After an Emergency...Restarting after the "Kill Switch"...
After hitting the kill switch (either the single kill switch on the B14 or either of the two kill switches on the B21), you cannot restart your robot operations with software commands alone. You must do the following steps:
1. Stop all servers by typing: killall tcxServer 
2. Reset the robot:
 On a B21...
a. Press the kill reset button, the top of two red buttons found on
                  the base  control panel, the panel set into the door with the
                  yellow dot on top. 
b. Press the system reset button, the top red button on the base 
                  control panel. 
 On a B14...
Reset by pushing the base switch (the second toggle from the right
                on the top of the robot) forward again. 
3. Restart the servers by typing:tcxServer  followed by
                 baseServer 

Previous Page Page Top TOC Index Next Page