Afocal Optical Flow Sensor for Reducing Vertical Height Sensitivity in Indoor Robot Localization and Navigation

This paper introduces a novel afocal optical flow sensor (OFS) system for odometry estimation in indoor robotic navigation. The OFS used in computer optical mouse has been adopted for mobile robots because it is not affected by wheel slippage. Vertical height variance is thought to be a dominant factor in systematic error when estimating moving distances in mobile robots driving on uneven surfaces. We propose an approach to mitigate this error by using an afocal (infinite effective focal length) system. We conducted experiments in a linear guide on carpet and three other materials with varying sensor heights from 30 to 50 mm and a moving distance of 80 cm. The same experiments were repeated 10 times. For the proposed afocal OFS module, a 1 mm change in sensor height induces a 0.1% systematic error; for comparison, the error for a conventional fixed-focal-length OFS module is 14.7%. Finally, the proposed afocal OFS module was installed on a mobile robot and tested 10 times on a carpet for distances of 1 m. The average distance estimation error and standard deviation are 0.02% and 17.6%, respectively, whereas those for a conventional OFS module are 4.09% and 25.7%, respectively.


Introduction
Mobile robots are widely applied in indoor environments for various purposes, including floor cleaning, guidance, and surveillance. Accurate localization allows the mobile robots to accurately perform mapping, obstacle avoidance, and path planning [1]. Localization can be further decomposed into two types: absolute and relative [2]. Absolute localization relies on landmarks, maps, beacons, or satellite signals to determine the global position and orientation of the robot. Relative localization is usually used in the process model of estimators for absolute localization, or when absolute localization sensor measurements such as GPS are denied for a moment [3][4][5][6].
Dead reckoning (DR) is commonly used for the intermediate estimation of position during movement. DR is often used when wheel encoders are available for drive wheel position measurement. Encoders are inexpensive and allow very high sampling rates; however, because of the errors in kinematic model parameters, wheel slippage, or other subtle causes, poor position estimates may occur. Poor estimates in position during path execution require more frequent path re-planning, incurring extra overhead, and possibly slowing the time required to complete the mission. Therefore, it is important to minimize errors in estimated position during the path execution phase.
There has been interest in the use of optical flow techniques for vision-based mobile robot localization and navigation. McCarthy and Bames [7] presented a comparison of four optical flow methods and temporal filters for mobile robot navigation. The strongest performances were achieved using Lucas and Kanade and a recursive filter. Campbell et al. [8] proposed criteria and an experimental method for evaluating optical flow for visual odometry systems in real, unstructured environments. The optical flow was used to aid in the navigation of an omnidirectional robot [9]. A charge-coupled devices camera was positioned at a 45° downward angle with respect to the ground in front of the robot. The obtained optical flow was combined with the DR results using the maximum likelihood technique. The method used to calculate optical flow is quite complex and requires a large number of computations to obtain good results.
Using the two-dimensional displacement output from optical mouse sensors, which are small, inexpensive, non-contact devices have been suggested as an alternative method of odometry estimation [10][11][12][13][14][15][16][17][18][19]. Optical mouse sensors integrate a small complementary metal oxide semiconductor camera (of the order of 30 × 30 pixels) with digital signal processing hardware and proprietary firmware algorithms to infer the displacement in both the X and Y directions based on the optical flow of features identified in consecutive image frames [20]. The use of optical mouse sensors for odometry has clear advantages over using wheel encoders; specifically, the independence with respect to kinematic forces such as wheel slippage and movement are resolved in more than one axis, which is of particular interest for omnidirectional platforms [21].
Several sources of error can be identified in the use of optical mouse sensors, including surface type, height variance, lighting conditions, and the angular displacement [13,17]. Vertical height variance is a key source of odometry error when using optical mouse sensors [11,13,22]. The errors induced by height variance are related to the scaled distance inferred by the optical flow algorithm. The larger surface area represented by each pixel causes the sensor to read successively lower values. Hence, the highest count values sampled are closest to the floor, where each pixel occupies the minimum area and thus appears to move the greatest distance.
Generally, vertical height variance is a result of the robot moving over irregular surfaces; this is the dominant cause of systematic error in horizontal displacement measurements. Researchers have characterized error variances for different surfaces, particularly those commonly used in indoor flooring [13,21]. The results demonstrated that different ground surfaces yield different sensitivities, with variances typically less than 10%. Larger variances from the mean are typically recorded on rougher surfaces (e.g., carpet or stoneware) or over significant discontinuities (e.g., joins between tiles), suggesting that the variances are related to the previously identified vertical variance errors.
To minimize error induced by height variance, many of the existing implementations use a surface with minimal height variance and mount the optical mouse sensor assembly (including the lens) in direct contact with the surface being measured [11][12][13]. The use of contact-free refocused optical mouse sensors for odometry estimation has been investigated in [23][24][25][26], and the results show the sensor data is linear with respect to height [24]. Scarab, the lunar rover prototype developed at Carnegie Mellon University, uses four commodity optical mouse sensors, each of which is attached to a lens of a different focal length [27]. A differential optical navigation sensor for mobile robots that provides consistent output despite changes in the distance between the surface and the sensor has also been proposed using two OFSs [28].
In this paper, we aim to mitigate the systematic error induced by height variance in indoor mobile robots using an afocal optical mouse sensor module that consists of single optical mouse sensor, a refocused lens, and a pinhole. Using the methods described in this paper, accurate estimates of position can be maintained even when wheel slip occurs or uneven ground is encountered.

