Previous Page TOC Index Next Page

BeeSoft User's Guide and Reference

5.3 Tactile Sensors

The upper enclosure of your robot is equipped with smart panels, containing so-called "bump switches;" 4 on each door, located more or less behind the corners. There are 16 tactile switches on a B14's enclosure; on a B21's enclosure, there are 24. On the robot’s mobile base, there are also tactile switches behind the corners of each door. On the B21's base, there are 32 such switches. On the B14's base, there are 24 actual, physical switches, but they are wired together in groups of 4 so that, logically, they act in operation as 6 switches. (The two switches behind the left corners of a door are wired together with the two switches behind the right corners of the immediately adjacent door.) Pressure on one of these points (for example, by firmly bumping against a person or an object) registers in your robot’s consciousness as a piece of sensory data.

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! Fortunately, the robot’s other, more sophisticated, sensory systems insure that blindly bumbling around is neither a necessary nor a routine robot behavior.

The Tactile Application Program Interface (API)

These are the calls and data structures you need to know about to use the your robot’s tactile sensors.

Tactile Data Structures

tactileType tactiles[B_MAX_SENSOR_ROWS] {B_MAX_SENSOR_COLS] - The array containing the values returned by the tactile sensors. As each tactile sensor returns its readings, it fills in the two-dimensional array structure, tactileType. Each individual element in the array tactiles, of type tactileType, looks like this:

value: A character representing whether or not that sensor has been touched. 1 means it’s been touched; 0 means it hasn’t.
time: A timeval struct indicating the time the reading was received.

bRobot.tactile_rows - Number of rows of tactile sensors on the robot, numbered from the top of the robot starting at 1.

int bRobot.tactile.cols[bRobot.tactile_rows] - An array containing the actual number of of tactile sensors, and their values, for each row. If bRobot.tactile.cols[0] is n, then bRobot.tactile.cols[0][i] does not contain valid data for n >= 0. You can use the value of bRobot.tactile.cols to iterate through the valid rows of tactile sensors.

Tactile API Function Calls

void registerTactileCallback (tactileCallbackType);

Specifies which function BeeSoft should call when it has a fresh set of tactile sensor readings available. It will be called with an updated array of tactileType.

void tactileInit(void);

Initializes the tactile sensor system. Call this before calling any other tactile function.

void tactileStop(void);

Halt operation of the tactile transducers. You don’t need to use this unless your program needs to halt, and then restart, the tactile sensors, for example, to push an object.

void tactileStart(void);

Begin operation of the tactile sensors once you’ve halted them.

Previous Page Page Top TOC Index Next Page