Optimization of SLAM Gmapping based on Simulation

-This paper presents the Optimization of Simultaneous Localization and Mapping (SLAM) Gmapping algorithm, and compare the results of experiments based on the optimized parameters. From the known types of SLAM, we analyze Gmapping, and used the dataset and the ground truth standard map to carry out the experimental results in the simulation. Using the dataset result as a reference, and optimizing the parameters, we have different simulation results. We conducted The optimization and testing experiments in two ways, at first optimizing parameters separately, and second optimizing more than one at a time. This enables us to conclude the preferable way of optimizing parameters which led the close map result to dataset map or ground truth.

INTRODUCTION Simultaneous Localization and Mapping (SLAM) is one of the most widely researched, under-researched field, especially in recent decades. And most definitely will be studied more to the extent. Conceptually SLAM is basically the two-operation process. For a mobile robot placed in unknown location, building and output the map of the environment, which is mapping, and while doing this, the robot localizes its own location which we call this Localization. Which is estimating the robot's location [1]. So, SLAM is Building the map of unknown environment and localizing of the robot simultaneously. While performing this operation the sensors fitted in the robot enables to visualize the environment and create the map [2]. indeed, there have been faced a lot of problems on this area which led and paves a way for brilliant scholars to do their best for the best way on how to solve the problems. As a result, a lot of methodologies, approaches and developments have been seen significantly since the concept was introduced. Especially the tap root area of SLAM, Algorithm. Different Algorithms have been put under research and we have seen results confirmed based on new types of algorithm. Although all invented SLAM algorithms share the same ultimate goal, but they have their own features. In addition to this most SLAM problems, based on algorithm, use Baye's rule to solve mapping problems [3]. So far Different algorithm methods have been invented like Gmapping, Hector SLAM, and Karto SLAM. In this paper we conducted Gmapping algorithm to optimize and compare each result interms of its progress relative to the dataset map. We took the standard dataset and ground truth map the parameters from the source code, the C++ program. 1 and optimize the parameters in different ways, in which are described in this paper, and save accordingly. Based on the optimization the new results are compared with standard dataset map. And identified the progress and effects each parameter has on the map. And further conclusions have been given. We use Ubuntu 16.04 to undergo the optimization experiment.