Afocal Optical Flow Sensor System
To mitigate errors induced by height variance, we propose an afocal OFS system with a pinhole located at the near focus of the first lens from an OFS. An afocal system is an optical system that produces no net convergence or divergence of the beam (i.e., it has an infinite effective focal length). An afocal system is formed by the combination of two focal systems. The near focal point of the first system is coincident with the front focal point of the second system. The rays parallel to the horizontal axis in object space are conjugate to the rays parallel to the axis in image space. Common afocal systems include a telescope imaging a star (the light entering the system is at infinity, and the image it forms is at infinity), binoculars, and beam expanders [29]. Figure 1 shows an afocal system in which the "A" rays parallel to the axis are only passed through the pinhole, whereas the "B" rays are not parallel to the axis, which would be blocked by the pinhole screen. In Equation (1), longitudinal magnification is constant and determined only by the focal lengths of the two lenses.
where m, , , ℎ, and ℎ′ are the longitudinal magnification, the near focal length of lens L1, the front focal length of lens L2, the subject, and the conjugated scale-changed subject, respectively. The OFS selected for this work is the ADNS-3080 (Figure 2) [20], a common OFS that includes an internal low-resolution camera and a digital signal processor (DSP) programmed to estimate the relative displacement of the micro-shadows of the acquired images [30]. An OFS estimates a moving distance by analyzing with the reflected images from the active illuminated surface. If there are no irregularities on the surface, or if the surface is not sufficiently reflective, like glass, it cannot be used properly. This family of optical sensors uses complementary metal oxide semiconductor technology that integrates the camera and the DSP into the same chip. The sensor computes the optical flow by performing a comparative analysis of the sequence of images acquired of a flat surface in front of the sensor in order to estimate the motion of the surface [31]. The motion can be measured at different resolutions such as 800 counts per inch. Under this specific configuration, the OFS is internally calibrated to measure a pulse when a plain surface in front of the sensor is translated by 31.75 μm. Any change in the height between the sensor and the surface requires the development of a calibration procedure to convert the counts measured by the sensor to an estimate of the physical magnitude under measurement [32]. Palacin et al. [13] introduce an optical mouse calibration method using a MATLAB function.  The original design of an optical mouse based on this optical sensor combines three different parts: an OFS; an external light emitting diode (LED) to illuminate the surface in front of the sensor; and a small plastic structure that includes two convex lenses to focus the light of the LED and the image acquired by the OFS. The combination of all these parts was optimized to acquire focused images of a surface at a very low height (from 2.3 mm to 2.5 mm); although, this range can be increased by replacing the originally provided lens.
The ADNS-3080 includes an internal imaging device with a sensitive 30 × 30 array of gray intensity pixels. This OFS operates at very high frame rates and has a very fast internal shutter. It was originally designed to acquire images of a flat surface (approximately 1.82 mm × 1.82 mm) at a very low height (2.4 mm) to estimate displacement within images. The ADNS-3080 has a standard serial peripheral interface bus to read/write the internal registers and control the common actions of the sensor. According to the manufacturer's specifications, the optical sensor can acquire and process images at a very fast speed (from 2000 to 6469 frames per second) due to the low sizes of the images acquired (30 × 30 pixels) [26].
The newly designed afocal OFS module consists of a pinhole with a diameter of 0.5 mm, a lens with a focal length of 10 mm (L1 in Figure 1), and an ADNS-3080 OFS that replaces the second lens in the afocal system (see Figure 3). As the pinhole sizes gets bigger, more less-columnated light rays enter through the pinhole, which makes the image less clear, which in turn increases the sensitivity to height variations. Note, that if the pinhole size is too small, there is insufficient light for the afocal OFS to recognize the surface pattern. We have selected a pinhole diameter of 0.5 mm with 4 LEDs in this study. The smaller pinhole size gives clear images and blocks more nonparallel light, whereas the sensor needs more light in order to obtain brighter images [33].  The fabricated afocal OFS module at different angles is shown in Figure 4. Figure 4a depicts the pinhole, Figure 4b shows the ADNS-3080 optical mouse chip, Figure 4c shows the perspective view of the afocal OFS module, and Figure 4d shows the lens and the red LEDs.

