Autonomously Simultaneous Localization and Mapping Based on Line Tracking in a Factory-Like Environment

This study is related to SLAM, also known simultaneous localization and mapping which is highly important and an indispensable issue for autonomous mobile robots. Both an environment mapping and an agent’s localization are provided with SLAM systems. However, while performing SLAM for an unknown environment, the robot is navigated by three different ways: a user guidance, random movements on an exploration mode or exploration algorithms. A user guidance or random exploration methods have some drawbacks that a user may not be able to observe the agent or random process may take a long time. In order to answer these problems, it is searched for a new and autonomous exploration algorithm for SLAM systems. In this manner, a new kind of left-orientated autonomous exploration algorithm for SLAM systems has been improved. To show the algorithm effectiveness, a factorylike environment is made up on the ROS (Robot Operating System) platform and navigation of the agent is observed. The result of the study demonstrates that it is possible to perform SLAM autonomously in any similar environment without the need of the user interference.


Introduction
It is a well-known fact that robotic applications have been increasing day after day and robots have performed an assistance to human from health to indus-trial applications [8], [12], [14], [18] and [28].In order for a robot to be able to fulfil a task, it has to know its location and what the world looks like around it.It is agreed that the problem of where the robot is seen as a localization problem.Moreover, the problem of constructing a map of the environment is specified as a mapping one [3] and [25].Despite the fact that these two issues tackle separately, it may be impossible to give the robot neither location nor map in some cases.Therefore, it is necessary to build a map of an environment while simultaneously localize the robot within this map for such situations.When the literature is scrutinized, it can be seen that this problem is called as simultaneous localization and mapping or acronym of it SLAM [6].SLAM deals with a construction of a map of an environment in which concurrently localize itself within it.Due to the fact that it could gain an autonomy to the robot, SLAM has been seen a 'holy grail' [6] and, it is an important milestone for the mobile robotic applications.From this point of view, a mobile robot is able to have an information about where it is or where to go by courtesy of SLAM.
Many algorithms have been presented about SLAM from the 2-D maps and metrics maps to 3D or topologic ones, from the filter based approaches to the visionbased ones [1], [11], [19], [28] and [30].According to the related previous studies, a guidance of robots in an unknown environment could be done in three different ways: • The first one is a user navigation and it can be thought an ideal and the most efficient solution due to the fact that it is based on human observation.By way of this method, the robot can be navigated to an unmapped area.One of the limitations of this method is that it is not explicit what happens if the user is not able to observe the robot or the exploration area.
• The second guidance method is the random exploration method.The robot is allowed to run in an exploration mode so that the robot might explore the area moving random orientation and movement.A critical weakness of this method, however, is that it takes a long time to discover all over the area [14], [21], [22], [24] and [29].
• The third method is the special algorithms for autonomous navigation and exploration.When these types of algorithms are combined with SLAM, it is usually called active SLAM approach which ensures the full autonomy for the mobile robot.These approaches generally are benefited from occupancy grid maps.The environment is split into grids and the robot is navigated to the unexplored regions [13], [24] and [31].
The first two methods suffer from some serious disadvantages as mentioned above while the algorithms under the third section generally count on the laser measurements.In this context, the presented study can be discussed under the third class of active SLAM algorithms.Our enhanced approach differs from the existed algorithms because it is image-based instead of laser scanning.

