Disclosure of Invention
The invention aims to overcome the defects in the prior art, adopts the wireless wifi network and the strength information of the geomagnetic signal to label the position, and establishes a fingerprint map of the environment based on a linear linked list so as to provide a basis for subsequent navigation and positioning.
The technical scheme adopted by the invention for solving the technical problems is as follows:
an indoor mobile robot fingerprint map establishing method based on a wireless network and geomagnetic signals, wherein the mobile robot comprises a driving wheel, a driving motor connected with the driving wheel and a charging electrode male end arranged at the front end of the mobile robot, a master control electronic device is arranged in the mobile robot, the master control electronic device comprises a processor for performing centralized control, a motor driving circuit connected with the processor, the motor driving circuit is connected with the driving motor, an obstacle detection circuit connected with the processor is used for avoiding obstaclesThe system comprises a processor, a geomagnetic sensor, an inertial navigation system and a charging circuit, wherein the geomagnetic sensor is connected with the processor and is used for detecting the geomagnetic signal intensity H of the current position; the charging base comprises a charging electrode female end, a power jack and a charging control electronic device, wherein the charging control electronic device is provided with a controller for performing centralized control, a first power circuit and a filter circuit which are connected with the power jack, and a switching tube which is connected with the filter circuit, is controlled by the controller, outputs and is connected with a current detection circuit, the current detection circuit is connected with the charging electrode female end, converts a current signal into a voltage signal and sends the voltage signal to the controller, the charging control electronic device is provided with a first WIFI module which is connected with the controller, and the first WIFI module is set to be in an AP mode; the main control electronic device is provided with a second WIFI module connected with the processor, the second WIFI module is set to be in an STA mode, the processor acquires a wireless signal intensity value RSSI received by the second WIFI module, the RSSI is recorded as R, the wireless signal intensity value R is specifically received by the first WIFI module, and the processor is provided with a linked list L0={(a0 i,h0 i) In which a is0 i=Ri,h0 i=HiI =0,1,2,30 iRepresenting wireless signal strength values, h, of the first WIFI module stored at different moments on an environmental boundary0 iRepresenting the intensity of geomagnetic signals on the boundary of the environment stored at different times, a tail pointer ep0 is set to point to a linked list L0The location of the most recent data in; a linked list L is also set1={(a1 i,h1 i) In which a is1 i=Ri,h1 i=HiI =0,1,2,31 iRepresenting wireless signal strength values, h, of the first WIFI module stored at different moments in the environment1 iRepresenting the strength of geomagnetic signals in environments stored at different times, sets a tail pointer ep1 pointing to a linked list L1The processor sets a fingerprint map building method, and the fingerprint map building method comprises the following steps:
(1) mobile robot be in the base position of charging read wireless signal intensity value R and geomagnetic sensor's geomagnetic signal intensity H of first WIFI module, R promptly0And H0Is stored in a linked list L0I.e. a0 0=R0,h0 0=H0,ep0=0;
(2) The mobile robot leaves the charging base, rotates leftwards and walks along the boundary when the wireless signal strength value R is<a0 0- δ, where δ is set to a threshold value close to zero, go to step 3;
(3) the mobile robot walks along the boundary, the walking distance accumulation algorithm is adopted to calculate the distance d traveled by the mobile robot, and when the distance d is reached>10cm, storing wireless signal intensity value RiAnd geomagnetic signal intensity HiE.g. ep0+ +, a0 ep0=Ri,h0 ep0=Hi(ii) a When the wireless signal strength value | R-a0 0|<When delta, the mobile robot returns to the position of the charging base and enters step 4;
(4) data A0 is set in the processor and used for storing the wireless signal strength value R of the first WIFI module at the position of the mobile robot; mobile robot be in the base position of charging read wireless signal intensity value R and geomagnetic sensor's geomagnetic signal intensity H of first WIFI module, R promptly0And H0Is stored in a linked list L1I.e. a1 0=R0,h1 0=H0Ep1=0, while a0= R;
(5) the mobile robot rotates leftwards and walks along a boundary, a translation distance s from the mobile robot to the charging base is calculated by adopting a center distance calculation algorithm, when the translation distance s is larger than W, a current wireless signal strength value A0= R is stored, and the step 6 is entered, wherein W is the width of the vehicle body of the mobile robot; if the wireless signal strength value R > a0, go to step 11;
(6) the mobile robot enters a leftward tracking process, a tracking path is an isoline of wireless signal intensity R, namely a path with wireless signal intensity A0, a walking distance accumulation algorithm is adopted to calculate the distance d traveled by the mobile robot, and when the distance d is reached>10cm, storing wireless signal intensity value RiAnd geomagnetic signal intensity HiE.g. ep1+ +, a1 ep1=Ri,h1 ep1=Hi(ii) a When the mobile robot detects an obstacle, reading the current wireless signal intensity value RxAnd geomagnetic signal intensity HxJudging the type of the obstacle according to an obstacle distinguishing algorithm, if the obstacle is an obstacle, walking along the obstacle with the left side, and when | R-A0>After delta, entering step 7; if the boundary is detected, entering step 8;
(7) the mobile robot walks along the obstacle on the left side, and when the absolute value of R-A0 is less than delta, the step 6 is returned;
(8) the mobile robot rotates rightwards and walks along the wall at the right side, the translation distance s from the mobile robot to the charging base is calculated by adopting a center distance calculation algorithm, when the translation distance s is larger than W, the current wireless signal strength value A0= R is stored, and the step 9 is entered; if the wireless signal strength value R > a0, go to step 11;
(9) the mobile robot enters a rightward tracking process, a tracking path is an isoline of wireless signal intensity R, namely a path with wireless signal intensity A0, a walking distance accumulation algorithm is adopted to calculate the distance d traveled by the mobile robot, and when the distance d is reached>10cm, storing wireless signal intensity value RiAnd geomagnetic signal intensity HiE.g. ep1+ +, a1 ep1=Ri,h1 ep1=Hi(ii) a When the mobile robot meets an obstacle, reading the current wireless signal intensity value RxAnd geomagnetic signal intensity HxJudging the type of the obstacle according to an obstacle distinguishing algorithm, if the obstacle is an obstacle, walking along the obstacle with the left side, and when | R-A0>After delta, entering step 10; if the boundary is detected, entering step 5;
(10) the mobile robot walks along the obstacle on the left side; when the absolute value of R-A0 is less than delta, returning to the step 9;
(11) and the mobile robot finishes the fingerprint map building process.
The walking distance accumulation algorithm is set as follows:
initializing a walking distance d =0 cm;
setting a calculation period T;
at the initial moment of the current calculation period T, the initial position x is stored0=x,y0=y;
When the calculation period T is finished, calculating the walking distance delta d = of the mobile robot in the current calculation period T
;
And accumulating the Δ d to obtain the walking distance d = d + Δ d, and then entering the next calculation period T.
The center distance calculation algorithm is set as follows:
the translation distance s =10^ [ (P-R)/(10 × n) ] -10^ [ (P-A0)/(10 × n) ], wherein P is a wireless signal strength value RSSI measured at a position one meter away from the first WIFI module, n is an environmental parameter, and the value is set to be 2 for the home environment.
The left tracking process is set as follows: when R > A0+ delta, the mobile robot rotates to the left until A0-delta < R < A0+ delta; when R < A0- δ, rotate to the right until A0- δ < R < A0+ δ; keeping straight forward.
The right tracking process is set as follows: when R > A0+ delta, the mobile robot rotates to the right until A0-delta < R < A0+ delta; when R < A0- δ, rotate to the left until A0- δ < R < A0+ δ; keeping straight forward.
The obstacle differentiating algorithm is set as:
search chain table L0A in (a)0 iAnd RxThe closest values, i.e. i = min, | a0 i - RxL reaches a minimum; when i = min, if | h0 i - Hx|<And K, the current position is a boundary, otherwise, the current position is an obstacle, wherein K is a range limiting threshold.
The implementation of the invention has the positive effects that: 1. the coverage range of wireless wifi and geomagnetic signals is wide, and no accumulated error exists, so that the method can be used for establishing a reliable environment fingerprint map; 2. and the environment is not required to be set and modified, and the cost is low.
Detailed Description
The invention will now be further described with reference to the accompanying drawings in which:
referring to fig. 1-5, in the method for establishing fingerprint map of indoor mobile robot based on wireless network and geomagnetic signal, the mobile robot 19 includes a driving wheel, a driving motor 9 connected to the driving wheel, and a charging electrode male end 6 disposed at the front end of the mobile robot 19. Based on the driving wheels, the mobile robot 19 can move freely, and can be provided with two driving wheels and one supporting wheel; the male end 6 of the charging electrode is provided with two separated copper electrodes, and the charging is carried out when the charging electrode is connected with an external power supply.
A master control electronic device is arranged in the mobile robot 19, the master control electronic device includes a processor 1 for performing centralized control, the processor 1 may adopt a low-power microprocessor, specifically, MSP430 of TI corporation, or a common processor, such as a 32-bit ARM processor STM32F103C8T6 of ST corporation; the motor driving circuit 7 is connected with the processor 1, the motor driving circuit 7 is connected with the driving motor 9, under the control of the processor 1, the motor driving circuit 7 drives the driving motor 9, and the driving motor 9 drives the driving wheel to realize the free movement of the mobile robot 19; the obstacle detection circuit 8 is connected with the processor 1 and used for obstacle avoidance and path planning, and an ultrasonic sensor or an infrared sensor or a combination of the two sensors can be adopted; a geomagnetic sensor 11 connected to the processor, for detecting geomagnetic signal intensity H at the current position, and selecting MAG3110 of ricochar; an inertial navigation system 10 connected to the processor 1, configured as an encoder mounted on the drive motor 9, for calculating the position (x, y) and direction θ of the mobile robot 19, the inertial navigation system 10 having an accumulated error due to calculation errors, mechanical play and ground slip, but having a small error over a period of time and having a use value; still include with the charging circuit 5 that processor 1 connects, charging circuit 5 with the public end 6 of charging electrode connect, 5 output connection rechargeable battery 4 of charging circuit, 4 output connection second power supply circuit 2 of rechargeable battery, second power supply circuit 2 provide the power for follow-up circuit.
The charging base 20 includes a charging electrode female terminal 17, a power jack, and charging control electronics. The power supply jack can be connected with an external power supply adapter to supply power to all components of the charging base 20; the female end 17 of the charging electrode is provided with two separated copper electrodes, has elasticity, corresponds to the male end 6 of the charging electrode, and has the same height of positive electrode to positive electrode and negative electrode to negative electrode.
The charging control electronic device is provided with a controller 12 for centralized control, and because the function is single, a PIC16F1503 singlechip of MICROCHIP can be adopted; the power supply comprises a first power supply circuit 13 and a filter circuit 14 connected with the power supply jack, and a switch tube 15 connected with the filter circuit 14, wherein the switch tube 15 is controlled by the controller 12, the output of the switch tube is connected with a current detection circuit 16, the current detection circuit 16 is connected with a charging electrode female terminal 17, the current detection circuit 16 converts a current signal into a voltage signal to the controller 12, and the controller 12 can control the magnitude of the output current and prevent the charging electrode female terminal 17 from being short-circuited.
The charging control electronic device is provided with a first WIFI module 18 connected with the controller 12, and the first WIFI module 18 is set to be in an AP mode, namely a wireless access point, which is a central node of a wireless network.
The main control electronic device is provided with a second WIFI module 3 connected with the processor 1, the second WIFI module 3 is set to be in an STA mode, namely a wireless station which is a terminal of a wireless network, the processor 1 acquires a wireless signal strength value RSSI received by the second WIFI module 3, the RSSI is recorded as R, and the RSSI is specifically a wireless signal strength value R received by the first WIFI module 18. The first WIFI module 18 and the second WIFI module 3 can be set as IOT chips ESP8266, which has the advantages of low price and convenience.
The processor 1 sets a linked list L0={(a0 i,h0 i) In which a is0 i=Ri,h0 i=HiI =0,1,2,30 iRepresenting wireless signal strength values, h, of said first WIFI module 18 stored at different moments in time on the environment boundary0 iRepresenting the intensity of geomagnetic signals on the boundary of the environment stored at different times, a tail pointer ep0 is set to point to a linked list L0The location of the most recent data in; a linked list L is also set1={(a1 i,h1 i) In which a is1 i=Ri,h1 i=HiI =0,1,2,31 iRepresenting the wireless signal strength values, h, of the first WIFI module 18 stored at different moments in time in the environment1 iRepresenting the strength of geomagnetic signals in environments stored at different times, sets a tail pointer ep1 pointing to a linked list L1Where the most recent data is located. The processor 1 sends AT + CWLAP to the second WIFI module 3 with the network name of the first WIFI module 18 as a parameter, respectively, so as to obtain the wireless network signal strength R of the current location. Chain table L0And L1The fingerprint maps on the environment boundary and the fingerprint maps in the boundary are respectively stored in a linear linked list.
The processor 1 is provided with a fingerprint map establishing method, and the fingerprint map establishing method comprises the following steps:
(1) the mobile robot 19 reads the wireless signal intensity value R of the first WIFI module 18 and the geomagnetic signal intensity H of the geomagnetic sensor 11 at the position of the charging base 20, that is, R0And H0Is stored in a linked list L0I.e. a0 0=R0,h0 0=H0,ep0=0;
Setting initial conditions of a fingerprint map building process.
(2) The mobile robot 19 leaves the charging base 20, rotates left and walks along the boundary when the wireless signal strength value R is<a0 0- δ, where δ is set to a threshold value close to zero, go to step 3;
step 2 is that the mobile robot 19 leaves the range of the charging base 20.
(3) The mobile robot 19 walks along the boundary, the walking distance accumulation algorithm is adopted to calculate the distance d traveled by the mobile robot 19, and when the distance d is reached>10cm, storing wireless signal intensity value RiAnd geomagnetic signal intensity HiE.g. ep0+ +, a0 ep0=Ri,h0 ep0=Hi(ii) a When the wireless signal strength value | R-a0 0|<δ, the mobile robot 19 returns to the charging base 20 position, and proceeds to step 4;
in step 3, the mobile robot 19 walks along the boundary of the environment and records wireless messages at equal intervalsAnd the intensity values of the number and the geomagnetic signals are used as the content of the fingerprint map. In this process, the judgment of the termination condition is performed simultaneously: when the wireless signal strength value R is close to the value a stored in step 10 0The mobile robot 19 returns to the vicinity of the charging base 20.
The walking distance accumulation algorithm is set as follows:
initializing a walking distance d =0 cm;
setting a calculation period T;
at the initial moment of the current calculation period T, the initial position x is stored0=x,y0=y;
When the calculation cycle T is completed, the travel distance Δ d = of the
mobile robot 19 in the current calculation cycle T is calculated
;
And accumulating the Δ d to obtain the walking distance d = d + Δ d, and then entering the next calculation period T.
(4) Data a0 is set inside the processor 1, and is used for storing the wireless signal strength value R of the first WIFI module 18 at the position of the mobile robot 19; the mobile robot 19 reads the wireless signal intensity value R of the first WIFI module 18 and the geomagnetic signal intensity H of the geomagnetic sensor 11 at the position of the charging base 20, that is, R0And H0Is stored in a linked list L1I.e. a1 0=R0,h1 0=H0Ep1=0, while a0= R;
(5) the mobile robot 19 rotates left and walks along the boundary, a translation distance s from the mobile robot to the charging base is calculated by adopting a center distance calculation algorithm, when the translation distance s is greater than W, a current wireless signal strength value a0= R is stored, and the step 6 is entered, wherein W is the width of the vehicle body of the mobile robot 19; if the wireless signal strength value R > a0, go to step 11;
the center distance calculation algorithm is set as follows:
the translation distance s =10^ [ (P-R)/(10 × n) ] -10^ [ (P-a0)/(10 × n) ], where P is a wireless signal strength value RSSI measured at a position one meter away from the first WIFI module 18, and n is an environmental parameter set to 2 for the home environment.
The mobile robot 19 moves outwards by a distance of one vehicle body width, and records the wireless signal intensity value of the starting point to prepare for traversing the path to walk.
Meanwhile, if the mobile robot 19 does not move outward by a distance of one body width but moves toward the charging base 20, i.e., R > a0, the mobile robot 19 is at the farthest position and the traverse path walking process has been completed.
(6) The mobile robot 19 enters a leftward tracking process, a tracking path is an isoline of wireless signal intensity R, namely a path with wireless signal intensity A0, a walking distance accumulation algorithm is adopted to calculate the distance d traveled by the mobile robot 19, and when the distance d is reached>10cm, storing wireless signal intensity value RiAnd geomagnetic signal intensity HiE.g. ep1+ +, a1 ep1=Ri,h1 ep1=Hi(ii) a When the mobile robot 19 detects an obstacle, the current wireless signal strength value R is readxAnd geomagnetic signal intensity HxJudging the type of the obstacle according to an obstacle distinguishing algorithm, if the obstacle is an obstacle, walking along the obstacle with the left side, and when | R-A0>After delta, entering step 7; if the boundary is detected, entering step 8;
the left tracking process is set as follows: when R > a0+ δ, the mobile robot 19 rotates to the left until a0- δ < R < a0+ δ; when R < A0- δ, rotate to the right until A0- δ < R < A0+ δ; keeping straight forward.
Because the wireless signals are radiated outwards by taking the emission source as the center, the signal intensity is reduced along with the increase of the distance, the wireless signal intensity contour lines are continuous, the walking process of the traversal path can be realized by walking along the wireless signal intensity contour lines and keeping the distance of a vehicle body distance between the two wireless signal intensity contour lines.
When the mobile robot 19 detects an obstacle, it cannot determine whether the obstacle is an obstacle or a boundary, and therefore, it is necessary to perform a discrimination determination and then perform a separate process.
The obstacle differentiating algorithm is set as:
search chain table L0A in (a)0 iAnd RxThe closest values, i.e. i = min, | a0 i - RxL reaches a minimum; when i = min, if | h0 i - Hx|<And K, the current position is a boundary, otherwise, the current position is an obstacle, wherein K is a range limiting threshold.
The earth itself is a large magnet that creates a fundamental magnetic field between the geographic north and south poles. However, the earth magnetic field is interfered by metal objects, and particularly when the earth magnetic field passes through a building with a reinforced concrete structure, the original magnetic field is disturbed and distorted by building materials, so that unique magnetic grains are formed in each building, namely, a regular indoor magnetic field is formed indoors. And adding a wireless WIFI network to form two crossed wireless networks, wherein the geomagnetic intensity of each place is different on the contour line of the wireless WIFI signal intensity R according to an environment map L0The data in (1) can determine whether the current obstacle is a boundary or an obstacle.
(7) The mobile robot 19 walks along the obstacle on the left side, and returns to step 6 when | R-a0| < δ;
the mobile robot 19 performs obstacle detouring.
(8) The mobile robot 19 rotates to the right and walks along the wall at the right side, the translation distance s from the mobile robot 19 to the charging base 20 is calculated by adopting a center distance calculation algorithm, when the translation distance s is greater than W, the current wireless signal strength value a0= R is stored, and the step 9 is entered; if the wireless signal strength value R > a0, go to step 11;
and step 8, moving the other side of the vehicle body by the width of the vehicle body in the same step 5, and judging the condition of finishing the traversal path planning.
(9) The mobile robot 19 enters a rightward tracking process, and the tracking path is wirelessCalculating the distance d traveled by the mobile robot 19 by adopting a traveling distance accumulation algorithm according to the contour line of the signal intensity R, namely the path with the wireless signal intensity A0, and calculating the distance d when the distance d is reached>10cm, storing wireless signal intensity value RiAnd geomagnetic signal intensity HiE.g. ep1+ +, a1 ep1=Ri,h1 ep1=Hi(ii) a When the mobile robot 19 encounters an obstacle, the current wireless signal strength value R is readxAnd geomagnetic signal intensity HxJudging the type of the obstacle according to an obstacle distinguishing algorithm, if the obstacle is an obstacle, walking along the obstacle with the left side, and when | R-A0>After delta, entering step 10; if it is a boundary, go to step 5
The right tracking process is set as follows: when R > a0+ δ, the mobile robot 19 rotates to the right until a0- δ < R < a0+ δ; when R < A0- δ, rotate to the left until A0- δ < R < A0+ δ; keeping straight forward.
Step 9 is the same as step 6, and the process of planning the traversal path to the right is performed.
(10) The mobile robot 19 walks along the obstacle on the left side; when the absolute value of R-A0 is less than delta, returning to the step 9; (ii) a
The mobile robot 19 performs obstacle detouring.
(11) The mobile robot 19 ends the fingerprint map building process.
In summary, the mobile robot 19 establishes the fingerprint maps on the environmental boundary and in the boundary through the above steps, records the strength values of the wireless wifi and the geomagnetic signals through the linear linked list, can be used for autonomous positioning and path planning, does not need environmental setting and transformation, is low in cost, and has a very good application value.