Navigation for Indoor Robot: Straight Line Movement via Navigator

1College of Command and Control Engineering, The Army Engineering University of PLA, Nanjing 210007, China 2Institute of Network Information, Institute of Systems Engineering, Academy of Military Sciences, Beijing 100071, China 3College of Computer and Information, Hohai University, Nanjing 211100, China 4College of Energy and Electrical Engineering, Hohai University, Nanjing 211100, China 5School of Electronic and Optical Engineering, Nanjing University of Science and Technology, Nanjing 210094, China 6Key Laboratory of Symbol Computation and Knowledge Engineering of Ministry of Education, Jilin University, Jilin 130012, China


Introduction
Traditional low cost sweep robot used the random mode of sweeping, with small coverage area, low cleaning efficiency, and easy collision. Adopting the shape of Z full coverage algorithm [1] can effectively reduce the disadvantage of random sweeping, but robot must run linearly if the full coverage algorithm can work steadily [2,3]. It could work normally based on an inertial measurement unit (IMU) [4,5], but with the data from both sensor and PID correcting its direction, it is not enough to realize its indoor localization. Due to accumulated errors of sensors, wheel mechanical inaccuracy, and the slide problem, sweeping robot would drift away, so researchers start the indoor navigation system [6] research. Rodas et al. proposed an optimal Bayesian fusion and localization algorithm based on Bluetooth positioning data [7]. However, Bluetooth localization error is still serious, deployment cost is huge, and the result is not satisfactory. Lin et al. proposed a fingerprint localization system based on Wi-Fi [8], which is a sample of signal intensity, and preconstruct a radio map, use the information of Wi-Fi cover, and read data from accelerometer reliably. However, a great quantity initial work should be finished before using it, and the effect is not very well. Fuentes-Pacheco et al. proposed vSLAM (visual Simultaneous Localization and Mapping) [9][10][11][12][13]; this scheme 2 Mathematical Problems in Engineering has lower deployment cost and high localization accuracy features, and also its visualization is prefect. However, when the light had changed, the result fluctuated greatly. With introducing a Kinect (a depth camera) [14], the cost of full system would rise. In [15], Binu proposed to use the naturally occurring magnetic fields inside the concrete buildings with simplified magnetic map [16] matching algorithm. Due to the existence of sensor accumulation error problems, the navigation's accuracy is insufficient. Furthermore, Wolfgang Hess et al. propose a 2D SLAM system that combines scanto-submap matching with loop closure detection and graph optimization, making its source codes open-source [17]. However, equally it needs a LIDAR, which costs much money. Because of the characteristics of light moving straight forward, the infrared ray [18] wavelength is long and mostly would not scatter in the air. An infrared ray is sent by opening a small hole in the front of the navigator, so that it can be considered as a line in terms of the ultrasonic (see Figure 1). The infrared communication module consists of transmitter and receiver. The transmitter is located on the navigator, and the receiver is located on the sweeping robot. A low scattering infrared ray is sent by the transmitter, after being received by the sweeping robot, and it can be regarded as a baseline in the room (we usually put the navigator approximately on the middle of the room's edge) [19].
Similarly, the ultrasonic module is divided into the transmitter and the receiver. The transmitter is located on the navigator, and the receiver is located on the sweeping robot. Measuring the time of running between the navigator and the sweeping robot and multiplying by the velocity of ultrasonic in the air, we can work out the distance between them. While meeting the infrared baseline, the sweeping robot would start to correct itself. And because the infrared ray has the reflection characteristic, when the infrared ray radiates to the ceiling, the reflection will occur, so that the full room would be covered [20].
In a word, to realize indoor linear navigation, the deployment cost based on Wi-Fi [21,22] and Bluetooth is huge, and vSLAM cannot work normally in the evening. Therefore, when considering the cost problem with guaranteeing high coverage percentages, we propose to use a navigator (consisting of infrared and ultrasonic) to help localization and navigation. It mainly carries out the shape of Z strategy based on motor encoder and PID controller local optimum [23]. At the same time, infrared ray and ultrasonic are used to realize auxiliary localization and correct itself to make global optimum [18]. Comparing to existing algorithms, extensive quantitative evaluations shows that the proposed method realizes indoor full coverage at a lower cost than other stateof-the-art indoor vision navigation schemes, such as ORB-SLAM [11,24] (see Figure 2).
The remainder of this paper is organized as follows. Section 2 provides an overview of the robot hardware platform. Section 3 explains the proposed localization and navigation algorithm. Finally, Section 4 provides experimental results and comparisons.

