In ASLAM, three basic tasks must be combined in an appropriate way: map**, localization, and route planning. Our approach to this issue is summarized in
Figure 5. In the first step, initialization measurements are performed, and then the whole process is executed in a loop. After the measurement, it is necessary to determine the target destination, which the robotic system should explore in the next iteration. The selection of a suitable target area is one of the main points addressed in this article. When the start and finish positions of the robotic system are available, it is possible to apply a path-planning algorithm in the next step. In our case, the A * algorithm is used. The generated path is sent to the mobile robotic system, while the ASLAM algorithm itself no longer interferes with the robot’s movement; it only monitors the current position of the system. The mobile robotic system we used is described in the Hardware section. When moving to the target position, the data are read from the robot’s odometer so that the end of the movement can be evaluated. During the movement of the robot to the target, a time window is created, which can be used to perform other measurements. In order to not overload the whole process with redundant data, we decided to perform the measurement only after reaching a certain distance. A distance 0.5 m proved to be effective in the tests. At the end of the movement, the process from point 2 is repeated until the required number of iterations k is reached. The whole process is summarized in
Figure 6.
4.1. Selecting a Potential Destination for Path Planning
Choosing the right destination when planning a route is a key task in ASLAM. In making this decision, it is necessary to consider the purpose for which the ASLAM is implemented and what areas are a priority for its implementation. As examples, we can mention unexplored areas, areas of irregular shapes, areas with narrow alleys, etc. In our case, we will focus on unexplored areas, while there are no occupied areas near them. The whole process of selecting a suitable target is captured in Algorithm 1. The necessary inputs to this algorithm are the grid map of the surroundings, the current position, and the limited area of our interest.
Algorithm 1: | Target position selection |
Input: | Gridmap, actual position, area of interest |
Output: | Navigation destination |
1. | Generating a matrix of states based on a grid map. |
2. | Searching the state matrix and selecting suitable areas based on a predetermined condition. |
3. | Clustering of appropriate areas (k-means). |
4. | Assigning weight to each area. |
5. | Selecting the goal point with the highest weight. |
A grid map is expected at the input, the cell values of which are given by three numbers (0, free beech; 1, occupied; and −1, unknown). A state matrix is created from this map. This step is followed by a search of the entire matrix and a search for potential destinations for path planning. The following condition must be fulfilled when selecting a potential target:
From this condition follows that in the center of the region of interest there must be a free state (0), and at the same time, all direct neighboring cells must also be equal to zero. If this assumption is fulfilled, a matrix (newmatrix) of size 5 × 5 is created whose center is in coordinates i, j. After this step, another condition is tested, which is:
This condition ensures that values equal to one are searched. This is due to the exclusion of areas where there is an obstacle (wall, object in the room…). At the same time, the sum of all members of the matrix is performed, which must contain at least 1/3 of unknown cells. If this condition is also fulfilled, the coordinates of the center of the area are stored in the variable and this point is considered as a potential point of interest. Depending on the map, we obtain several dozen of such points. The matrix that meets the mentioned conditions looks like this:
For a suitable selection of one specific point, it is necessary to create a weight function that evaluates each point separately. When creating the weight function, we decided to consider two main factors: the distance of the point from the current position and the number of points in the area. To obtain the multiplicity of points in the area, it is necessary to perform clustering. The K-means++ algorithm was used for clustering.
4.2. K-means and K-means++ Algorithm
The K-means algorithm is one of the most widely used algorithms for classifying and clustering data [
20]. Clusters are searched using an iterative method. If we want to express the K-means algorithm mathematically, we must explain some concepts, first. Let
X ⊆
R be the set of entry points and K be the integer number of clusters into which we want to classify our data. At the same time
ci ∈
R represents the i representative point and
C = {
c1,
c2, …,
cK} is the set of representative points with the number of elements K. The set
Zj = {
x ∈
X| arg min ‖
x −
c‖
2 =
cj} is called the cluster for a representative point c
j for j = 1, 2…, K. Data points are expected at the input of the algorithm. X = {x
1,x
2,…,x
n}, where
n represents their number. These data points are represented by (x, y) coordinates. At the same time, the condition that K must not be greater than the entry number of points must apply. Another assumption is the assumption of a unique assignment to the cluster, which tells us that each set C determines the decomposition of the set X into mutually disjoint sets Z
j. Based on these statements, we will try to minimize the cost function of Equation (3)
by selecting a set of representative points C to the data points X, i.e., finding the ideal set of representative points C for a given set X by minimizing the squares of the distances of the individual points x from their representative points c. The effort is to find the optimal decomposition of the set X in terms of minimizing the squares of distances. As we consider the assumption of clear assignment to clusters, a possible cost function from Equation (3) is expressed equivalently using Equation (4):
The K-means algorithm is performed in two iterative steps, while in the second step the new representative points are calculated using Equation (5) [
20]:
The author explains this in more detail in [
21,
22]. The principle of K-means functionality is in
Figure 7.
In the previous description of K-means, we considered the equally random selection of initial representative points c
j. However, this choice is not optimal, as it carries a high probability of incorrect classification. As a result, some assignments may be illogical. An example of this type of classification can be seen in
Figure 8.
Several methods have been developed to solve this problem. In our case, we decided to use the K-means++ algorithm, which we can consider as an extension of the original K-means algorithm. K-means++ was introduced by the author in [
23]. This algorithm retains the original procedure resulting from
Figure 6, with the change being the selection of initial mean values. The points c
j are randomly selected from the set X with a selection probability P(
x) defined in Equation (6):
To apply the described cluster method, it was necessary to enter the quantity of clusters, which we determined hereafter considering the number 7. The result of searching for suitable target points and their distribution into clusters can be seen in
Figure 9.
After clustering, the number of points in individual clusters
was calculated. This gave us the first parameter needed to calculate the weight of the points. This number was attributed to each point. Another parameter needed to calculate the weight is the distance of the point from the current position. The calculation of this parameter is based on the Euclidean distance from Equation (7):
After obtaining the parameters of distance and multiplicity of points in the cluster, it was possible to proceed to the calculation of the weight of individual points. The relationship for the weight calculation is given in Equation (8):
where
is the weight of a point with coordinates
x,
a,
y,
is the number of points located in the corresponding cluster k, and d is the distance of the point from the current position. By the square root of the variable d, we wanted to reduce the effect of distance on the resulting weight. These mentioned parameters are written in a matrix with
n rows and five columns. The line has the form (
x,
y, cluster number, number of points, weight). In the last step, the row with the largest weight is selected and its
x and
y coordinates serve as the destination point of the navigation algorithm. If we want to use the limitation of our area of interest, then before writing the weight in the matrix, we test whether the
x and
y coordinates of the point meet the given interval in which they should be. If they are outside the interval, then the point weight is set to zero. The problem can occur if all points of the matrix have a weight of zero or no point meets the mentioned criteria. In this case, point (0, 0) is set as the destination. The whole process of selecting the next position takes an average of 0.36 s with the dimensions of the grid map 847 × 1057 (row × column). When the search phase of our point of interest is over, we have all the necessary inputs for path planning.
4.4. Comparison and Evaluation of Results
We decided to use the size of the coverage area as a suitable indicator of the success of the proposed algorithm. The author in [
5] chose the approach of the incremental capture of topology–grid hybrid maps (TGHM). From the measurements of the LiDAR sensor, he chose potential targets where the MRS could be navigated. These goals were chosen based on a geometric rule, which the author strictly defines in the source. This rule is based on the boundaries of the map of the current measurement and the range of the LiDAR sensor, while the dimensions of the MRS are also taken into account. The consideration of MRS parameters is used to avoid collisions and to keep the distance from the obstacle, due to the complexity of the measurement. After selecting these points, they search their surroundings with a radius equal to the scanning range of the LiDAR. From this search, a point information gain is obtained based on the number of unknown cells of the
map. In the last step, it assigns to each potential point a topological distance L(T) from the current position T of the robotic system. The function is defined in Equation (9):
where
λ is a positive constant that is used to adjust the weight of the distance against the weight of unknown areas. In the experimental part, the author confirmed the success of his method in the coverage of the environment at 96.62% in the first measurement and 98.3% in the second measurement.
In [
6], the author used a grid map, from which he chose targets based on the fact that the cell can be reached from all directions (
), and at the same time to be able to navigate the robot to this cell, while in its close surroundings is at least one cell unknown. Here a large set of several points is created, which is then clustered using its modification K-means. From a predefined number of clusters, it selects a center of gravity that becomes a new potential target for its navigation. This point will be assigned a weight in the next step based on Equation (10):
where
is a cell with coordinates i and j,
is the weight of the assumed distance to the cell
,
is the current price from the starting cell to the cell
, and
is the estimated cost of the distance from the current cell to the target cell located near cell
.
is the throughput index from start to cell
. Each trip price is determined based on the length calculated from the A * algorithm. Subsequently, the cell with the lowest weight is selected. The author performed an outdoor test on a slo** terrain on an area of 9 × 16 m while crossing a track of 24.4 m and covering 90% of the territory in eight iterations.
If we want to compare our results with the previous two approaches, the success rate is slightly higher, where in the first measurement the area of our interest was on an area of 30 × 2.5 m, which included 2892 cells of the grid map. The number of unmapped cells is 13, which represents a coverage of 99.55%. During the measurement, 13 iterations were performed and the distance of the MRS was approximately 30.3 m. These measurements are shown in
Figure 12 and
Figure 13, where the red border represents the area of our interest, and the blue color represents the unknown areas on the map. The area of our interest did not focus on the whole corridor due to the high occurrence of obstacles and glass walls, which caused noise and inaccuracies in this area. For an idea of this issue, see
Figure 10. However, if we take into account this area, the coverage will represent 98.54% with an area size of 8.8 × 30 m with a cell count of 8742. The results are summarized in
Table 1.