Experimental Setup
To obtain accurate and repeatable data, a robotic gantry system consisting of a height-adjustable jig and a belt-driven linear actuator is used ( Figure 5). The linear actuator (DRSB99SL40-ST1000, Dream Robot System, Incheon, Korea) is capable of a repeat precision of 20 μm, an accuracy of 50 μm, and a maximum speed of 1000 mm/s [34]. Because of the 100 cm maximum moving distances of the linear actuator, the range is set to 80 cm in the experiments. A rack and pinion-type linear stage positioner (XWG60, Misumi, Tokyo, Japan) is used to precisely adjust the height [35]. A microcontroller unit communicates with the sensor via one serial peripheral interface channel. A Microchip processor (dsPIC33FJ256) employing a powerful 16-bit architecture that seamlessly integrates the control features with the computational capabilities of a digital signal processor is used [36]. The sampling time to obtain the motion information from the sensor is 20 ms.
Most of the causes of height variation in indoor navigation, excluding variations associated with robot suspension, are rough carpet, doorsills, low obstacles, uneven ground, and any objects that a robot can climb. To verify the feasibility of the fabricated afocal OFS module in these environments, four types of floor materials were selected for experiments: laminated floor; vinyl sheet; texture-style carpet; and loop-style carpet ( Figure 6). The height between the OFS and the surface of the material is varied from 30 to 50 mm in seven steps, and the sensor module is moved by the robotic gantry system over a distance of 80 cm at a speed of 35 cm/s. The same experiments are repeated 10 times, and the image quality is examined every 5 mm in the experimental height interval. Finally, the afocal OFS module is installed on a mobile robot (Figure 7) and tested 10 times on the loop-style carpet (Figure 6b) over distances of 1 m. Since the surface height variation of the loop-style carpet is the greatest among the other flooring materials (Figure 6), the loop-style carpet is selected for robot experiments. The height variation of the loop-style carpet is shown in Figure 8. The surface profile is measured by a laser distance sensor (DLS-B 30, DIMETIX, Herisau, Switzerland) [37], which has a resolution of 0.1 mm and the robotic gantry system. The laser sensor is moved from 0 to 200 mm by 1 mm intervals with the linear motion guide, and the surface profile is measured. The average height and SD are 86 mm and 8.7 mm, respectively.
Moving distance information is gathered while the robot is moved by manual operation. After the acquisition of the experimental data, the average moving distance estimation error and SD are calculated.

Results and Discussion
This section analyzes the performance of the suggested afocal OFS module in robustly estimating distance in indoor environments with height variation. A first experiment was carried out to determine if the use of the suggested sensor system improved image clarity. The images of the word "an" (MS Word, 9 pt. font size, Times New Roman) obtained with the OFS module are shown in Figure 9. The images are clearer compared to those obtained without a pinhole, as the height changes between the sensor and the test floor from 30 mm to 50 mm at intervals of 5 mm. The only difference between the afocal OFS module and conventional fixed-focal-length OFS module used in this test is the existence of the pinhole. The conventional OFS module is calibrated at the height of 35 mm. Since the conventional OFS module does not have pinhole, it can be regarded as having a big pinhole. As the pinhole size becomes bigger, more less-columnated light rays enter through the pinhole, which makes the image less clear, which in turn increases the sensitivity to height variations. The measured mean distance and SD are shown in Figure 10. In addition to the data in Figure 10, Table 1 includes the error percentages obtained using the afocal OFS module while varying the height between the afocal OFS module and the floor material. The results show that a 1-mm offset in sensor height induces a 0.1% systematic error in the height range of 30 mm to 40 mm; in comparison, the systematic error for a 1 mm offset in a conventional OFS module with a fixed focal length in the height range of 30 mm to 35 mm is 14.7%. In Table 1, the results show that when the height of the afocal OFS sensor rises over 40 mm the error rates start to increase. This is because the pinhole size is not ideally zero, and the illumination on the surface decreases as the height increases. The test results for a mobile robot with an installed OFS module are shown in Figure 11 and Table 2. For ten 1000 mm-movements of the robot over loop-style carpet, the average estimated distance is 1000.2 mm (0.02% distance error), and the SD is 17.6. For the conventional OFS module with a fixed focal length, the average estimated distance is 959.1 mm (4.09% distance error), and the SD is 25.7.

Conclusions
In this paper, a novel method for more scale invariant afocal OFS module with single OFS in height varying indoor environments was introduced and experimented. To minimize the horizontal displacement measurement error due to OFS height variation while the robot is moving, an afocal system was applied to OFS for the first time.
We conducted experiments to evaluate the performance of the proposed method in a linear motion guide on carpet, laminated floor, and vinyl sheet. The sensor height was varied from 30 mm to 50 mm in seven steps over a total distance of 80 cm. The experiments were repeated 10 times. The systematic error corresponding to a 1 mm change in sensor height for the proposed afocal OFS module was 0.1%; for comparison, the corresponding value for a conventional OFS module with a fixed focal length is 14.7%. Finally, the proposed afocal OFS module was installed on a mobile robot and tested 10 times on the loop-style carpet over distances of 1 m. The average distance estimation error and standard deviation (SD) for the new module were 0.02% and 17.6%, respectively; in contrast, the corresponding values for the conventional OFS module were 4.09% and 25.7%, respectively. As the afocal OFS moved away from the vertical height range of 30 mm to 45 mm, the measured moving distances decreased because the pinhole size was not ideally zero, and the illumination on the surface decreases as the height increases.
The proposed approach using an afocal system and an optical mouse sensor showed encouraging results and robust performance for accurate indoor odometry, even in the presence of localized high and low points. The afocal OFS could be an indispensable sensor for indoor robotic navigation.