Robotic Platform
In order to verify the navigation algorithm, this paper designs a double navigation platform between sweeping robot and navigator. The sweeping robot adopts Cortex-M3 architecture 32 bit microcontroller stm32 as the main control chip, which is produced by STMicroelectronics. The navigator adopts super low power msp430 as the main control chip, which is produced by the United States TI. A sweeping robot consists of two wheels controlled by deceleration motors, equipped with photoelectric encoders to measure the speed of the two wheels, and uses six-axis gyroscope MPU6050 to calculate its posture [25]. Additionally, the sweeping robot and navigator are equipped with infrared transceiver module to communicate with each other at the top [20]. In flank, an

Localization and Navigation of Indoor Robot
The navigator is located at the edge of the room, and it regularly sends an infrared ray signals without scattering. When the sweeping robot detects infrared ray signal, calculates the distance → , and records the wheels roll over the distance → , the ultrasonic wave starts to emit regular frequency. With the ultrasonic wave, we could measure → again. As a result, by solving → , → , → which form a vector triangle, we can obtain the real forward angle and correct the sweeping robot direction by comparison to the theoretical value as shown in Figure 4.

Ensure Running in a Straight
Line. Traditionally, a sweeping robot can stably execute straight line because two wheels can keep themselves running with the same velocity. Because the electronic characteristics of two wheels may not be completely consistent, in the same PWM duty rate, the velocities of two motors are not exactly the same. If there is long-term running, the error is accumulated continually, and the sweeping robot would move forward one side. Therefore, it is necessity to adjust the velocity of the two wheels in real time so that the velocity of two wheels becomes the same, and robot can keep itself linearly running for a long time without any consideration to the other obstacles.
In this paper, we installed two 26-hole photoelectric tachometer encoders at the back of the motors. By measuring the number of pulses generated by the photoelectric encoder in unit time and before that measuring the circumference of the wheel L, the formula is given as follows.
Theoretically, after obtaining the forward speed of V, the velocity of the wheel can be adjusted by the PID control algorithm in the field of classical automatic control. However, considering the approximate errors produced on the formula transformation, we directly added the number of pulses N generated by the photoelectric encoder to the PID formula Incremental PID control algorithm: where ( ) is the output value of PID and ( ) is the desired value.
is the photoelectric encoder current measurement value, and ( ) is the deviation value. In this paper, DC motor is used for robotic motion, by controlling the duty rate of PWM to control the velocity, so according to the incremental PID control algorithm, the recursion formula is where ( ) is currently the value of PWM, which supplies motor; additionally, ( − 1) is the last value of PWM. ( ), ( − 1), ( − 2) are the offsets between expected velocity and real velocity by current, by last time, and by the time before last time. T is the sample time, usually a fixed value; , , are the parameters which will be optimized. The algorithm's pseudocode is as in Algorithm 1.
Among them, (1), (2), (1), (2) are the PID output values and offsets of the left and right wheel, respectively. Using PID algorithm, the mechanical errors can be eliminated, and the robot can ensure that it is straight as much as possible.

Angle and Position Correction.
The two wheels of the sweeping robot are driven by two independent motors. Although using PID regulation control can ensure that the two wheels are at the same speed, the robot would shift when running a distance because there may exist slipping and mechanical error. A new method of angle and position correction based on infrared and directional ultrasonic sensors is presented in this paper as shown in Figure 5.
The navigator is placed in the middle of the wall on one side of the room, emitting vertical infrared ray and fanshaped ultrasonic waves on both sides. The angle of motion of the robot is always parallel to the wall. When the robot runs from top to bottom and from right to left, and each time is in the middle of the room, the robot receives infrared ray and ultrasonic waves, determining its position by combining onboard devices. If the robot discovers deviation from the straight line, it corrects itself in time.
Basic work principle: With the infrared ray by the navigator treated as the baseline, we sent an ultrasonic wave with certain angles in particular frequency which can measure the precise position of robot. Based on two times of measurement, we can resolve robot's deviation angle. Specific steps are as follows (before the algorithm is detailed, note that we briefly define the notation that is used throughout the paper in Table 1): Step 1. When the robot arrives at the baseline of infrared, after it receives an infrared ray, the distance → between them can be obtained.   Step 2. After the robot leaves the baseline and runs in a short distance | → |, measure the distance between them by ultrasonic wave again.