Simultaneous Localization and Mapping (SLAM)
The first serious discussions and analyses of SLAM have emerged during the late 1980s.The idea of gathering probability and robotics were the heart of the matter [5] and [23].There has been notable progress on the solution of the problem after then implementation of Bayes based filters such as Kalman Filter (KF) for linear systems and Extended Kalman Filter (EKF) for non-linear ones [8], [24] and [26].
SLAM is mathematically described in the form of probability in which sensor and control data of the robot are inputs; a map and a pose of the robot are outputs Eq. (1) [6], [8], [21] and [22]: where m is a map created with the algorithm and x is pose information of the robot.These two terms also stand for global state parameters of SLAM.On the other hand, z is identified as sensor observations and u is robot control inputs.At the first stage of EKF-SLAM, the state is predicted considering the robot previous state and the control input.At the latter phase, the prediction has been updated by using sensor observations.
However, traditional EKF method suffers from the non-Gaussian noise cases and a big size covariance matrix if the number of landmarks is relatively high [3], [4] and [6].Because of some downsides of EKF-SLAM, new methods have been improved.The most striking development at this point was the implementation of Particle Filters (PF) to SLAM problem.However, PF also suffers from a big size covariance matrix due to the fact that each particle represents the individual solution.To overcome this problem, the remarkable solution was the implementation of Rao-Blackwellization decomposition method along with the PF.This method is also called FastSLAM.By means of this decomposition, SLAM problem has turned into a classical Monte Carlo Localization (MCL) of the robots and traditional EKF mapping Eq. ( 2) [1], [9], [15], [16] and [21]: ( Assuming to landmark locations independent, localization and mapping can be handled separately.Thanks to this trick, it is computed M times 2 by 2 matrix instead of tackling with the big size of M by M covariance matrix facing on conventional EKF.With this development, computation speed of the algorithm has been notably increased and non-Gaussian distribution representation of the model has been developed.Considering from this point of view, each particle has its belief on the potential solution (map and pose of a robot).The particles have been updated in every iteration when the environment is observed.

Implemented System
A factory-like environment has been made up to demonstrate the effectiveness of the improved autonomous algorithm.The lines used to separate the sections from each other are considered to form the working environment (Fig. 1).A pure line follower algorithm is highly likely to produce unstable results considering the robot has to turn when faced rotation points or the endpoint of the lines.In order to get over this problem, a left-orientated follower algorithm has been developed and the movements of the robot have been provided within this framework.

Evaluation of Images
The robot takes an image (Fig. 2(a)) of the environment via a camera mounted on it.With these images, the navigation path of the robot can be determined by means of image processing algorithms.
The images taken from the camera of the robot are being processed continuously.During this period, several types of images have been produced like HSV and masked ones (Fig. 2 and Fig. 3).Segmented images are used to determine the foreground path.
First of all, images are transformed into HSV images.The aim of this transformation is to provide a more reliable result on the evaluation of the images because of the fact that HSV images are more robust on the change of brightness, shadow effects etc.Otherwise, the areas covered shadows might be misidentified (Fig. 3(b)).
After applying HSV transformation to the image, a novel approach has been thought due to the fact that the assessing of the whole image both will be difficult and increase the computational time.To this end, the image is divided into three sub-regions, x 1 , x 2 , x 3 .x 1 and x 3 parts are multiplied by 0 to exclude the irrelevant regions.Only the region x 2 is let alone and decisions are made based on that region.In this way, only the region to be tracked are extracted from the whole image and the robot is manipulated to the true path.The value of the regions has been calculated by empirically after examining some trials.For this study, the values of the parameters have been computed like 4 and Fig. 5) where h is the height of the image, while w is the width of it.
In addition to this, it is needed to use another masked image to determine the left orientation.And therefore, some right part of the original masked image (w − x 4 ) is also covered with zero so that the left orientation can be decided by means of the difference on image moments (Fig. 5 and Subsec.3.3.).

The Robot, Sensor and Movement of the Robot
Turtlebot II, which is also known as Kobuki Turtlebot is used to verify the demonstration of the study.This robot is widely accepted and used in academic experiments.It has linear movement in the direction of +x/ − x and radial rotation on the +z/ − z.This robot is preferred to carry out the studies because of the fact that it is cheaper, enabled to assemble a variety of sensors and allowed to use open source material to control [7].The robot is utilized from a differential drive to steer and detailed analyzing about its kinematic and movement equations are given on Cook [2].The robot generally comes together with an integrated camera, which is usually Asus Xtion or Microsoft Kinect also used in this study.The Kinect is able to give depth data as well as RGB one.
It could perform the scanning of an environment via infrared lights on 57 horizontal and 43 vertical degrees.The depth information given sensor is generally accepted reliable up to 5 meters.The different application of robotics has been widely benefited from this sensor because of its cheapness and presenting valuable data, especially in depth since its firstly announcing in 2010.The depth information obtained from the workspace can be converted to a 2 dimension (2-D) laser data.In order to this, the depth information is obtained and smoothed by means of different filters and a single horizontal line excided from the measurement data.Thus, a robot is able to behave like having a 2-D laser scanner on it [29].Taking into account the bulky structure and expensiveness of laser sensors, this kind of sensors gives a good opportunity on 2-D scanning particularly if the edge determination or similar implementations of an environment is mainly aimed.A comparative work can be seen on [17] about the usage of Kinect -like a laser sensor.
According to the presented left-orientated algorithm, we have manipulated the robot generally in three directions; forward movement and left or reverse turns.
First: Without any orientation decision, the robot goes forward at a rate of 0.2 m•s −1 and fits the line by means of P-controller considering the deviation from the line center.
Second: Giving a decision on left-orientation, the robot turns left 90 degrees.In this case, forward speed is 0 m•s −1 while the robot turns fully 90 degrees in the direction of left.
Third: While the robot follows the line, it may encounter the parts that the line finishes.Under these circumstances, the forward speed of the robot is set to 0 m•s −1 and it turns reverse or 180 degrees.
With the help of these three movements, the robot could be manipulated autonomously with regard to the offered algorithm.

