# Robot Navigation Based on Human Trajectory Prediction and Multiple Travel Modes
## 2 Methods
### Trajectory Detection and Optimization Based on Predicted Pedestrians' Positions
#### 2.2.2 Trajectory Chasing Cost Judgment  
Pedestrian movements are complex and there may be other pedestrians nearby. The trajectories of distinctive topologies crossing pedestrians who walk with different velocities and spaces to each other change with the movements. Since the robot cannot run too fast in a crowd for safety reasons, if crossing a highly moving crowd, the robot may spend a great amount of energy chasing pedestrians while becoming farther away from the goal position. In order to avoid this situation of continuous energy consumption, we propose a new concept named chasing cost and take it into account in the optimal trajectory selection. For convenience of description, we represent the topology in front of \(p_{i}\) as \(G_{j}(p_{i})\), and the topology behind \(p_{i}\) as \(G_{b}(p_{i})\), and let the robot detect a sector area with a radius of 3 m and a circumferential angle of \(90^{\circ}\) in front of the robot during navigation. Figure 4 shows the calculation of the trajectory chasing cost in \(G_{j}(p_{i})\) with different velocities. \(L\) is the straight line connecting the current position of the robot, \(z_{s}\), with the goal point. The following judgment criteria are proposed to evaluate the chasing cost of trajectories in \(G_{j}(p_{i})\) and \(G_{b}(p_{i})\):  
Figure 3: The movements of pedestrians cause the optimal local trajectories of the relevant topology to change: (**a**) The optimal local trajectories before the movements; (**b**) the optimal local trajectories after the movements, boxes in green and red are the robot’s initial position and goal position, respectively; the trajectories in green and grey are globally optimal trajectories and candidate local trajectories, respectively. Assume the robot runs with a maximal velocity of 2 m/s, and, when navigating in crowds, its averaged velocity is in the interval [0.5 m/s, 1.2 m/s]. 1. If the pedestrian's walking speed, \(v_{pi}>1.2\) m/s, the robot will have difficulty to catch up with \(p_{i}\). It is judged as follows (as shown in Figure 4a): The predicted trajectory of \(p_{i}\) is extended by 0.7m (safe separation) and intersects with \(L\) at point \(O_{i}\), and the distance between \(O_{i}\) and \(z_{s}\) is \(d_{ri}\). The robot is assumed to follow \(L\) at a speed of 1.2 m/s. If the robot arrives at \(O_{i}\) before \(p_{i}\) (as in Equation (8)), the trajectory of \(G_{f}(p_{i})\) can be chosen. 2. If \(v_{pi}\in\) [0.5 m/s, 1.2 m/s], the robot is able to catch up with \(p_{i}\) and the judgement method is as follows (as shown in Figure 4b): The robot is assumed to catch up at a speed of 1.2 m/s along with \(L^{\prime}\) at the angle of \(\pi/4\) from \(L\), which is along its detection area edge and is the worst case for chasing; similar to the previous method, if the robot catches up successfully (as in Equation (9)), the trajectory of \(G_{f}(p_{i})\) can be chosen. 3. If \(v_{pi}<0.5\) m/s, the robot will be sure to catch up with \(p_{i}\) and any trajectory of \(G_{f}(p_{i})\) can be chosen. If the above conditions are not met, it is confirmed that the chasing cost of the trajectory of \(G_{f}(p_{i})\) is too high, and the trajectory of \(G_{f}(p_{i})\) is unfeasible, then go to the step of judging the trajectory chasing cost of \(G_{b}(p_{i})\):  
1. If there is a pedestrian, \(p_{i}\), walking towards \(L\) behind \(p_{i}\) in the robot's detection area, and the trajectory of \(G_{b}(p_{i})\) is also of \(G_{f}(p_{j})\), then the trajectory chasing cost of \(G_{f}(p_{i})\) is judged according to the above method. If it is successful, the trajectory of \(G_{b}(p_{i})\) can be chosen; if not, it is confirmed that the trajectory chasing cost of \(G_{f}(p_{j})\) is too high, and the trajectory of \(G_{f}(p_{j})\) is unfeasible, then go to the step of judging the trajectory chasing cost of \(G_{b}(p_{j})\). 2. If there is no such pedestrian behind \(p_{i}\), the trajectory of \(G_{b}(p_{i})\) can be chosen.