II.
RELATED WORK In the past decades interests has been increasing astoundingly and exponentially in SLAM algorithm. Since a lot of SLAM problems are there, different solutions and methods have been astonishingly introduced on solving those problems and exciting progress have been seen. Basically, related to this paper we focused on Gmapping Algorithm. Optimizing SLAM algorithm has vital role on solving SLAM problem. Shortly sensors are fitted on the robot, and the sensors feed the SLAM algorithm every information including odometry, LIDAR datas, which in return, generates the surrounding map. And localize its own location. It is here where the heart of SLAM problem is occurred. And the solutions can be given either comparing different types of algorithms or optimizing parameters. It can be in a real environment or simulation model. It is highly believed and seen that, for better mapping and localization results, detecting the algorithm function and optimizing the parameters play a vital role. Classifying each parameter's function, and their effect on the map relative to the dataset and ground truth, enables to improve robot's performance on to solve the SLAM problems. Ruoxi Wu, Leizheng Shu, Xin Zhao [4], introduce navigation precision based on Rao-Blackwellized particle filter (RBPF). Factors and errors that affect the accuracy were listed out briefly, and applied firefly algorithm technicality. A grand result has been showed based on the simulation. providing a bright solution to the problems of navigation error, and the Gmapping algorithm shows accuracy in addition to solving the unsteadiness of positions. The vital actor on improving the Gmapping algorithm was the firefly algorithm. In real indoor environment, tests have been also conducted based on SLAM algorithm. In an analysis [5], the SLAM algorithms were applied in the same experimental environment by using crawler-based robot. And concludes that grid maps can be constructed with high-precision in addition to other necessary results. Doris M. Turnage take the simulation results of the three types of laser-based SLAM algorithm, Gmapping, coreSLAM, and HectorSLAM and compare based on their performance [6]. from the analysis while performing according to the input, the implementation aspect was different, particle filter was used for Gmapping. While HectorSLAM and coreSLAM uses scan matching. Interms of the ground truth map topologies, the algorithm has to be laser-based data in the simulation. For more accurate map topology, changing few parameters was enabled from the simulation. In this paper the Gmapping simulation map result has higher intensity than the standard map. In general, the three algorithms perform interchangeably in different aspects. For the map comparison, Hausdorff Distance was calculated. The analysis made by Rauf Yagfarov, Mikhail Ivanou and Ilya Afanasyev, use the compare and analyze the SLAM libraries, Gmapping, Google cartographer, and Hector SLAM in accordance to the ground truth. The experiment used metrics of average distance to the nearest neighbor (ADNN). The comparison subject was to construct accurate map in accordance to ground truth [7]. the investigation claims Gmapping has close enough to the constructed maps generated by Google cartographer. This paper also claims the comparison is being suitable even for the three-dimensional in addition to the two-dimensional maps. The other big issue rises during SLAM problem analysis, which is the map consistency. During our experiment, we have a look over the map consistency after optimization the source code. Since we generate a lot of experiments, by changing the parameters based on the two ways we define later, we gave firm attention on whether the map consistency varies as per the optimization or not, so that we can indicate later on the real environment, one can have autonomous navigation result. Indeed, there can be different analysis on the map consistency. Mladen Mazuran, Gian Diago Tipaldi, Luciano Spinello, Wolfram Bugard, Cyril Stachniss analyzed two basic computation on the consistency of map in SLAM based on 50 maps [8]. They introduced quite different from the mostly used technique graph-based SLAM paradigm, which rely on computing automatically. After pertaining tests statistically, since this enables to tuning the parameters, then after, the different results were recorded and introduce this method to successful map consistency. Other SLAM algorithms also have been introduced by different researchers on different solving problems. For indicating landmarks on the generated map, R. Lemus, S. Diaz, C. Gutierrez, D. Rodriguez and F. Escobar [9], analyzed with scanning laser range finder and radiofrequency identification technology (RFID). Generated on the virtual map, and relative to the SLAM-R generated map based on the cycle closure technique, it is possible to generate 2D maps in indoor environment and improvements showed.so it is confirmed that introducing and solving or giving firm analysis, optimization, and developments on the algorithms gives and paves a way to solve different SLAM problems. Optimizing algorithms since the time from the very beginning researchers gave different methods was based on sensors, like laser or sonar, interms of deep calculations the likes of Kalman filters, Rao-Blackwellized particle filters and so on [10]. Different other approaches have ben also tested. Frank Dellaert also introduced the Factor graphs smoothing techniques [11]. [7]. probability is one thing in common they share which enables the robot output impervious to failure in some conditions, and decrease measurement robustness [3]. For the simulation experiment we analysis Gmapping, which is the most used so far since the first time proposed by Gisetti 2006 [12]. And is open source SLAM algorithm in 2007 [5]. For the problem of positioning and mapping, it used Rao-Blackwellised particle filter (RBPF) [5], which is a version of particle filter [13][18] [21]. it is derived from Monte Carlo algorithm, while solving its SLAM and use laser-based SLAM for the map result [12]. as is known SLAM problem or map robustness rises due to a lot of factors including hypothesis space, where being large of the map space, and the learning maps which is a "chicken-and-egg" problem [14]. Which is directly a problem related to odometry. This led to localization problem. So, the factors that decide SLAM problem including the environment cycles, resemblance of different positions, the environment's being wide and so on.

