Background
With the acceleration of the life rhythm of people and the requirement of more and more abundant life contents, the intelligent household appliances are promoted to advance our lives. Among them, the automatic dust collection robot is greatly helpful. The cleaning work at home is very heavy and frequent. The automatic dust collection robot can automatically clean the household floor. The automatic dust collection robot utilizes a self-carried rechargeable battery to supply power to various electrical appliances, wherein a dust collection motor forms enough vacuum in the automatic dust collection robot, garbage on the ground is sucked into an inner dust box through a strip-shaped suction port, and the automatic dust collection robot can freely walk by a driving motor and a driving wheel. The automatic dust collection robot realizes the cleaning of the ground through the self walking process.
Because the existing automatic dust-collecting robot does not have very precise positioning and planning capability, the efficiency of cleaning the path becomes a very urgent problem to be solved. The current common strategy is a random path, the automatic dust collection robot walks randomly on the ground, and any planning method is abandoned, so that the strategy causes low cleaning efficiency. In order to control the speed, the automatic dust collection robot is provided with an encoder on a driving motor, and can calculate the relative movement distance and the rotation angle so as to realize position calculation. Then, the situation of the cleaning path can be analyzed from the position data recorded by the automatic dust collection robot in the near term, so that a basis is provided for the next optimal cleaning path planning.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and adopts the analysis of historical position data to obtain the direction which is most probably not cleaned, thereby obtaining the optimal cleaning path without increasing any hardware cost.
The technical scheme adopted by the invention for solving the technical problems is as follows:
an optimal path planning method of an automatic dust collection robot based on historical data analysis is disclosed, the automatic dust collection robot comprises two driving wheels, two driving motors connected with the driving wheels, encoders mounted on the driving motors, a supporting wheel and an obstacle detection device mounted in front of the automatic dust collection robot, the driving motors, the encoders and the obstacle detection device are connected with a controller, the controller realizes free movement of the automatic dust collection robot by setting the speed and the direction of the two driving wheels respectively, and can calculate the relative movement distance and the rotation direction of the automatic dust collection robot according to signals of the encoders, the coordinates (x, y) of the current position can be calculated by taking the initial position as an origin, and the optimal path planning method is arranged in the controller, the optimal path planning method comprises the following steps:
(1) setting a data link list L0={Pi(xi,yi) N-1, x, wherein i =0, 1, 2iAnd yiIs a coordinate value, N is a data link list L0Length of (2), data link list L0Coordinate data of a stop position after detecting an obstacle for the automatic dust collection robot in the near term;
(2) the automatic dust collection robot moves forwards in a linear motion mode and continuously detects obstacles; when the obstacle is detected, the automatic dust collection robot stops, records the coordinates (x, y) of the current position, and stores the coordinates into a data linked list L0Then entering step 3;
(3) and obtaining the data chain table L0Center point of (x)o,yo) Extracting the data chain table L by taking the central point O as the center0Contour line segment S in (1)j(m, n) and stores a data link list L1Wherein M =0, 1, 2<N, the contour line segment Sj(m, n) represents a data link list L0Point P inm(xm,ym) And Pn(xn,yn) A line segment;
(4) a central point O and a data chain table L
1Contour line segment S in (1)
j(m, n) form a triangular region, calculate OP
mDirection angle theta
1=
,OP
nDirection angle theta
2=
And a data link list L
0Point P in
i(x
i,y
i) Andthe center point O forms a direction angle theta
3=
If for the data link list L
0All points P in
i(x
i,y
i),
At the same time
If all the points are true, no point appears in the triangular area, indicating the contour line segment S
jIf the direction corresponding to (m, n) is not cleared, then the data link list L
1The contour line segment S is reserved
j(m, n); on the contrary, in the data link list L
1Deleting contour line segment S
j(m,n);
(5) Calculating a data chain table L
1Contour line segment S in (1)
jLength W of (m, n)
j=
Comparing the contour line segment S
jLength W of (m, n)
jThe size of (1) is determined by taking the contour line segment S with the maximum length
max(m, n), contour line segment S
maxDirection angle α = (m, n) with respect to center point O
(ii) a The automatic dust collection robot selects a direction angle alpha as the next cleaning direction.
In step 2, the coordinates (x, y) of the current position are stored in a data link list L0The method comprises the following steps:
let Pi(xi,yi)=Pi-1(xi-1,yi-1) ,i=1,2,3.....N-1;
Then P0(x0,y0) = (x, y), link table operation is completed.
In step 3, the data link list L0Center point of (x)o,yo) The coordinate calculation method comprises the following steps:
searching data link list L0Maximum and minimum values of the middle coordinate data: x is the number ofmax,xmin,ymax,ymin;
In step 3, the contour line segment S in the data link list L0 is extracted with the center point O as the centerj(m, n) using the following steps:
calculating a linked list of data L
0Point P in
i(x
i,y
i) And a center point O (x)
o,y
o) Distance D of
i=
Finding the point P with the largest distance
M(x
M,y
M);
With P
M(x
M,y
M) For the vertex, calculate the data link list L
0Point P in
i(x
i,y
i) And a center point O (x)
o,y
o) Angle formed beta =
Taking the point with the maximum angle beta as a contour point and marking as P
N(x
N,y
N) Thus forming data S
0(M, N) and storing a data link list L
1;
Then with PN(xN,yN) Continuously searching contour points for the vertex and storing the contour points into a data chain table L1Up to the return point PM(xM,yM) And ending and returning.
The implementation of the invention has the positive effects that: 1. an optimal cleaning path is selected, and the cleaning efficiency is improved; 2. the working mode is reliable, the realization is easy, and the system cost is not increased.
Detailed Description
The invention will now be further described with reference to the accompanying drawings in which:
referring to fig. 1, a method for planning a random path of an automatic vacuum robot includes two driving wheels 1, two driving motors 2 connected to the driving wheels 1, an encoder installed on the driving motors 2, and a supporting wheel 3, wherein the supporting wheel 3 plays a supporting role and is not used for driving. Wherein, the driving motor 2 and the encoder are connected with the controller. The controller realizes the free movement of the automatic dust collection robot by respectively setting the speed and the direction of the two driving wheels 1, can calculate the relative movement distance and the rotation direction of the automatic dust collection robot according to the signals of the encoder, and can calculate the coordinates (x, y) of the current position by taking the initial position as the origin of coordinates. Due to factors such as mechanical clearance, calculation error and ground slip, the coordinates (x, y) will have accumulated errors, that is, the errors will be larger and larger as time goes on, but the coordinates (x, y) will still have a value in a period of time.
The automatic dust collection robot further comprises an obstacle detection device arranged at the front part of the automatic dust collection robot, and the obstacle detection device is also connected with the controller. The obstacle detection device may employ a sensor such as an ultrasonic sensor, an infrared sensor, a laser radar sensor, or a combination of two or more sensors.
The automatic dust collection robot performs cleaning work simultaneously in the walking process, so that the selection of the walking path directly determines the cleaning efficiency and is in a very important position.
The controller is internally provided with an optimal path planning method, and the optimal path planning method comprises the following steps:
(1) setting a data link list L0={Pi(xi,yi) N-1, x, wherein i =0, 1, 2iAnd yiIs a coordinate value, N is a data link list L0Length of (2), data link list L0Coordinate data of a stop position after detecting an obstacle for the automatic dust collection robot in the near term;
data link list L0The length N of (a) should not be too large, otherwise too large error results in poor planning effect.
(2) The automatic dust collection robot moves forwards in a linear motion mode and continuously detects obstacles; when the obstacle is detected, the automatic dust collection robot stops, records the coordinates (x, y) of the current position, and stores the coordinates into a data linked list L0Then entering step 3;
in step 2, the coordinates (x, y) of the current position are stored in a data link list L0The method comprises the following steps:
let Pi(xi,yi)=Pi-1(xi-1,yi-1) ,i=1,2,3.....N-1;
Then P0(x0,y0) = (x, y), link table operation is completed.
(3) And obtaining the data chain table L0Center point of (x)o,yo) Extracting the data chain table L by taking the central point O as the center0Contour line segment S in (1)j(m, n) and stores a data link list L1Wherein M =0, 1, 2<N, the contour line segment Sj(m, n) represents a data link list L0Point P inm(xm,ym) And Pn(xn,yn) A line segment;
in step 3, the data link list L0Center point of (x)o,yo) The coordinate calculation method comprises the following steps:
searching data link list L0Maximum and minimum values of the middle coordinate data: x is the number ofmax,xmin,ymax,ymin;
Referring to FIGS. 2-3, in step 3, the contour line segment S in the data link list L0 is extracted centered on the center point Oj(m, n) using the following steps:
calculating a linked list of data L
0Point P in
i(x
i,y
i) And a center point O (x)
o,y
o) Distance D of
i=
Finding the point P with the largest distance
M(x
M,y
M);
With P
M(x
M,y
M) For the vertex, calculate the data link list L
0Point P in
i(x
i,y
i) And a center point O (x)
o,y
o) Angle formed beta =
Taking the point with the maximum angle beta as a contour point and marking as P
N(x
N,y
N) Thus forming data S
0(M, N) and storing a data link list L
1;
Then with PN(xN,yN) Continuously searching contour points for the vertex and storing the contour points into a data chain table L1Up to the return point PM(xM,yM) And ending and returning.
(4) A central point O and a data chain table L
1Contour line segment S in (1)
j(m, n) form a triangular region, calculate OP
mDirection angle theta
1=
,OP
nDirection angle theta
2=
And a data link list L
0Point P in
i(x
i,y
i) A direction angle theta formed with the center point O
3=
If for the data link list L
0All points P in
i(x
i,y
i),
At the same time
If all the points are true, no point appears in the triangular area, indicating the contour line segment S
jIf the direction corresponding to (m, n) is not cleared, then the data link list L
1The contour line segment S is reserved
j(m, n); on the contrary, in the data link list L
1Deleting contour line segment S
j(m,n);
Referring also to FIG. 3, for the data link list L
0All points P in
i(x
i,y
i) All satisfy the condition
At the same time
Then, P is described
iIs located at triangle OP
mP
nOuter, contour line segment S
j(m, n) is an uncleaned direction with respect to the center point O.
(5) Calculating a data chain table L
1Contour line segment S in (1)
jLength W of (m, n)
j=
Comparing the contour line segment S
jLength W of (m, n)
jThe size of (1) is determined by taking the contour line segment S with the maximum length
max(m, n), contour line segment S
maxDirection angle α = (m, n) with respect to center point O
(ii) a The automatic dust collection robot selects a direction angle alpha as the next cleaning direction.
Referring to fig. 4, the direction having the largest angle is selected among all the non-cleaning directions.
In conclusion, the automatic dust collection robot selects the non-cleaned area as the cleaning direction of the next step through the analysis of the historical data, so that the probability of entering the non-cleaned area is increased, the path repetition is reduced, the cleaning efficiency is effectively improved, the scheme does not need to increase any hardware cost, the working mode is flexible and reliable, and the realization is easy. Meanwhile, the scheme is also suitable for the automatic dust collection robot to find the path planning of the charging seat.