## 4 Methodology
### Real-Time Map Update and Localization  
After detecting various types of objects and determining their locations and boundaries, the results are updated on the 2D map to reflect the current state of the environment during navigation. Due to different impacts on robot navigation, this study maintains a dictionary of objects that groups commonly observed objects into two categories that are long-term objects and transient objects. Long-term objects include objects, such as  
Figure 5: Point cloud isolation and boundary detection for identified objects. Figure 6: PCL pipeline for isolating and determining the location of a door. sofas, doors, and refrigerators, which do not frequently move and confuse the traditional navigation approaches. On the other hand, transient objects are objects, such as humans, which dynamically move frequently but not significantly impact navigation due to their shapes. This study updates geometric information of only long-term objects as their presences can significantly impact navigation for a prolonged period. Transient objects are not directly updated in the navigation map, as commonly used AMCL navigation can avoid objects, such moving persons, while changing navigation routes. The benefit of updating the map with human locations is minimal because their presences do not confuse localization and navigation, such as long-term objects with large surfaces. Though this study presents one case of categorizing objects in common indoor buildings, different ways of object categorization can be suggested for navigations in different types of buildings to utilize semantic information for navigation. In order to perform this task within the software framework, a dedicated, self-contained ROS node was written in C++. This node listens for and acts on messages sent by the object detection and localization routine described in the section above. When an object is detected, the node classifies that node based on the type of object recognized. For long-term objects, the node was designed to automatically insert all such objects directly into the navigation map, whereas a more nuanced version of classification is foreseen for more complicated situations, perhaps using behavior-trees or other higher-level decision capabilities. Transient objects, such as humans, were also identified by the image-recognition software. A classification dictionary is used to determine what action should be taken for each identified object. Because humans are transient, they were determined not to belong as non-structural permanent objects within the navigation map. Each classified long-term object was also saved within a file of identified objects. This file can be used to repopulate an original map from a previous state or simply as a record of all objects identified. Detected objects belong within the navigation map so that at the outset of each surveillance routine, the most up-to-date information is available for route planning, navigation, and localization. The map is continually updated, meaning objects are added and maintained  
Figure 7: Pseudo code identifying doors and insertion into navigation map and BIM. within the map. The entire object is reduced to a 2D footprint represented as a convex hull polygon, as described in the previous section. This convex hull is localized within the coordinate frame of the structure and matched to that of the maps. The map coordinates are iterated over from the upper-left corner to lower-right. Each point (representing a 2D coordinate) is compared to the convex hull to determine if it resides within or outside of the hull. If it resides within the hull, the map point is over-written with a black pixel to indicate that this space is filled, as per the PGM map specification [50]. Alternatively, lighter grey could be used to indicate that this space is not part of the permanent structure so long as the darkness intensity of the pixel is high enough to exceed the threshold for the AMCL navigation routine's value for a filled point.