# New Eldercare Robot with Path-Planning and Fall-Detection Capabilities
## 4 Experimental Testing  
Field testing for the eldercare robot included indoor path planning and real human fall detection. An indoor testing map is prepared for testing that includes static obstacles with different sizes as shown in Figure 10. The robot and the patient positions are also shown in the same figure. The map is roughly 3 m \(\times\) 7.1 m, and the number of static obstacles is 16. The RRT* indoor path planning technique was used for robot navigation.  
RRT is a sampling-based path planning technique that is used for single-query problems [19]. It draws edges by iteratively adding random nodes and uses collision detection method to verify the feasibility of the edges. This algorithm generates a tree of possible trajectories that is rooted at an initial vertex. Normally, it guarantees that the probability of finding a possible path is close to 1 when the number of iterations tends to infinity. RRT* is an optimized version of the RRT technique. It considers the path cost, hence decreasing the time for path generation. The algorithm is explained in Pseudocode 1 and can be summarized as follows (Algorithm 1):  
```
Input:\(q_{I}\), n of nodes, step size \(\alpha\) Output: Tree T = (V, E)  initialize V = {\(q_{S}\)}, E = \(\emptyset\)
```
1.for\(i\) = 0: n do
2.\(q_{i}\)\(\leftarrow\) random sample from C
3.\(q_{near}\)\(\leftarrow\) nearest neighbor of \(q_{i}\) in C
4.\(q_{new}\)\(\leftarrow\)\(q_{near}+\frac{\alpha}{|q_{i}-q_{near}|}\)\((q_{i}-q_{near})\)
5.if\(q_{new}\in\ C_{free}\)thenV \(\leftarrow\) V \(\cup\) {\(q_{new}\)}, E \(\leftarrow\) E \(\cup\) {\(q_{near}\), \(q_{new}\)}
6.endfor ```  
Figure 9: The architecture of the YOLOv7 neural network.  
The experimental robot path and the reconstructed 2D map using Lidar feedback is shown in Figure 11. Robot feedback and control were conducted according to the perception procedures that were previously mentioned in Section 3. The robot actual path has a travel distance = 3.528 \(\times\) 10\({}^{3}\) mm, an average velocity of 0.784 m/s, a travel time of 4.5 s, and a maximum acceleration of 0.174 m/s\({}^{2}\). The final point is varied from the destination point as the mean absolute error point on the x- and y-axes and is  
abnormal, and false negatives (_FN_s) are abnormal behaviors not reported by the system. These parameters are calculated as follows:  
\[\begin{array}{ll}Accuracy&=\frac{TP+TN}{TP+TN+FP+FN}\\ &=(5119+5153)/(5119+5153+51+350)=96\%\\ \\ Precision=\frac{TP}{TP+FP}=5119/(5119+51)=99.1\%\\ \\ Recall=\frac{TP}{TP+FN}=5119/(5119+350)=93.6\%\\ \\ F-score=2\times\frac{Recall\times Precision}{Recall+Precision}=96\%\\ \\ True negative rate=\frac{TN}{TN+FP}=99\%\end{array} \tag{4}\]  
The experimental results of the prediction model are shown in Figure 12. The figure is divided into two rows, the first indicates the training results in addition to its precision and recall, while the second indicates the validation results in addition to its precision and recall. Three types of loss are shown in this figure: box loss, objectness loss, and categorization loss. The box loss shows the algorithm's ability to locate the object center and estimate its bounding box. The objectness metric quantifies how likely it is that an object can be found in a given area. High objectivity suggests that it is likely that an object lies inside the visible region of an image. On the other hand, classification loss indicates the accuracy with which an algorithm can determine the right class of an object. All these results are obtained during 0-250 iterations. The accuracy, precision, recall, F-score, and true negative rate parameters were found to be 96%, 99.1%, 93.5%, 96.2%, and 99%, respectively. The confusion matrix for the prediction model is shown in Figure 13, while the real images for the experiment are shown in Figure 14.