Disclosure of Invention
The invention aims to provide a method for controlling a multi-behavior fusion enzyme numerical film of a mobile robot in an unknown environment. The mobile robot acquires environment information by using a sensor, classifies different environments, and selects and executes one of a plurality of behaviors according to different environments and the distance and the angle between a target and the robot until the target point is reached.
The technical scheme for realizing the purpose of the invention is as follows:
a method for controlling a multi-behavior fusion enzyme numerical value film of a mobile robot in an unknown environment is characterized by comprising the following steps
Step 1: calculating the linear distance CurDest between the target and the robot and the Angle between the target and the forward direction of the robot;
step 2: according to the information acquired by the sensor carried by the robot, the environment of the robot is judged, wherein the environment comprises a left wall, a right wall, a corridor, a left wall corner, a right wall corner, a front wall, an upper left side, an upper right side, two sides, dead corners and no barriers, and C is used for respectivelyi=1,2,...,110, wherein i is 1,2, 11 corresponds to the 11 environments respectively; the environment is divided into 4 types: wall type EwaCorresponding to the environment of the left wall, the right wall, the corridor, the left wall corner and the right wall corner; obstacle type EobCorresponding to the environment of the front wall, the upper left side and the upper right side; dead zone type EdeCorresponding to the environments of two sides and dead corners; obstacle-free type EnoCorresponding to the environment without obstacles;
and step 3: judging whether the straight-line distance CurDist between the robot and the target is the historical minimum MinDist: when MinDist > CurDes, the history is the minimum value, the variable IfMin is 1, and MinDist is made to be CurDes; otherwise, IfMin is 0; and 4, step 4: judging whether the target and the barrier or the wall surface are on the same side of the robot:
judging whether the target is on the left side or the right side of the robot according to the Angle, and when the Angle is greater than 0, the target is on the right side of the robot, and when the Angle is less than 0, the target is on the left side of the robot;
such as C 10 or C 40 or C7If the value is 0, judging that the obstacle or the wall surface is positioned on the left side of the robot, and representing the obstacle or the wall surface by using a variable IfLeft as 1; such as C 20 or C 50 or C8If the value is 0, judging that the obstacle or the wall surface is positioned on the right side of the robot, and representing the obstacle or the wall surface by using a variable IfLeft as 0;
when Angle is greater than 0 and IfLeft is 1, the target and the obstacle or the wall surface are not on the same side of the robot, and the variable ifSame is 0;
when Angle is greater than 0 and IfLeft is 0, the target and the obstacle or the wall surface are on the same side of the robot, and IfSame is 1; when Angle is <0 and IfLeft is 1, IfSame is 1; when Angle is less than 0 and IfLeft is 0, IfSame is 0;
and 5: after multi-behavior selection is carried out, behavior variables are output to an execution system:
when the robot is in C
iWhen the environment is 0, i is 9, 10, the type of the dead zone is determined, and the dead zone is selected
When the robot is in C
iWhen the environment is 0 and i is 11, judging as a barrier-free type: selecting Com if IfMin is 1
gr1, if ifMin is 0
When the robot is in CiWhen the environment is 0, i is 6,7 and 8, the obstacle type is judged:
and if IfMin is equal to 0, selecting a corresponding obstacle avoidance behavior: i-6 selection
i-7 selection
i-8 selection
If ifMin is equal to 1, further judging whether the target and the obstacle are on the same side of the robot, and when Ifsame is equal to 1, selecting a corresponding obstacle avoidance behavior: i-6 selection
i-7 selection
i-8 selection
Selecting Com when IfSame is 0
gr=1;
When the robot is in CiWhen i is equal to 1,2, 3,4, 5, the environment is judgedThe wall surface type:
if IfMin is 0, selecting the corresponding wall-following behavior: i is selected from 1 or 4
i is 2 or 5 selected
i-3 selection
If ifMin is equal to 1, further judging whether the target and the wall surface are on the same side of the robot, and if Ifsame is equal to 1, selecting a corresponding wall-following behavior: i is selected from 1 or 4
i is 2 or 5 selected
i-3 selection
Selecting Com when IfSame is 0
gr=1;
The above behavior variables are respectively: front obstacle avoiding barrier
Obstacle avoidance device for left obstacle
Obstacle avoidance device for right obstacle
Left side wall face following wall
Right side wall surface following wall
Crossing channel
Tendency target Com
grIn-situ U-turn Com
deAnd self-rotation
Step 6: the execution system executes the behavior output in the step 5;
and 7: judging whether the mobile robot reaches the target, namely judging whether CurDest is equal to 0: if the value is equal to 0, the robot reaches the target, and the control is ended; if not, returning to the step 1 for continuation.
Further, in the step 2, the method for determining the environment of the robot based on the information acquired by the sensor mounted on the robot includes: the information acquired by the sensor is 8 distances d around the robotxX is 1,2 … 8; wherein d is1、d2Distance, d, obtained for the sensor at the right front side of the robot3Distance, d, obtained for the sensor on the right side of the robot4Distance, d, obtained for the sensor on the right rear side of the robot5Distance, d, obtained for the sensor at the left rear side of the robot6Distance, d, obtained for the sensor on the left side of the robot7、d8The distance obtained for the sensor located on the left front side of the robot; when d isx<t and t are distance threshold values, the sensor detects the obstacle and sends the corresponding distance dxBinarization, wherein 1 represents that an obstacle is detected and 0 represents that the obstacle is not detected;
and then determining the environment of the robot according to the table.
The invention provides a multi-behavior fusion enzyme numerical value membrane control method for the field of robot control and membrane system control in an unknown environment, which combines an enzyme numerical value membrane system and a multi-behavior fusion algorithm, introduces the judgment of the distance between a robot and a target and the judgment of whether the target and an obstacle (or a wall surface) are on the same side of the robot, and solves the problems of deadlock and winding of autonomous walking of a mobile robot in the unknown environment to a certain extent. And an enzyme numerical value membrane controller is adopted to fuse various behavior controllers, so that the robot can adapt to complex environments.
Detailed Description
The following further describes the embodiments of the present invention with reference to the drawings.
A multi-behavior fusion enzyme numerical membrane control flow chart is shown in FIG. 1.
The specific related technologies adopted by the invention are as follows:
1) placing a mobile robot in an unknown environment with the unknown environment and a robot target as input, given a target point (x) to be reached by the robot
g,y
g). According to the distance formula
Calculating the distance CurDest between the target and the mobile robot and calculating the Angle of the target relative to the forward direction of the robot according to an Angle calculation formula (taking the right side of the forward direction of the robot as the positive direction).
2) Control of mobile robot
a) Acquisition and determination of the environment in which a mobile robot is located
In order to make a mobile robot cope with a complicated environment, the present invention divides the environment type in which the mobile robot is located into (as shown in fig. 2 below): the wall comprises a left wall, a right wall, a corridor, a left wall corner, a right wall corner, a front wall, an upper left side, an upper right side, two sides, dead corners and no obstacles. With Ci=1,...,11Is represented by (C)i=1,...,110 denotes in the corresponding ambient mode: left wall, right wall, corridor, left wall corner, right wall corner, front wall, upper left side, upper right side, two sides, dead corner, no obstacle).
The mobile robot judges the environment of the robot according to the information acquired by the mounted sensor. Specifically, for example, a mobile robot is equipped with 8 distance sensors (see fig. 3), and the 8 sensors are distributed in a ring shape on the mobile robot. 8 sensors can acquire 8 distance information (d) around the robot1、d2…d8) (wherein d is1、d2Distance information obtained for a sensor located on the right front side of the robot, d3Distance information obtained for sensors on the right side of the robot, d4Distance information obtained for the sensor on the right rear side of the robot, d5Distance information obtained for the sensors on the left rear side of the robot, d6Distance information obtained for the sensor on the left side of the robot, d7、d8Distance information obtained for a sensor located on the front left side of the robot). Setting a threshold value t when dx<When t (x is 1,2 … 8), the sensor is considered to detect an obstacle, and the corresponding distance value d is settBinarized, 1 represents detected obstacle and 0 represents not detected. After the processing, the binary sensor distance value of the current environment where the robot is located can be obtained. Eleven environments correspond to eleven binary sensor distance values (see table 1). And comparing the current binary sensor distance value with binary sensor distance values corresponding to eleven environment types, judging the current environment, and outputting the current environment to the multi-behavior fusion enzyme numerical value membrane system. Enzyme numerical membrane systems classify the input environment into 4 broad categories: the wall type (left wall, right wall, corridor, left corner and right corner environment correspond to the type), the barrier type (front wall, upper left side and upper right side environment correspond to the type), the dead zone type (two sides and dead angle environment correspond to the type), and the barrier-free type (barrier-free environment corresponds to the type). Respectively using variable Ewa、Eob、Ede、EnoAnd (4) showing.
TABLE 1 Environment type and binary sensor value correspondence table
b) Judging whether the distance between the robot and the target is the historical minimum value or not
The historical minimum value between the robot and the target is stored by using a variable MinDist (initialized by using CurdIst), and whether the distance between the robot and the target CurdIst is the minimum value or not is judged by comparing the CurdIst and the MinDist. Min dist > curdest, is the minimum history value (indicated by variable IfMin ═ 1), and min dist ═ curdest.
c) Determine whether the target, the obstacle (or the wall surface) are on the same side of the robot
The input Angle can determine whether the target is on the left or right side of the robot. Angle>0, target on the right side of the robot; angle<0, target on the left side of the robot. The position of the obstacle (or wall) can be determined by the input environment Ci=1,...,11And (4) determining. C 70 represents the upper left environment, that is, it is determined that the obstacle is located on the left side of the robot (represented by variable IfLeft 1); c8An upper right environment is indicated by 0, i.e. an obstacle is located on the right side of the robot (indicated by the variable IfLeft being 0). C 10 denotes left wall environment or C4The left corner is represented by 0, and the wall surface is judged to be positioned on the left side of the robot (represented by a variable IfLeft which is 1); c 20 represents the right wall or C5The right corner is indicated by 0, and it is determined that the obstacle is located on the right side of the robot (indicated by the variable IfLeft being 0).
Based on the above determination, it can be determined whether the target and the obstacle (or the wall surface) are on the same side of the robot. When Angle >0 and IfLeft ═ 1, the target, the obstacle (or the wall) are not on the same side of the robot (represented by the variable IfSame ═ 0); angle >0, if IfLeft is 0, IfSame is 1; when Angle is less than 0 and IfLeft is equal to 1, IfSame is equal to 1; when Angle is less than 0 and IfLeft is 0, IfSame is 0. Summarized as the following formula
d) Multiple behavior selection
The invention defines five behaviors, namely obstacle avoidance (obstacle avoidance of front, left and right obstacles), wall following (wall following and passing through channels of left and right side walls), target tendency, in-situ turning and autorotation. Respectively using obstacle avoidance action variables
Wall-dependent behavior variables
Tendency target behavior variable Com
grIn-situ turn-around behavior variable Com
deSelf-rotation behavior variables
And (4) showing.
When a specific condition is satisfied, a corresponding behavior is selected (i.e., the corresponding behavior variable value is assigned 1), and a behavior variable is output.
When the robot is in C
iWhen the environment is 0(i is 9 or 10), the environment type is judged to be the dead zone type, the robot is blocked due to the advancing direction, and the in-situ turning behavior is selected
When the robot is in C
11When the environment is 0, the obstacle-free type is judged. If IfMin is equal to 1, then the trend target behavior Com is selected
gr1 is ═ 1; if IfMin is equal to 0, selecting the rotation behavior
When the robot is in C
iWhen the environment is 0(i is 6,7, 8), it is determined as the obstacle type. If IfMin is equal to 0, selecting corresponding obstacle avoidance behavior
If IfMin is equal to 1, judging whether the target and the obstacle are on the same side of the robot, and if IfSame is equal to 1, selecting a corresponding obstacle avoidance behavior
When IfSame is equal to 0, the tendency toward target behavior Com is selected
gr=1。
When the robot is in C
iWhen the environment is 0(i is 1,2, 5), it is determined as the wall type. If IfMin is equal to 0, selecting corresponding wall-following behavior
If IfMin is equal to 1, judging whether the target and the wall surface are on the same side of the robot, and if IfSame is equal to 1, selecting the corresponding wall-following behavior
When IfSame is equal to 0, the tendency toward target behavior Com is selected
gr=1。
The multi-behavior fusion enzyme numerical membrane system outputs behavior variables to an execution system.
3) Perform corresponding actions
The behavior of the enzyme numerical membrane system output is performed.
4) Determining whether the mobile robot reaches a target
And judging whether the distance value CurDest is equal to 0. If the value is equal to 0, the mobile robot reaches the target, and the control is ended. If not, the mobile robot continues to acquire the environment state and determines the execution behavior until the target is reached.
The invention is simulated on a PC, and the CPU is 2.8HZ, 4GB RAM, software platforms MATLAB2012, Windows7OS and Webots. Taking the mobile robot Epuck as an example, the Epuck robot has 8 infrared sensors and is driven by two wheels in a differential mode.
Referring to fig. 4 and 5, the invention adopts the following steps:
step 1, taking unknown environment and robot target as input
The mobile robot Epuck is placed in the unknown environment shown in figure 5, and the Epuck obtains the distance D between the current Epuck and the target according to a distance and angle calculation formulacurAnd Angle, input to the multi-behavior fusion enzyme numerical membrane system of fig. 4. Angle passes through variable Agr1、Agr2Preservation, Agr1=Angle,Agr2=-Angle。
Step 2. control of the mobile robot
a) Acquisition and determination of the type of environment in which a mobile robot is located
The environmental modes are divided into 11 types: left wall, right wall, corridor, left wall corner, right wall corner, front wall, left upper side, right upper side, two sides, dead corner, no obstacle, using Ci=1,...,11Is represented by (C)i=1,...,110 is in the corresponding environment mode: left wall, right wall, corridor, left wall corner, right wall corner, front wall, upper left side, upper right side, two sides, dead corner, no obstacle). The Epuck acquires 8 pieces of distance information (sensor value d) around the robot through 8 infrared sensors1、d2…d8). The 8 sensors are distributed on the mobile robot in a ring shape (as in fig. 3), (where d1、d2Distance information obtained for a sensor located on the right front side of the robot, d3Distance information obtained for sensors on the right side of the robot, d4Distance information obtained for the sensor on the right rear side of the robot, d5Distance information obtained for the sensors on the left rear side of the robot, d6Distance information obtained for the sensor on the left side of the robot, d7、d8Distance information obtained for a sensor located on the front left side of the robot). Threshold value 70 when dx>70(x is 1,2 … 8), the sensor is considered to detect the obstacle, and d is set tox1, dx<70,dxA 0 indicates that no obstacle was detected. (the value of the Epuck sensor decreases as the distance of the obstacle increases). The 8 sensor processed values constitute a set of binary sensor values, such as: when the disease is not obstructed [ 00000000]Comparing the currently obtained binary set with the defined 11 environment binary set (see table 1), and determining the environment C of the roboti=1,...,11And output to the enzyme numerical membrane system of figure 4. Enzyme numerical membrane systems classify the input environment into 4 broad categories: wall type (left wall, right wall, corridor, left corner and right corner environment correspond to the type), barrier type (front wall, upper left side and upper right side environment correspond to the type), dead zone type (two sides and dead angle environment correspond to the type), and barrier-freeType (no obstacle environment corresponds to this class). Respectively using variable Ewa、Eob、Ede、EnoAnd (4) showing. This step is accomplished by the Judge Environment model of FIG. 4, which contains a total of 11 rules Pri=1,2..11And Case. Rules 1-5 (i.e., Pr)i=1,2..5Case) divides the environment in which the robot is located into wall types (E)wa1), rule 6,7,8 is divided into obstacle types (E)obRule 9, 10 is divided into dead zone types (dead zone type directly corresponds to in-place turnaround behavior, so there is a direct allocation Com implementedde1), rule 11 is divided into barrier-free types (E)no=1)。
Here, the rule execution is described as rule 9, and the rule execution manner is the same hereinafter. Rule 9 is Pr9,Case:C9+2(Ec→)1|Comde+1|ET。Pr9Case is a regular name, separated from expressions by colon, C9+2 is the value generation rule, 1| Comde+1|ETValue assignment rule, enzyme variable E in parenthesesc(when an enzyme variable is greater than a variable in a value generation rule, the rule will only activate execution; where E is requiredc>C9). When E isc>C9When rule 9 is active, the value generation rule generates a value C9+2, after the value generation rule is executed, the variable in the generation rule is cleared to 0 (i.e., C)9Will be cleared to 0)), the resulting value is assigned by an assignment rule, C9+2 divided into 2 portions, one for each variable ComdeOne portion of the solution is given to ETI.e. Comde=(C9+2)/2,ET=(C9+2)/2。
b) Judging whether the distance between the robot and the target is the historical minimum value or not
This step is accomplished in the fig. 4 subparagraph distanceifminimal.
Rule 1 determines whether the value is the minimum historical value, and
rule 2 outputs and stores the minimum historical value.
Rule 1,2 execution,
D min1 is expressed as the historical minimum, Output D
cur。
c) Determine whether the target, the obstacle (or the wall surface) are on the same side of the robot
And judging whether the target and the obstacle are on the same side of the robot or not is completed by rules 2-7,10 and 11 in the submembrane Judge RobotStateObstacle in the figure 4.
Rules 4,5 determine the position of the target and the robot. A. the
gr1<0 (i.e., Angle)<0) When, the enzyme variable E
a[0]>A
gr1The set of
rules 4 is activated, the rule is activated,
indicating that the target is on the left side of the robot. A. the
gr2<0 (i.e., Angle)>0) When, the enzyme variable E
a[0]>A
gr2The set of
rules 5 is activated,
indicating that the target is to the right of the robot.
Rule Pr2、3,obstaclenUsed for judging the position relation between the obstacle and the robot. When the environment mode C7When the value is 0 (upper left side), the obstacle is located at the left side of the robot, and the rule Pr is activated2,obstaclen: variable Oleft[-1]=1,Oright[-1]0; environmental mode C8When the value is 0 (upper right side), the obstacle is located at the right side of the robot, and the rule Pr is activated3,obstaclen: variable Oright[-1]=1,Oleft[-1]=0。
Rule Pr
6.7.10.11,obstacle
nBy passing
O
left、O
rightThe relationship between the obstacle, the target and the robot is obtained. When O is present
left1 (obstacle to the left of the robot),
(target on robot right) indicating that obstacle is on robot left target right, rule Pr is activated
6,obstacle
n: enzyme
variable EOG lr2; when O is present
right=1,
When, indicating that the right target is on the left, rule Pr is activated
7,obstacle
n: enzyme
variable EOG rl2; when O is present
left=1,
When the system is in use, the system indicates that the obstacles and the targets are all on the left, and activates the rule Pr
10,obstacle
n:
enzyme variables Eog left2; when O is present
right=1,
When the system is in use, the system indicates that the obstacles and the targets are all right, and activates the rule Pr
11,obstacle
n: enzyme variables Eog
right=2。
And judging whether the target and the wall surface are on the same side of the robot or not by rules 2-7,10 and 11 in JudgGeRobotStatewall. The principle is the same, and therefore, the description is omitted.
d) Selection of multiple behaviors
The invention defines 5 behaviors, namely obstacle avoidance (obstacle avoidance of front, left and right obstacles), wall following (wall following and passing through channels of left and right side walls), target tendency, in-situ turning and rotation behaviors. Respectively using obstacle avoidance action variables
Wall-dependent behavior variables
Tendency target behavior variable Com
grIn-situ turn-around behavior variable Com
deSelf-rotation behavior variables
Shown (as in fig. 4). A behavior variable equal to 1 indicates that such behavior variable is selected.
When the robot is in C
iWhen the environment is 0(i is 9 or 10), the environment type is judged to be the dead zone type, the robot is blocked due to the advancing direction, and the in-situ turning behavior is selected
This is accomplished in part by rules 9 or 10 in the Judge Environment model of FIG. 4. Variable E
TAnd (4) stopping the evolution calculation of the membrane system and outputting
When the robot is in C
11When the environment is 0, the type is judged to be barrier-free (E)
no1). At this time, if
D min1, choose to trend toward
target behavior Com gr1 is ═ 1; if D is
minWhen the rotation behavior is 0, the rotation behavior is selected
This part is completed by the daughter membrane SelectGoalReachingCase of FIG. 4. If D is
min Rule 1 cannot be executed, and
further rule 2 cannot be executed, rule 3 has no enzyme variables and is executed every time it evolves,
further rule 4 execution, Com
gr=1,
E T1 denotes the evolutionary calculation of the stop membrane system. If D is
min Rule 1,
rule 2 performs, 0,
E
T=1。
when the robot is in C
iWhen the environment is 0(i is 6,7, 8), it is determined as the obstacle type (E)
ob1). FIG. 4 daughter membranes SelectObstacleAvoidecense and Judge RobotStateObstacle judge what behavior to choose. If D is
min Rule 1 execution in
SelectObstacleAvoideceCase 0
Rules 2 or 3 or 4 are then implemented to select the corresponding obstacle avoidance behavior
After
rule 5 is executed
Making the rules in the judggerootstateobstacle unexecutable. If D is
min1,
rule 1 cannot be executed in selectobstacleedamyces case, further,
rules 2,3, and 4 cannot be executed, and after
rule 5 is executed
If the target and the obstacle are on the same side of the robot (Eog)
left2 or Eog
right2), rule 12 or 13 is activated,
or
If the target and the obstacle are not on the same side of the robot (EOG)
lr2 or EOG
rl2), rule 8 or 9 is active,
E
T=1。
when the robot is in CiWhen the environment is 0(i is 1,2, 5), the environment type is determined to be the wall type (E)wa1). FIG. 4 the daughter membranes SelectWallFollowCase and JudggeRobotStatewall judge which behaviour is selected. The principle is the same as the obstacle avoidance situation, and therefore, the description is omitted.
Step 3, executing corresponding behaviors
The behavior of the membrane system output is performed.
Step 4, judging whether the mobile robot reaches the target or not
Judging the distance value DcurWhether or not it is equal to 0. If the value is equal to 0, the mobile robot reaches the target, and the control is ended. If not, the mobile robot continues to acquire the environment state and determines the execution behavior until the target is reached.
From the experimental results of fig. 5, it can be seen that the multi-behavior fusion membrane control (MBCMC) walking path is shorter (fig. 5 left) and the dead zone (fig. 5 right) that the fuzzy logic control cannot escape can be escaped.