System Algorithm
Active SLAM is a combination of SLAM and autonomous exploration algorithms.With the presence of the developed algorithm, the robot does not need to navigate by a user or move randomly and SLAM for a given environment could be done autonomously by means of improved left-orientated line follower algorithm.Assuming the robot is started somewhere in the environment, the robot first investigates the existence of line and if there is, it goes forward according to the forward motion.The forward motion continues until any rotation.Having a rotation, the robot asks for it is left or right and then a different type of processes are developed in accordance with the offered algorithm (Fig. 6).
The image moments are thought of as features to determine orientation way or the function of what to do.An image moment is obtained in regard to the investigation of the density function of image pixels.A general physical moment expression can be described in Eq. ( 3): where S is the domain of workspace, i and j are the degrees of the function of f [15], [20] and [27].
The general moment statement is described for computer vision in Eq. ( 4) (continues case): x i y j I(x, y)dxdy, (4) where R(t) is the observed area by a camera, m ij is the origin moments and I(x, y) is intensity function.(c) HSV masked view, the robot path is defined correctly.Weight the particles using the equation Replace the particles having lower to the higher ones resampling  The centered moments of order i + j as regards the centroid of the object is expressed by Eq. ( 5): where, c x = m 10 /m 00 , c y = m 01 /m 00 are the centroids of the 2-D object, (c x , c y ).For the discrete case, the integrals have been replaced by summations.
The line center is determined using the abovementioned equations from the masked images (Fig. 4 and Fig. 5).This center is updated as the image is renewed.The deviation from this line center could be thought of an error Eq. ( 6): where, c x is the image center on x-direction and c i is the center of the line.The computed error is applied to the robot to correct the drift from the line.This scheme can also be regarded as a P-controller structure owing to the non-existence of neither past error nor predicted one.The experiments are also tested with the PID controller.However, it is observed that a P-controller body is sufficient for following the line smoothly [27].
It is benefited from ROS (Robot Operating System) to implement the study.ROS is a widely accepted and used framework because it can support the representation of the many real-time parameters.ROS-gMapping package is used to build a map of the environment and localize the robot within it [7], [9], [10], [13] and [32].This method is a kind of grid-based SLAM that uses the Rao-Blackwellizied particle filter.Particles hold the location of the robot and the map of the environment.Getting new observations lead to updated states in every iteration.A scan matching method is used for a measure of distance.According to technique, the robot location is calculated using the matching of sequential observations (see Alg. 1).The output of this method is the occupancy grid mapping of the environment.The algorithm mentioned in the study generally consists of two main blocks that one of them is the executing SLAM and another one is the navigation the robot autonomously.The pseudo-code of the algorithm is as in Alg. 1.

Results
In this study, a factory-like environment has created to carry out SLAM autonomously and to investigate the mentioned algorithm effectiveness.For this purpose, it is desired the robot to start a point referred in the map and followed the line in accordance with the offered algorithm.During the autonomous run, the robot has performed four main actions: find line, left, reverse, forward.
The frequency of the seen actions is pointed out in Fig. 7 as in the form of a histogram.As it is expected, the main action for the robot is the forward movements while the less one is "find line".This result also shows that when the robot finds the path, it sticks to the developed algorithm.According to the result of the trials, the robot can successfully build the map of the environment autonomously and robustly via the improved algorithm free from the effects of brightness, shadow etc. Figure 8 shows the map of the environment using the method and Fig. 9 points out the map created by user observed navigation.

Conclusion
This paper has investigated an autonomous SLAM approach.SLAM is a highly important issue for mobile robots to implement their duties.A mapping of an environment might be done by user guidelines, random exploration or systematic algorithms.However, the first two mentioned methods suffer from some serious limitations such as the absence of a user or not suitable observations for the user.In addition to this, randomly exploration could lead to a loss of time.
As to our knowledge, there is no comprehensive overview of recent research of vision-based for active SLAM.This study is designed to fill this gap by presenting a left-orientated navigation algorithm.Within this scope, a map of the environment has been built autonomously via the presented method without any necessity of user input or random process.In order to validate the presented method results, a factory-like environment is made up.The environment has the lines which describe the individual parts in a factory.The robot can manage to build a map of the environment by way of the mentioned algorithm.The evidence from the study indicates that the robot is able to succeed autonomous SLAM without a need of an external intervention.With the help of this method, a created map done by one robot can easily be shared with the other robots to save time or collaborate with each other.
This study has thrown up some questions in need of further investigation.For example, a future study investigating on different decision process using artificial intelligence would be very interesting and might improve the decision operation.On the other hand, further research might combine the other types of SLAM methods with this presented algorithm.

Fig. 7 :
Fig. 7: The histogram bar graphic of the movements during the experiment.