OPTIMIZATION of GMAPPING Till this day, different experiments and comparison and evaluation has been held between the recognized SLAM algorithm [3][4][5][6]
To overcome the problems, it is mandatory to refer definition the algorithms. Of the Gmapping, it should rely on the algorithm technicality to calculate and generate the map. For a map , since the path is already known, according to the dataset or ground truth, with the robot's poses, path of the robot 1:t , at a time t, the distribution according to set of all measurements, z 1:t ( | 1: , 1: ) (1) While including the robot's controls, u1:t we'll have: As is already defined, since the dataset path is known we use (1), and splitting the grid map with different grid cells (m 1, m 2 , m 3 , ……., m ). So, we have (8) Having this grid cells, the distribution based on the estimation, and the distribution based on the posterior maps will give us the following. We will not use (2) rather we use (1), because we had ignored the controls.
( | 1: , 1: ) = ( | 1: , 1: ) The analysis in [14], discussed the grid mapping algorithm (table  1) to the binary estimation problem the filter after using the log-odds calculation: The algorithm based on the robot's path, in a given path through the grid cells under the function inverse_sensor_model.

Fig 1. Occupancy grid algorithm
For the grid maps based on the laser scan data Rao-Blackwellized particle filter (RBPF) is applied (15).

Particle filter analytical computation
Based on (11) which defines RBPF, the laser data feeding the path's measurements, particles get the landmarks or the poses. which are defined by the laser data. So now the laser scan with the observations or measurements, t-1 , the pose is identified. Based on the algorithm, and from the distribution, t-1 the map will be obtained. In every landmark and poses, the particles will be registered based on t , and t . [15]. The analysis [15] [16], claimed that RBPF as the better than Extended Kalman Filter (EKF) and other Kalman filter algorithms. While the SLAM problem rises here in generating the map trajectory, RBPF algorithm will give a solution. Extending   [18], after algorithm enable scan matching, the particle filters will be able to start the sampling. And while the odometry continue to update the current state, scan matching will resample and generate the map.
Automatically the odometry will continue to feed the pose condition to the scan matching. Scan matching then update the information in the same cycle used as before.
The motive for doing this research is significant in optimization of Gmapping algorithm. Most researches showed algorithm optimization based on the three types of SLAM algorithm, which is not enough to give precise direction on the parameters. So, this research will give the parameters and their effects in Gmapping algorithm. The other thing that make this study from other optimizations is, the methods used during the optimization. We can classify as optimization based on the parameters separately and see the results, and the second method is optimizing the parameters collectively. This will pave a way to understand the effects of every parameter and their function. And create a motive to optimize researchers in a real environment.
III. RESULTS AND DISCUSSION In this paper, we analyze Gmapping and optimize the parameters in the source code, and undergo experiment to see the result which optimization is close matching relative to the dataset or ground truth. The source code is available in. we use two methods of the optimization. At first, we use optimizing the parameters separately and see all the results and the second optimizing the parameters collectively.and we will see the results below. From The above two maps. Map 1 indicates the ground truth map which is our touch stone. This is the standard map of the dataset, which is the collection of datasets gained from the map, that is the map described by the ground truth. In other words, the ground truth represents the information of the map. While Map 2 is Gmapping map built by using logged data which we refer as default values [21]. It is generated by running the dataset based on the algorithm, which is the first map estimate mentioned above. So, there is an error compared with the touchstone, which means that experiments are needed to have to get close map to the ground truth map.

Parameter explanation
The parameters are the key for our optimization. We use 10 of the parameters for the first method, and 12 of the parameters for the second method. Their function is as follow [22][23]: Sigma: this is the parameter used by the greedy end point matching. It is standard deviation for the scan matching process. Kernel size: the kernel which seeks the correspondence, or for the scan matching process. lstep: this is initial search or optimization step for the scan matching process, mainly for translation (linear). astep: this is initial search or optimization step for the scan matching process, mainly for rotation (angular). Srr: the linear function of odometry error in linear (x and Y). Srt: the rotational or angular function of odometry error in linear (theta). str: the linear function of odometry error in angular or rotational (x and Y). Stt: the rotational function of odometry error in rotation. Linear update: the measurement, or the length where the robot moves or rotates, to process a new scan. Resample threshold: The resampling threshold based on the particles resampled. Particles: the number of particles, which defines the robot's possible trajectory. Map update interval: this is the time the robot updates the map based on its scanning. We take this parameter because they are editable in the source code. Indeed, except the map update interval, the rest are parameters used by Gmapping itself. The reason why we include the map update interval is, to take the time between successive recalculations of maps. Based on the optimization process, our experiment's result is included below.

