# Cognitive Model of the Closed Environment of a Mobile Robot Based on Measurements
## 5 Cognitive Mechatronic System Design
### System Software Development
#### 5.3.5 Cognitive Environment Model Map Construction  
Based on the kinematics model of the mobile robot presented in Section 3 it is possible to construct algorithm for the cognitive map of a mobile robot's environment. Defined algorithm is used for constructing cognitive map of an unknown environment where robot is placed for exploring. The cognitive map of the mobile robot's closed environment based on measurements is constructed, and it is the only part of an entire cognitive model of the closed environment. The information about the environment obtained from the cognitive map is base for planning an optimal mobile robot's motion path. A high level of the environment information, close to human perception abilities, are established using the obtained cognitive map. The first hypothesis of the main contributions of the proposed research was proven. At the end of a mobile robot's exploration process, a list of cognitive information about the environment is established. The polygon's configuration is obtained using that list of information, from a room's entrance (polygon starting point) to the relative point in which robot achieved good enough exploration score. The fusion of the LiDAR and integrated motor control signal information was used for the cognitive map construction, as shown in Figure 22a. Map of an unknown environment is constructed without any pre-defined real-world information, i.e., an environment has not been previously known to the robot. The cognitive map of environment is constructed from the results presented in Figure 22b-d. These intermediate result obtained by fusion of readings from robots LiDAR and odometry are passed to another pattern search algorithm that finds objects and positions of their centroids. The positions of the centroids are then classified according to regions shown in Figure 22e. Detected objects have to be classified according to their geometrical features. For this classification, a simple algorithm is designed. Using OpenCV functions on the intermediate results from Figure 22d the bounding boxes are formed around any detected object and surface area of the object is measured. Classification is achieved by the comparison of bounding box surface area \(\mathrm{A_{bb}}\) and surface area of the object \(\mathrm{A_{obj}}\). The ratio of surface areas of the bounding box and object for each object used in the experiment are presented in Table 1.  
Figure 21: Vision system for path verification: (**a**) camera’s position above the polygon; (**b**) position and orientation of the absolute coordinate system; (**c**) mobile robot’s path drawn on the image captured by the camera. Due to noise in the sensor measurements, the objects are classified using presented ratio ranges. If mentioned ratio falls outside all ranges, the object is classified as \"unknown\". After the classification, a cognitive map of closed environment is produced. The cognitive map is presented by the literal explanation of the object positions in the explored space, e.g., \"Blue triangle SW\" or \"Green circle south center\". The results are shown in Figure 22e. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Object** & **Triangle** & **Circle** & **Square** & **L Polygon** & **Round Polygon** \\ \hline
**Abb/Aobj** & 2 & 4/\(\pi\) & 1 & 9/5 & 18/(14–\(\pi\)) \\ \hline
**Ratio range** & 1.9–2.1 & 1.15–1.4 & 0.9–1.1 & 1.7–1.85 & 1.5–1.67 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Surface area ratio used for object classification. Figure 22: Environment cognitive model map: (**a**) selected polygon configuration; (**b**) map of the polygon obtained by simulation; (**c**) real-world experiment on the real polygon with tracked robot’s motion path; (**d**) closed space map obtained by fusion of robot sensors readings, base for building of cognitive map; (**e**) interpretation of the obtained (by mobile robot’s ability for cognitive exploration) high-level information about a previously unknown environment.