Des : State x Control --> [0,1]that measures, for each state s (i.e., configuration of the LPS) and for each control vector c, the desirability Des(s,c) of applying the control c when the state is s from the point of view of B. The task of the controller is to compute, in state s, the value of Des(s,c) for each control c, and to use these values to choose one control c* for actual execution. In Flakey, this choice is made using centroid defuzzification:
In practice, we approximate the desirability function associated with each behavior B by a set of fuzzy rules of the form![]()
IF A THEN Cwhere A is a fuzzy logic formula built from fuzzy predicates over state variables using the fuzzy connectives AND (min), OR (max) and NOT (complement to 1); and C is a fuzzy set of controls. For example, the rules in Figure 2 implement the Reach behavior, intended to bring the robot to a given target position at a fixed speed. Rule consequents are triangular fuzzy sets centered on the value given as a parameter. The predicates in the antecedents depend on the current position of the target with respect to the robot, stored in LPS variables. ``Out-of-Reach'' says that the target is too close on one side to be directly reached at the desired speed given Flakey's turning velocity. In this case, the robot must first move away from the target, and then turn towards it.
IF Target-Left AND NOT Out-of-Reach THEN Turn-Left(8)Given a rule-set R = {R1,... ,Rn} for a behavior B, the fuzzy controller first computes
IF Target-Right AND NOT Out-of-Reach THEN Turn-Right(8)
IF Target-Left AND Out-of-Reach THEN Turn-Right(4)
IF Target-Right AND Out-of-Reach THEN Turn-Left(4)
IF Target-Ahead THEN Go-StraightFigure 2: Fuzzy rules for the Reach behavior.
in the current LPS state s, and then chooses a preferred control value C using (2). This computation corresponds to the one performed by a classical (Mamdani type) fuzzy controller; note, however, that we allow each antecedent A to be an arbitrarily complex fuzzy logic formula, and not just a conjunction. As an illustration, Figure 3 shows the control surface obtained from the Reach ruleset using (2) and (1). (Theta, rho) is the target's position in robot polar coordinates. The effect of the ``Out-of-Reach'' predicate on the shape of the surface is clearly visible.![]()
It should be noted that centroid defuzzification can produce undesired results when the output desirability is not unimodal; for example, the robot, having the option of avoiding an obstacle from the right or from the left, may decide to go straight. Our empirical strategy is to design the rule sets so as to avoid production of multi-modal desirabilities -- roughly, we insist that rules that propose opposite controls have mutually exclusive antecedents. Other authors (Baxter and Bumby 1993; Yen and Pfluger 1995) have relied on alternative defuzzification schemes. (See (Goodridge et al 1997) for a more cognitive approach.)![]()
Figure 3: Control surface of the Reach behavior.
The controller computes all the needed Des[i](s,c) using (1), blend them according to (3), and finally choses one control value c* by (2).![]()
We represent CDB of behaviors syntactically by using fuzzy meta-rules, or context rules. For instance, the following context rules can be used to blend the target reaching behavior Reach and the obstacle avoidance behavior KeepOff.
IF obstacle-close THEN KeepOffIntuitively, the robot's actions are biased by the desirability functions of Reach and of KeepOff, in a combination that depends on the distance from a detected obstacle.
IF NOT obstacle-close AND NOT at-target THEN Follow(Corr1)
We have implemented CDB in Flakey using the hierarchical structure shown in Figure 4 , inspired by (Berenji et al 1990). A few observations should be made. First, it is essential that defuzzification be performed after combination. Second, we could include each context rule inside the corresponding behavior; this solution would be more amenable to a distributed implementation. Third, CDB can be iterated: we can use the structure in Figure 4 to implement each individual behavior, and combine several such (complex) behaviors using a second layer of context rules; and so on. Some of Flakey's behaviors have been built in this fashion.
CDB can be used to execute a full navigation plan, represented by a set of context rules telling which behaviors should be used in which situation. The rules shown (in a simplified form) in Figure 5 constitute a navigation plan; each behavior is parameterized by the object it should be applied to. If executed in an environment with the right topological relations, like the one shown in Figure 9 below, this plan will get Flakey into Room4 by first following corridors Corr1 and Corr2, and then crossing door Door4. The plan also incorporates an avoidance behavior to go around possible obstacles. Section 4 will show an actual execution of this plan.![]()
Figure 4: The hierarchical fuzzy controller used in Flakey.
IF obstacle THEN KeepOffThanks to the logical format, context rules can be easily generated by a symbolic planner. When Flakey is given a new navigation goal, it uses a simple goal-regression planner to synthesize a set of context rules that achieves it, and uses CDB to execute these rules. The plan in Figure 5 has been generated in this way.
IF NOT obstacle AND at(Corr1) AND NOT at(Corr2) THEN Follow(Corr1)
IF NOT obstacle AND at(Corr2) AND NOT near(Door4) THEN Follow(Corr2)
IF NOT obstacle AND near(Door4) AND NOT ar(Room4) THEN Cross(Door4)
IF at(Room4) THEN StopFigure 5 A plan for reaching Room4 in the environment in Figure 9 below.
To use the metric information in the map, the robot needs to know its own position with respect to this map. We have developed a recursive self-localization algorithm for Flakey based on fuzzy locations. The outline of the algorithm is as follows. At each time-step t the robot has an approximate hypothesis of its own location in the map, represented by a fuzzy set H[t] of the map frame. During navigation, the perceptual apparatus recognizes relevant features, and the map is searched for matching objects using a fuzzy measure of similarity. Each matching pair is used to build a fuzzy localizer: a fuzzy set representing the approximate location in the map where the robot should be in order to see the object where the feature has been observed. The shape of this set depends on the characteristics of perceptual recognition and is decided by the designer. Each localizer is seen as a source of information about the actual position of the robot. All the localizers so built at time t, plus odometric information, are combined by fuzzy intersection to produce the new hypothesis H[t+1], and the cycle repeats. More details can be found in (Saffiotti and Wesley 1996).![]()
Figure 6: Representing different types of approximate locations by fuzzy sets.