1.optimizing the parameters separately
Here we tried to optimize selected parameters as per their function, separately by neglecting the rest as default. Out of the active parameters we perform and use editable parameters and appropriate of them, and evaluation of results were carried out relative to the touchstone, and compared with the dataset. The reason behind to choose the parameters are because they are editable, which means we can provide new values and run the program. During the optimization, what was our reference for changing the parameters? Is the main question. What we did during the optimization is according to two procedures. The first one is optimizing the parameters uniformly. The values of the parameters were changed in an equity manner which is uniform optimization. The second thing is, using reference. We take the time (in seconds), between two successive recalculations of the map, which is the map update interval. This is the parameter used by the Gmapping algorithm itself. We use This parameter as reference and the default value, 5.so we multiply each parameter by the map update interval.
( ) = × As a result, we have showed in Table 1, what the values looks like.  Table 2, based on the m_count, Neff, and average scan matching score. Since the optimization is processed uniformly, we didn't receive the same results interms of m_count, neff, and the average scan matching score. 1.we have the same m_count for all parameters except kernel size, linear update, and particles. 2. when the value of neff increase for each parameter, the average scan matching will increase accordingly, except particles. For the number of particles in the filter, with the large value, has less average scan matching score. Having this map result, we have also the comparison as shown below Table 2, based on the m_count, Neff, and average scan matching score.

(2) optimizing the parameters collectively
In this experiment we undergo the optimization, by taking the parameters collectively. Indeed, this is the better optimization to get the best result to match the standard dataset map. most focusing on the parameters: matching of endpoints, optimal step size of translation and rotation, and indeed on the odometer detail and so on. We undertook four experiments.in the last two experiments we also include the map update interval, which showed us the best results. the values are shown in the table below Table 3. By optimizing the parameters in each experiment, we have the map results below. Based on the above the above experiments Adding the Map update interval shows better improvements in order getting the most out of our experiment. And the effects on of m_count, neff, and the average scan matching score is shown In Table 4.

IV.
CONCLUSION AND FUTURE WORK This paper has presented optimization of Simultaneous Localization and Mapping (SLAM) by conducting Gmapping algorithm. We undertook the optimization based on two ways.

1.optimizing the parameters separately
A. optimizing separately led to only a fraction of changes on the map relative to dataset map. B. We may have a close match or result of the map when we compare each result, although we still optimize separately. for example, when we look at the result after optimizing the sigma value, in which it is important for the matching of endpoints, in some region we may have some resemblance with optimized value or result of kernel size, lstep or number of iterations for scan matching (iterations). C. Whenever we are optimizing separately, it is not mandatory to have the same result or change. because we improve one parameter does not mean we get uniform development. even we may have unimaginable different results.

2.Optimizing parameters collectively
We tried to optimize by selecting some parameters collectively and compare with the touchstone. and conclude that we can decidedly say having optimizing collectively, can get a bring about result relative to the ground truth. Especially the parameters matching of endpoints, optimal step size of translation and rotation, and indeed on the odometer detail. The more we tried to optimize collectively according to our calculation, the better we have the map result of the dataset. Optimizing including the map update interval Map 3 and 4 shows the better result and closer to the ground truth. We can thereby conclude and suggest that optimizing SLAM Gmapping algorithm collectively and including the map update interval gives the best results and will have better improvements if further researches held with parameters. Having this optimization, it is also possible to see in real indoor environment using robot, to be more practical. So, for the future real indoor environment is expected.