• Aucun résultat trouvé

Combination of fields and behaviors

Dans le document TION T O ROBO TICS (Page 151-155)

4 The Reactive Paradigm

4.4 Potential Fields Methodologies

4.4.5 Combination of fields and behaviors

return outputVector;

}

At this point, it is easy to illustrate how a potential field can be used by a behavior,runaway, for the robot with a single sensor. Therunaway behav-ior will use therepulsive()function as the motor schema, and a function readSonar()as the perceptual schema. The output of the behavior is a vector.runawayis called by the robot on every update cycle.

vector runaway( ){

double reading;

reading=readSonar();//perceptual schema

vector=repulsive (reading, MAX_DISTANCE); //motor schema return Voutput;

}

while (robot==ON) {

Vrunaway=runaway(reading); // motor schema turn(Vrunaway.direction);

forward(Vrunaway.magnitude*MAX_VELOCITY);

}

4.4.5 Combination of fields and behaviors

As stated earlier in the chapter, the first attribute of a true potential fields methodology is that it requires all behaviors to be implemented as potential fields. The second attribute is that it combines behaviors not by one sub-suming others, but by vector summation. A robot will generally have forces acting on it from multiple behaviors, all acting concurrently. This section provides two examples of how multiple behaviors arise and how they are implemented and combined.

The first example is simple navigation, where a robot is heading for a goal (specified as “10.3m in direction”) and encounters an obstacle. The motor

Figure 4.15 A bird’s eye view of a world with a goal and obstacle, and the two active behaviors for the robot who will inhabit this world.

schema of themove2goalbehavior is represented with an attractive poten-tial field, which uses the shaft encoders on the robot to tell if it has reached the goal position. Therunawaybehavior is a repulsive field and uses a range sensor to detect if something is in front of it. Fig. 4.15 shows a bird’s eye view of an area, and shows a visualization of the potential field. Themove2goal behavior in Fig. 4.16b exerts an attractive field over the entire space; where ever the robot is, it will feel a force from the goal. Therunawaybehavior in Fig. 4.15 exerts a repulsive field in a radius around the obstacle (technically the repulsive field extends over all of the space as does themove2goal, but the magnitude of the repulsion is 0.0 beyond the radius). The combined field is shown in Fig. 4.16c.

Now consider the emergent behavior of the robot in the field if it starts in the lower right corner, shown in Fig. 4.17. At time

t

0, the robot senses the world. It can only perceive the goal and cannot perceive the obstacle, so the only vector it feels is attraction (runawayreturns a vector with magnitude

Figure 4.16 Potential fields from the world in Fig. 4.15: a.) repulsive from the obsta-cle, b.) attractive from the goal, and c.) combined.

of 0.0). It moves on a straight line for the goal. At

t

2, it updates its sensors and now perceives both the goal and the obstacle. Both behaviors contribute a vector; the vectors are summed and the robot now moves off course. At

t

3,

the robot has almost moved beyond the obstacle and the goal is exerting the stronger force. At

t

4, it resumes course and reaches the goal.

The example illustrates other points about potential fields methods: the impact of update rates, holonomicity, and local minima. Notice that the dis-tance (length of the arrows) between updates is different. That is due to the changes in the magnitude of the output vector, which controls the robot velocity. If the robot has a “shorter” vector, it travels more slowly and, there-fore, covers less distance in the same amount of time. It can also “overshoot”

as seen between

t

3and

t

4where the robot actually goes farther without turn-ing and has to turn back to go to the goal. As a result, the path is jagged with sharp lines. The resulting path will be smoother if the robot has a faster

Figure 4.17 Path taken by the robot.

update interval. Another aspect of the update rate is that the robot can over-shoot the goal, especially if it is using shaft encoders (the goal is 10.3 meters from where the robot started). Sometimes designers use attractive fields with a magnitude that drops off as the robot approaches, slowing it down so the that the robot can tell with it has reached the goal. (Programmers usually put a tolerance around the goal location, for example instead of 10.3m, the goal is 10.3m+/- 0.5m.)

Potential fields treat the robot as if it were a particle that could change ve-locity and direction instantaneously. This isn’t true for real robots. Research robots such as Kheperas (shown in Fig. 4.18) can turn in any direction in place, but they have to be stopped and there is a measurable amount of error due to the contact between the wheels and the surface. Many robots have Ackerman, or automobile, steering, and anyone who has tried to parallel park an automobile knows that a car can go only in certain directions.

A third problem is that the fields may sum to 0.0. Returning to Fig. 4.16, draw a line between the Goal and the Obstacle. Along that line behind the Obstacle, the vectors have only a head (direction of the arrow) and no body (length of the arrow). This means that the magnitude is 0.0 and that if the robot reaches that spot, it will stop and not move again. This is called the local minima problem, because the potential field has a minima, or valley, that traps the robot. Solutions to the local minima problem will be described at the end of the chapter.

Figure 4.18 Khepera miniature robot: a.) a khepera on a floppy disk, b.) IR sensors (small black squares) along the “waistline,” and c.) orientation of the IR sensors.

Dans le document TION T O ROBO TICS (Page 151-155)