Considering the low indoor positioning accuracy and poor positioning stability of traditional machine-learning algorithms, an indoor-fingerprint-positioning algorithm based on weighted k-nearest neighbors (WKNN) and extreme gradient boosting (XGBoost) was proposed in this study. Firstly, the outliers in the dataset of established fingerprints were removed by Gaussian filtering to enhance the data reliability. Secondly, the sample set was divided into a training set and a test set, followed by modeling using the XGBoost algorithm with the received signal strength data at each access point (AP) in the training set as the feature, and the coordinates as the label. Meanwhile, such parameters as the learning rate in the XGBoost algorithm were dynamically adjusted via the genetic algorithm (GA), and the optimal value was searched based on a fitness function. Then, the nearest neighbor set searched by the WKNN algorithm was introduced into the XGBoost model, and the final predicted coordinates were acquired after weighted fusion. As indicated in the experimental results, the average positioning error of the proposed algorithm is 1.22 m, which is 20.26–45.58% lower than that of traditional indoor positioning algorithms. In addition, the cumulative distribution function (CDF) curve can converge faster, reflecting better positioning performance.
A Rapid-exploration Random Tree (RRT) autonomous detection algorithm based on the multi-guide-node deflection strategy and Karto Simultaneous Localization and Mapping (SLAM) algorithm was proposed to solve the problems of low efficiency of detecting frontier boundary points and drift distortion in the process of map building in the traditional RRT algorithm in the autonomous detection strategy of mobile robot. Firstly, an RRT global frontier boundary point detection algorithm based on the multi-guide-node deflection strategy was put forward, which introduces the reference value of guide nodes’ deflection probability into the random sampling function so that the global search tree can detect frontier boundary points towards the guide nodes according to random probability. After that, a new autonomous detection algorithm for mobile robots was proposed by combining the graph optimization-based Karto SLAM algorithm with the previously improved RRT algorithm. The algorithm simulation platform based on the Gazebo platform was built. The simulation results show that compared with the traditional RRT algorithm, the proposed RRT autonomous detection algorithm can effectively reduce the time of autonomous detection, plan the length of detection trajectory under the condition of high average detection coverage, and complete the task of autonomous detection mapping more efficiently. Finally, with the help of the ROS-based mobile robot experimental platform, the performance of the proposed algorithm was verified in the real environment of different obstacles. The experimental results show that in the actual environment of simple and complex obstacles, the proposed RRT autonomous detection algorithm was superior to the traditional RRT autonomous detection algorithm in the time of detection, length of detection trajectory, and average coverage, thus improving the efficiency and accuracy of autonomous detection.