# An RSSI-Based Localization, Path Planning and Computer Vision-Based Decision Making Robotic System
## 2 Methodology  
The navigation method should be reliable and accurate in a frequently changing indoor environment. The RSSI-based print technique registers multiple sampling inputs from different wireless local area network nodes. The scanning points collecting the signal quality and the signal strength values based upon signal to noise ratio and data rate, are received. The drawbacks include false localization for small sample size data. The system's pseudo-flow graph is in Algorithm 1. In this proposed system, 60,000 samples per position are collected at the rate of 30 ms/sample through a Raspberry Pi module. At the time as sampling from different positions, the robot also registers the angle and distance for the next and the previous sampling points using 3-axis magnetometer and accelerometer. Here \(P_{s}\) is the respective sampling position, \(P_{e}\) is the estimated position, and DB is the measured RSSI value. The link quality of the wireless data link may depend upon signal interference plus noise ratio (SINR), packet delivery ratio (PDR), and bit error rate (BER). The accuracy depends on the wireless data card manufacturer. In this study, the idle link quality \(Q\) was 70, and so the sampling values were meant to be in the range of 35 to 60. The samples could not be accepted for the database until its link quality was within this range. The robot/modules which collect data waited for link quality improvements. During real-time positioning, the system again collects the data of link quality and RSSI values, which is the input for the prediction model for the estimation of the present position. The robot/module then moves towards the nearest sampling point, again collecting the same information, and predicts the model. If a nearby point adheres to the predicted position, the previous scanning point is considered the correct localized point to calculate the optimum path planning. Here \(n\) is the number of sampled positions; \(r=1,2,\) or 3, are the data collected from individual transmitters. \(\theta_{nn}\) is the angle between corresponding sampling points and \(D_{nn}\) is the corresponding distance. \(P_{e}\) is the estimated position calculated from the classification model. The actual position calculation takes place after the current position estimation, and the robot moves to the nearby positions to estimating their corresponding positions. If the nearby position is not as per the prediction, the system again scans for new data. As the sample size contained more than 1,200,000 samples for 20 nodes (60,000 samples per positions i.e., 30 ms/sample), the decision was made through the prediction and classification models as per fitness scores. For the minimal surrounding environment, error nodes in a triangular fashion are shown in Figure 2.  
```
Data:\(P_{s}\) Result: More than 60,000 sample values per each Position initialization; whileSamplingEndsdo \(P_{s}\); if\(35<q<65\)then  Sample Q, DB;  wait until Q increases; else \(Q_{mr}\leftarrow\) varies, update if \(Q_{mr}>55\); \(D_{Bmr}\leftarrow\) RSSI(dB); \(\theta_{nn}\leftarrow\) Angle of new sampling point; \(D_{nn}\leftarrow\) Distance between respective sampling point;  end if  end while Data: Applying suitable Prediction model on Real-Time Scan Result: Real-time Position Prediction initialization; while\(Q>60\);SampleDBdo \(P_{s}\leftarrow\) Predict Position; if\(45<quality<65\)then  Store \(P_{s}\) else  Predict Again;  end if if(error = \(P_{s}\) - \(P_{e}\));then  Error < 0.5 m, True Position else  Sample Again  end while
```  
**Algorithm 1**Calculate \(P_{n}=>X_{mr},t_{m},Q_{mr},m=1,2,...,>60,000\). The generated database was tested for k nearest neighbors (KNN), random forest (RF), the radial bias function kernel-support vector machine (RBF SVM), and the multi-layer perceptron (MLP) neural network (NN) classification models. The inputs were applied to these models and we calculated fit score with RMS error. The sample data were taken in the classroom and passage area.