# Robot Navigation Based on Human Trajectory Prediction and Multiple Travel Modes
## 2 Methods  
### Human Trajectory Prediction with an Improved Socially Conscious Model  
In the socially conscious model [9], two main factors are considered that affect the pedestrians' walk in the crowd, i.e., relative distance and moving direction based on the basic social-LSTM [8]. The distribution of pedestrians in a certain frame of the video is shown in Figure 1. The socially conscious model is applied to show how the current direction and distance of relative movements between pedestrians will affect the target pedestrian's movement. In the current frame, a target pedestrian, \(p\) (red), is first selected, and then another pedestrian, \(p^{\prime}\) (other colors), is selected. Taking the current positions of the two persons as the origins and taking the displacement of \(p^{\prime}\) relative to \(p\) as the x-axis, two coordinate systems are established to determine the relative motion tendency of \(p^{\prime}\). The coordinate systems divide the plane into eight quadrants, as shown in the right half of Figure 1. Let I, II, III, and IV represent the first, second, third, and fourth  
Figure 1: Distribution of pedestrians at a certain moment. The arrows represent the walking direction of pedestrians, the red color represents the target pedestrian, i.e., pedestrian 1, other colors represent other individuals in the crowd, \(V\) represents the walking speed, and \(d\) represents the distance between pedestrian 1 and pedestrian 2. The right picture shows the relative motion coordinate system of \(p^{\prime}\) to \(p\). quadrants of the coordinate system of \(p\). Algorithm 1 gives a method to determine whether the relative motion direction of \(p^{\prime}\) will affect \(p\), where \(f_{ij}[p,p^{\prime}]\) is a function to indicate whether an influence exists between \(p\) and \(p^{\prime}\). If yes, it is set to \"1\"; otherwise, it is set to \"0\". After completing the judgment of all other pedestrians in the figure, another pedestrian is selected as the target pedestrian. This process is repeated until the relationships of all pairs of pedestrians are judged. ```
1:if\(\theta\)\(\in\)I and \(\theta\) < \(\theta^{\prime}\) < \(180^{\circ}\)then\(f_{ij}[p,p^{\prime}]\) = 1
2:elseif\(\theta\)\(\in\)II and \(\theta\) < \(\theta^{\prime}\) < \(180^{\circ}\)then\(f_{ij}[p,p^{\prime}]\) = 1
3:elseif\(\theta\)\(\in\)III and \(180^{\circ}\) < \(\theta^{\prime}\) < \(\theta\)then\(f_{ij}[p,p^{\prime}]\) = 1
4:elseif\(\theta\)\(\in\)IV and \(180^{\circ}\) < \(\theta\)then\(1_{ij}[p,p^{\prime}]\) = 1
5:else\(1_{ij}[p,p^{\prime}]\) = 0
```  
**Algorithm 1**Jugement of the effect the relative motion direction of \(p^{\prime}\) on \(p\)  
Let \(d\) represent the distance between \(p\) and \(p^{\prime}\), and the influence of the trajectory between \(p\) and \(p^{\prime}\) is inversely proportional to \(d\). The influence among pedestrians in a crowd manifests as a combination of attraction and exclusion. Therefore, we take \(1/d\) as the relative distance influence term in the model. As a result, the socially conscious pooling layer, \(S_{ij}^{t}\), is defined as follows:  
\[S_{ij}^{t}=\varphi\left(\sum_{k\in N}f_{ij}\left[x_{i-direction}^{t},x_{j- direction}^{t}\right]\cdot\frac{1}{d};\;W_{s}\right) \tag{1}\]  
where \(\varphi(\cdot)\) is an embedding function and\(W_{s}\) is the embedding weight. A pooling layer, \(p_{i}^{t}\), is created to take the current pedestrian's historical coordinate sequence as the input according to Equation (2); then, \(p_{i}^{t}\) and \(S_{ij}^{t}\) are concatenated and the result is transferred into LSTM cells according to Equation (3).