Mathematical Problems in Engineering
Step 3. Resolve the horizontal attitude angle from the relationship of geometry.
= arccos However, as the complexity of the formula is expensive and the gap between → and → is more than 10 3 orders of magnitude, we propose a geometry algorithm to make the complexity reduction substantial (see Figure 6).
Follow as the center of a circle, the direction of → as x axis forward, and the direction of perpendicular → as y axis forward. Let down ⊙ trajectory is y=f(x). The slope of the tangent at C is ( ) in ⊙ .
The slope of AC: because of | → | towards 0 relative to → , -=o(x) [27], o(x) is the infinitely small quantity of x.
so, the slope of the tangent at C being ( ) in ⊙ O is equal to the slope of AC.
As the (10) and (12) are antitrigonometric functions, we can directly consider the internal formula. As we all know, 6 Mathematical Problems in Engineering  multiplication is nearly 10 times slower than addition and subtraction, and division is nearly 20 times slower than addition and subtraction, when it is an 8-bit CPU. Now, we define the time of addition and subtraction as , then the multiplication is 10 , and division is 20 . For (10), the time of the whole equation is as follows.
Then, we have the following.
Compared with (10), (12) reduces the computational complexity [28] and increases efficiency by nearly 70.8%. At the same time, it satisfies the actual precision requirement under the condition of̂being smaller. The relationship between relative errors and deviation angle from the original line is shown in Figure 7.

Navigation Implementation between Multiple Rooms.
In order to help a robot to cross different rooms to work continuously, it should be improved autonomously. In this paper, we built topology model for multiple rooms based on the theory of graph optimization [29]. Meanwhile, the depthfirst search (DFS) [30] stack is introduced to firstly select the most nearest and inmost room to work [31], which improves the efficiency of DFS. The algorithm's pseudocode is as in Algorithm 2.
In this algorithm, we define a room as ( = 1 . . . ) by the navigator which has a unique encode signal. We build a stack to store the room information so that the robot can select the most nearest and inmost room to work. When it finishes the current room, then it checks the stack status every time. Lastly, it goes back to the initial room and stops working.

Implementation and Experiments
We tested the SLMN algorithm in a 10.8 * 10m real indoor environment, and the dimension of the robot was 0.8 * 0.4m. Since it is an upgraded TF card, the robot could easily store the data from the electronic motor encoder. The real robot was shown in Figure 8. ThenS.push( 2 ) 7 When finish working this room 8 While S is not empty 9 = S.pop() 10 Enter the ID of room 11 if is not labeled as discovered: 12 Label as discovered 13 Goto line 3 14 Back to initial room, then the work is over 15 Else 16 Stop work  After finishing its work run, the local trajectory of the robot was restored (as the errors are small, it is difficult to discover the trajectory of at a global view), as shown in Figure 9. The red and blue lines represent the robot's true trajectory and ideal trajectory, respectively. Therefore, we can find out that when the robot passed an infrared reference line ( = 5m) by the navigator, the deviation trajectory would be effectively corrected.
By calculating the absolute value, a good view of this deviation could be created. The deviation that appears on [(5 + 10.4 , 5 + 10.4( + 1)] will be effectively corrected at 5 + 10.4( + 1) as shown in Figure 10.
Occasionally, resources such as memory and computational time are of primary concern, but most often cost and accuracy are what we want to measure. By analyzing several candidate algorithms for the navigation problem [6], we can identify a most efficient one. In this paper, we put the results of comparative analysis with other state-of-theart algorithms such as vSLAM [11], LIDAR SLAM [17], and inertial navigation [32,33] as shown in Table 2.
From Table 2, it is seen that the two SLAM systems have similar precision, which are the most highest. However, their work time is also the shortest in the same battery capacity, so it needs more power to keep it working. Although inertial navigation system has the lowest cost, its error is too enormous to work normally. As a result, since the development of new energy still faces several uncertain difficulties [34][35][36], our proposed algorithm will cost less energy in satisfying practical applications. which than the other state-of-the-art algorithms.

Conclusion
On the one hand, this paper proposed a high efficiency method on indoor sweep robot line navigation. The two measured values between navigator and robot and the distance of robot motion can form a triangle then to solve the forward angle and correct the direction of forward speed with analytic geometry principle. Finally, we implemented the long time line navigation, and based on that, we propose multiroom navigation algorithm. After simulation and reality environment experiments, on the threshold of error, an indoor line navigation method based on the navigator which consists of the infrared and ultrasonic sensors, even in the evening, could resolve the problems on the other existing navigation.
On the other hand, we prepare to do more works on building a map based on the high efficiency motion to  improve its practicability and integrity, so it can become selfcharging and work continuously.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors declare that they have no conflicts of interest.