{'fraction_non_alphanumeric': 0.035736857224935366, 'fraction_numerical': 0.01350186727951738, 'mean_word_length': 4.32359688025692, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Pedestrian Avoidance Method Considering Personal Space for a Guide Robot

: Many methods have been proposed for avoiding obstacles in robotic systems. However, a robotic system that moves without colliding with obstacles and people, while still being mentally safe to the persons nearby, has not yet been realized. In this paper, we describe the development of a method for a mobile robot to avoid a pedestrian approaching from the front and to pass him/her by while preserving the “public distance” of personal space. We assume a robot that moves along a prerecorded path. When the robot detects a pedestrian using a laser range ﬁnder (LRF), it calculates the trajectory to avoid the pedestrian considering their personal space, passes by the pedestrian, and returns to the original trajectory. We introduce a virtual target to control the robot moving along the path, such that it can use the same control strategy as for human-following behavior. We carry out experiments to evaluate the method along three routes, in which the robot functioned without problems. The distance between the robot and the pedestrian was 9.3 m, on average, when the robot started to use avoiding behavior, which is large enough to keep a public distance from a pedestrian. When the robot passed by the pedestrian, the minimum distance between them was 1.19 m, which was large enough for passing safely.


Introduction
Much effort has been carried out for developing mobile robots that move around humans and support our daily life. These robots are designed with the intention to help people, either in a home environment [1] or in a public space (e.g., a shopping mall) [2]. When a robot moves around humans, the most important requirement is safety for the humans. Thus, there have been a huge number of studies into collision-free robot navigation [3][4][5][6]. Not only is avoiding collision with humans essential, but it is also important to avoid frightening people or making them uncomfortable.
In a human-human relationship, it is said that people consider "personal space" [7] when staying a proper distance away from other people. The literature has pointed out that there are four kinds of interpersonal distances: intimate, personal, social, and public distances [8]. The public distance is a distance between people with no social relationship, with a typical length of 3.5-10 m [8]. Thus, several studies have considered how to navigate a robot while considering personal space [9][10][11][12].
The robot should keep several meters away from the nearest person, in order to consider the public distance. We believe that it is also crucial, in addition to keeping a public distance from people, for a robot to express that the robot's "intention" is to keep the public distance, such that the pedestrians do not feel anxious about the robot. Figure 1 depicts such a situation. Conventional obstacle-and pedestrian-avoiding methods initiate the avoidance of a pedestrian when the robot is about to collide with the person, as shown in Figure 1a. However, it is desirable for the robot to start avoiding the pedestrian from a distance, to demonstrate to the person nearby that the robot recognizes the oncoming pedestrian and is ready to avoid him/her, as shown in Figure 1b. (a) Avoid a person just before the person (b) Avoid a person keeping public distance We have been developing a mobile robot, ASAHI [13], which is designed to move around humans and support their daily lives. As it is designed to coexist with humans, it should be not only physically but also mentally safe to the surrounding persons. Thus, we developed the navigation methods of ASAHI while considering personal space.
We consider a situation where the user teaches the robot the path to follow beforehand, after which the robot moves along the learned path [14][15][16][17]. The robot is designed to move around an indoor environment, such as rooms and corridors, as a service robot, in order to fulfill several navigation tasks, such as those presented in RoboCup@Home [18,19]. Various environments could be considered for indoor service robots. In this paper, we considered an environment that is typically assumed in RoboCup@Home [18], where there are two or three rooms with furniture and a corridor, along with several places of interest (POIs) for a robot to visit. First, a human supervisor brings the robot through the environment and teaches the robot where the POIs are. Figure 2 depicts the scenario under consideration. As shown in Figure 2a, the robot follows the supervisor and remembers the POIs [15]. In this process, the robot remembers the path and the POIs as points on the remembered path (the waypoints). Figure 2b shows the memorized path, expressed as a set of waypoints. The robot samples waypoints on the trajectory while following the supervisor. In the experiment, the interwaypoint length was 740 mm, considering the footstep length of a human [15]. After remembering the paths, the robot autonomously guides a person by moving along a memorized path to visit a specified place. While guiding a person, the robot observes the distance to the guided person and, if the distance becomes large, the robot stops to wait for the person.  When a robot moves along a corridor, the robot can keep a public distance from an oncoming person [20]. Thus, we focus on a scene, such as moving along a corridor, where several pedestrians are walking. If we employ a pedestrian-avoiding method based on local information, the robot avoids an oncoming person just before colliding with the person (see Figure 1a). However, considering a public distance, the robot begins avoiding the person while the robot is far from them (Figure 1b), in order to express to the pedestrian that the robot recognizes them and is trying to keep a public distance from him/her.
We consider the following requirements to achieve the tasks of visiting several POIs by moving through corridors and rooms and keeping a public distance from a pedestrian: (A) The robot should avoid a pedestrian, considering the public distance for mental safety; (B) The robot should avoid obstacles, based on local information; (C) The robot should move along the taught path to visit POIs, while avoiding obstacles and pedestrians.
The method proposed by Shiomi et al. [21] realized (A) and (B); Tsukuba Challange [22] aimed to develop a robot that realizes (B) and (C). However, to our knowledge, there has been no study carried out that fulfills the above three requirements.
In this paper, we develop a pedestrian avoidance method for a mobile robot. The proposed method enables the robot to avoid an oncoming pedestrian from a distance while keeping a public distance from the pedestrian. At the same time, we can combine the proposed method with an obstacle avoidance method based on local information, which enables the robot to keep a distance from the pedestrian while avoiding small obstacles in front of the robot.
The paper is organized as follows. We review the related papers in Section 2. In Section 3, we describe the proposed pedestrian avoidance method. The setup and results of the evaluation experiment are described in Section 4. In Section 5, we conclude the paper.

Pedestrian Avoidance for Collision-Free Robot Navigation
There have been a vast number of studies into collision-free robot navigation [3][4][5][6]23]. As the survey by Hoy et al. [5] pointed out, most collision-free navigation methods have been formalized as an optimization problem, which finds the best path that minimizes a predefined criterion, such as minimum potential [24]. However, if a robot employs an obstacle avoidance method based on local information, such as the potential field method [24] or the dynamic window approach [25], the robot will only avoid the pedestrian by a small margin, such as the situation depicted in Figure 1a. Therefore, we need to develop another method that enables a robot to avoid an oncoming pedestrian from several meters away, even when he/she is too far to collide.

Robot Navigation Considering the Social Distance
Paccierotti et al. [20] evaluated the proper distance between a robot and a person when the robot passes by. According to their result, it is desirable for the robot to keep more than 3.5 m away from the pedestrian, as shown in Figure 1b. Thus, a number of methods for navigating a robot considering the social distance from humans have been presented [11,21,[26][27][28][29][30].
One idea for a robot to keep the public distance is to incorporate the social distance into the optimization constraints [11]. For example, to enable avoiding oncoming pedestrians using the potential field, Hoshino and Maki proposed an anisotropic potential considering the movement direction and speed [31]. They used a potential field based on the von Mises distribution, such that the potential became higher in front of the pedestrian, and the level of the potential changed based on the movement speed of the pedestrian. Similarly, Papadakis et al. [32] proposed a method to express a nonuniform social distance using a potential in a situation where a few people are talking to each other. In principle, it is possible to use such an anisotropic potential where the social force affects a few meters. However, in our situation-where a robot and a pedestrian are almost ten meters away-it is not adequate to use such a potential, because the potential at the robot's position fluctuates significantly according to a slight estimation error of the movement direction of the pedestrian. Figure 3 shows this situation. Figure 3a shows the potential field generated by the von Mises distribution [31], such that the potential reaches 9 m in distance and does not block the side of the pedestrian. From this figure, we can see that a small fluctuation of the pedestrian's movement direction (±2.5 deg, in this case) causes a large change of the potential at a distant point. Figure 3b shows a possible case of fluctuation in the robot's path. Even a slight change or estimation error of the pedestrian's moving path causes the robot to make a zig-zag motion.
This example shows that we want to move a robot based on two different motivations: first, to avoid people or obstacles, such that the obstacles and the robot do not collide; and, second, to avoid a pedestrian from a distance, such that the robot shows the person that the robot intends to keep a social distance from him/her. These two motivations are different, which is why it is difficult to treat them using a single kind of potential. The social force model, proposed in [21], can avoid a pedestrian from 8 m away. However, since this method uses a model of a human, if the pedestrian behaves differently from the prediction of a model (such as stopping suddenly), the method may fail to avoid the pedestrian. Furthermore, the model in this method assumes that the pedestrian is aware of the robot and will try to keep a maximum distance when the robot passes by the pedestrian. Figure 4 shows the difference between the proposed method and the social force model. Comparing Figure 4a,b, the proposed method (a) is safer than (b), as a pedestrian can be aware of the robot's intention to avoid him/her.   A robot needs to discriminate between a human and a nonhuman object, to avoid pedestrians and other obstacles differently. The method proposed by Shiomi et al. [21] does not consider a situation where there are pedestrians and other objects. The methods that consider the tasks (B) and (C) described in the introduction focus on global path planning and obstacle avoidance based on local information. For example, in the method presented by Aotani et al. [33], path planning is formulated as an optimization problem which only considers how to avoid collisions.
Our method uses a human detection and tracking method [15] to locate the pedestrians which are to be avoided. Objects other than the detected pedestrian (including both humans and nonhuman objects) are avoided using local information.
Some studies have used deep learning to design the social behavior of a robot when avoiding pedestrians [27,28,30]. The purpose of those works was to imitate the natural human behavior of avoiding other people. For example, Kim et al. [27] developed a system based on machine learning, which was trained using the human behavior of when a human noticed a robot and avoided it. However, a human near a robot is not necessarily aware of the robot's avoidance behavior, as the robot does not express the intention of the behavior like humans do. On the other hand, the purpose of our work is to design the robot's behavior, such that the robot does not threaten other pedestrians, which is the same motivation as the "preliminary announcement" of the behavior [34].
To realize a robot that achieves the three requirements (A), (B), and (C), described in Section 1, we combined (A) a human detection and tracking method [15] for detecting the pedestrian to avoid from a distance; (B) an obstacle-avoidance method based on local information [23]; and (C) waypoint-following using the same algorithm as the human-following method [15].

Overview
As shown in Figure 2, the robot remembers a path as a set of waypoints and visits the waypoints to move along the path. Thus, if the robot needs to avoid a pedestrian or an obstacle, the robot moves out of the path and returns to the path after passing the pedestrian. Figure 5 shows the situation of moving along waypoints while avoiding a pedestrian and an obstacle. (1) The robot first follows the memorized waypoint using a similar method to the human-following method. We set a "virtual target" in front of the robot, and the robot follows the virtual target as if the virtual target were a human. (2) If the robot finds an oncoming pedestrian in the human detection area (the yellow part, 3.5-10 m front of the robot), the robot moves the waypoints aside to avoid the pedestrian (the red dashed line). After passing by the pedestrian, the robot returns the waypoints to the original path. (3) When a robot finds an obstacle (a nonhuman object or a human nearer than the human detection area), the robot immediately moves to avoid the obstacle, and then returns to the original path.  Figure 6 shows a flowchart of the pedestrian avoidance method. When the robot detects an oncoming pedestrian, the robot determines which direction to move to avoid the pedestrian, based on its distance to the walls. After determining the direction, the robot virtually moves the waypoints in the avoidance direction, and the robot follows the moved waypoints until the pedestrian passes the robot. Figure 7 presents a detailed explanation of the pedestrian avoidance method, showing the possible situations. First, when the robot detects a pedestrian to avoid (Figure 7a), the robot starts the avoidance motion. When avoiding a pedestrian, the robot measures the breadth of the areas to the left and right of the pedestrian using a laser range finder (LRF) (Figure 7b) and chooses the broader area as the area to move into. Then, the robot calculates the minimum distance to keep from the pedestrian (Figure 7c) and assumes another path parallel to its original path. After the robot recognizes that it has passed by the pedestrian (Figure 7d), it returns to the original path (Figure 7e).   We need to develop the following six functions to realize the proposed method: (1) Detection of the pedestrian, (2) determination of the direction to move, (3) calculation of the avoidance distance, (4) generation of the avoidance path, (5) detection of passing by the pedestrian, and (6) returning to the original path.

Detection of a Pedestrian
Let the distance to be kept (i.e., the public distance) be D pub . When the walking speed of the pedestrian is v p , the robot's moving speed is v r , and the delay of starting avoidance after recognizing the pedestrian is τ, the human-robot distance to start avoidance is For example, when D pub = 8 m, v p = 1.4 m/s, v r = 0.4 m/s, and τ = 1 s, the robot needs to start avoiding when the human-robot distance is 9.8 m. If the pedestrian moves to block the robot, the robot either avoids the pedestrian just in front of them or stops.
The method to detect and track the pedestrian is the same as that proposed by Nakamori et al. [35], which uses an LRF. We briefly describe the human detection and tracking method. Using an LRF, we obtain distances from the LRF to the other end in all directions. First, we detect the edge of an object by observing the difference of distances of two contiguous measurement points obtained from the LRF. Then, we determine whether an object (the region between two edges) is a human or not by comparing the width of the object and the typical human body size. If the object is determined to be a human, the center point of the object is regarded as the location of a human. We need to determine the human detection area to exploit this detection method. We set the detection area as a rectangle 900 mm wide and 6500 mm deep, 3500 mm away from the front of the robot, as depicted in Figure 8. When the robot detects a pedestrian in the human detection area, the robot starts to track the pedestrian. Let (x p (t), y p (t)) be the center position of the pedestrian at time t, where the unit of time is based on the scan of the LRF. In the experiment, we used a Hokuyo UTM-30LX, which scans every 25 ms. Thus, in this description, the unit of time was 25 ms. The view angle of the LRF was 270 deg, and the maximum distance of measurement was 30 m.
When the positions of observed objects in two contiguous observations are near enough, those two observations are regarded as an identical object. The threshold for determination was 500 mm; that is, we regarded two observations as belonging to the same object when |x p (t) − x p (t + 1)| ≤ 500 mm and |y p (t) − y p (t + 1)| ≤ 500 mm.

Determination of the Direction to Move
After detecting the pedestrian, we need to determine the direction (left or right) to move in order to avoid the pedestrian. To do that, as shown in Figure 7b, we take the average distances to the right and left of the robot and choose the larger direction.

Calculation of the Avoiding Distance
Next, we determine the distance between the original path and the new path for avoiding the pedestrian. Several works have measured the socially acceptable distance between a robot and a pedestrian passing by. Yoda et al. [36] considered 1200 mm to be an appropriate distance. Pacciarini et al. [20] examined three distances (200, 300, and 400 mm), and concluded that 400 mm was the best among those three conditions. In this work, we consider a situation where a robot and a pedestrian pass each other in a corridor. According to the Japanese law on architecture (Kenchiku Kijun Hou-Architectural Standard Law), article 119-the width of a corridor of a school (i.e., elementary, junior high, and high school) should be no less than 2.3 m when it has rooms on both sides. In this case, even when the pedestrian walks in the middle of the corridor, the robot can pass by the pedestrian by choosing a path in the middle of the left or right side. Figure 9 shows the size and available path of the robot. We considered the robot to be 400 mm wide [13] and the maximum body width of the pedestrian to be 556 mm, according to the AIST anthropometric database [37]. Considering this situation, we decided that the robot's path should be in the middle of the broader side.

Generation of the Avoidance Path
The robot follows the original path by moving from a waypoint to the next waypoint. Thus, when avoiding a pedestrian, the robot dynamically generates an avoidance path and follows the generated path. The avoidance path can be generated by shifting the waypoints in front of the robot towards the avoiding side, as shown in Figure 7c.

Detection of Passing by the Pedestrian
After the robot passes by the pedestrian, the robot returns to the original path. Let the coordinates of the robot and the human be (x r , y r ) and (x h , y h ), respectively. Then, the distance between the robot and the pedestrian is The coordinates are shown in Figure 10. The robot determines that it has passed by the pedestrian when D hr ≥ 500 mm and y r > y h .

Returning to the Original Path
After the robot has passed by the pedestrian, the robot returns to the original path by changing the next waypoint from that of the avoidance path to the corresponding point of the original path, as shown in Figure 7e.

The Human Following Method
In this section, we explain how the robot follows the waypoints. As explained in Section 1, the robot first follows a person (the supervisor) to learn the POIs, as well as the path to visit the POIs. The method to follow the person is based on that proposed by Sakai et al. [15]. We used the same method to follow the waypoints. Figure 11 shows the parameters for controlling the robot to follow the target person, where R is the distance between the center points of the robot and the human, θ h is the angle between the frontal direction of the robot and the human, and D stop is the distance from the person at which the robot should stop. Then, the speed of the robot (V m/s) is determined as follows: Here, we employed the constants V min = 0.4 m/s, V back = 0.2 m/s, and D back = 0.1 m. Figure 11. Parameters for human following.
The velocities of the left wheel V L and of the right wheel V R are determined as follows: The parameters D stop , K V , K t , and K tD were empirically determined, following [15], as D stop = 0.7 m, K V = 0.45 s −1 , K t = 0.1 m/s·rad, and K tD = 0.015 m/rad.

Following the Waypoints
Following the waypoints can be realized using the same control strategy as explained above. To do this, we need to assume a virtual target, instead of a target person. Figure 12 shows the concept of the virtual target. a virtual target is set on a line beyond the next waypoint, such that the robot can arrive at the next waypoint quickly. When the robot is near enough to the next waypoint, the robot judges that it has arrived at the waypoint and changes the target to the next waypoint.  Figure 13 shows the robot's waypoint-following behavior, where (WP x(k) , WP y(k) ) is the coordinate of the k-th waypoint, (x vr , y vr ) is the coordinate of the robot projected onto the line connecting the waypoints, and (x vt , y vt ) is the coordinate of the virtual target. The virtual target is always set D vt ahead from the projected coordinate of the robot along the line connecting the previous and the next waypoint. The robot moves toward the virtual target and, when the robot arrives at a point within D ar of the next waypoint, the robot moves toward the new virtual target. In the experiments, we used D vt = 1.5 m and D ar = 0.2 m. The calculation of the coordinate of the virtual target is depicted in Figure 14. The line connecting the waypoints is denoted by y = ax + b, and the line perpendicular to the previous line and crossing the center coordinate of the robot (x r , y r ) is denoted by y = cx + d. Here, the constants a, b, c, and d are calculated as follows: We calculate the coordinates (x vr , y vr ) and (x vt , y vt ) using these constants, as follows: where R is the distance between (x vr , y vr ) and (x vt , y vt ), which is set to 1500 mm. As we have two coordinates of (x vt , y vt ), we take the point nearest to the next waypoint (WP x(2) , WP y (2) ).

Quick Recovery to the Original Path
When the robot moves far from the path (e.g., when avoiding an obstacle), the robot tries to return to the original path using the algorithm described above. However, when the distance between the path and the robot is large, it takes time for the robot to return to the path. Moreover, if the distance is larger than a certain length, the robot will fail to detect arrival to the next waypoint. Figure 15 depicts this situation, where L is the distance between the center of the robot and the path. Let the distance between the waypoints be D iw . When the robot is at the side of a waypoint, the minimum distance between the robot and the next waypoint is as the robot moves straight to the virtual target. The robot recognizes arrival at the next waypoint when D wmin ≤ D ar . As D wmin is proportional to L, the robot cannot arrive at the next waypoint when For example, when D vt = 1.5 m, D iw = 0.74 m, and D ar = 0.2 m, the robot cannot arrive at the next waypoint when L > 0.395 m. To solve this problem, we propose to move the virtual target according to L. In Figure 15, (x nt , y nt ) is the coordinate of the new virtual target, which is a distance of L away from the line. The coordinate of the new virtual target is calculated as follows:  The small and big circles in the middle of the figure are the next waypoint and the area for judging the arrival at the waypoint, respectively. If we use the old virtual target, it is obvious that we cannot arrive within the judgment circle when the initial position is far from the path. When using the new virtual target, we can arrive at the waypoint, regardless of the initial position.

Combination with Obstacle Avoidance
The proposed pedestrian avoidance method can be combined with an obstacle avoidance method. By combining these methods, the robot can avoid obstacles nearby, as well as avoiding distant pedestrians while considering the public distance.
We employed the obstacle avoidance method by Sakai et al. [23]. Here, we briefly explain the obstacle avoidance method and the combination of the two avoidance methods.
The method of Sakai et al. was designed to avoid obstacles while following a person (the target). The avoidance algorithm is as follows: 1. The LRF observes the space in front of the robot, and the robot calculates the regions where the robot will collide with an obstacle. 2. Let θ i be the i-th angle observed from the LRF and D i be the distance to any object (the target, an obstacle, or the wall) at an angle of θ i (Figure 17a). List all regions (contiguous angles observed by the LRF) through which the robot can pass. Let d 1 , . . . , d n be such regions, where d k covers all angles from θ b k to θ e k (θ b k < θ e k ). 3. Judge whether the robot needs to avoid any obstacles, considering the positions of the robot and the target. If the straight path from the LRF to the target is included in any of the regions d 1 , . . . , d n , then there is no need to avoid an obstacle. 4. Let the angle from the LRF toward the target be θ M and Then, let R deg (k) be the rank of φ k among φ 1 , . . . , φ n , in ascending order (the smallest φ k has the highest rank). Now, R deg (k) indicates how near the region d k is to the target. 5. LetD k be the average distance to the object at region d k , as follows: 6. Let R dis (k) be the rank ofD k amongD 1 , . . . ,D n , in descending order (the largestD k has the highest rank). 7. Let R(k) = w deg R deg (k) + w dis R dis (k). 8. Determine the region with the highest rank;k = arg min k R(k). Let the robot move toward dˆk (Figure 17b). If there are ties, then we choose the region with the best R dis .  This algorithm can be easily combined with our pedestrian avoidance method, by regarding the virtual target as the target.

Overview and Conditions of the Experiment
We conducted an experiment to validate the proposed method. We checked for the following conditions: 1. The robot detects an oncoming pedestrian walking towards it; 2. The robot tracks the detected pedestrian; 3. The robot determines the area for moving to avoid the pedestrian; 4. The robot returns to the original path after passing by the pedestrian; and 5. The robot moves in front of the person to be guided, keeping a proper distance. Figure 18 shows the experimental environment. The width of the corridor was 2.38 m. The pedestrian walked toward the robot from a point 15 m away with a speed of 1.4 m/s or 0.7 m/s. We used a metronome to control the pedestrian's walking speed. The pedestrian and the guided person started simultaneously. We prepared three trajectories, as shown in Figure 18.  Figure 19 shows the robot we used for the experiment. The LRF for observing the pedestrian was mounted on the point 1000 mm above floor level. The base of the robot was a Pioneer-3DX by MobileRobots Inc. The maximum speed of the base was 1.6 m/s, but we restricted the maximum speed to be 0.4 m/s, considering the load. One LRF (LRF1), as shown in Figure 19, was used for detecting humans, and another (LRF2) was used for creating a map. We used the ICP scan matching package of the Mobile Robot Programming Toolkit (MRPT) for creating the map. Another LRF (LRF3) was used for detecting obstacles. The RGB-D sensor detected small objects on the floor. Finally, a fourth LRF (LRF4) was used to recognize the person to guide. Figure 20 shows photos of the experiment. The robot could successfully avoid the oncoming pedestrian for all the three trajectories and both walking speeds (Figure 20a). The average distance from which the robot detected the oncoming pedestrian was 9.3 m (Figure 20b). The robot could move to the broader side area for avoidance (Figure 20c). After passing by the pedestrian (Figure 20d), the robot could return to the original path (Figure 20e,f). The first half of Video S1 shows the video recorded at the experiment. In the video, we also recorded the robots map where the pedestrian is recognized. The average distance between the robot and the pedestrian when passing was 1.19 m. This distance depended on the trajectory and width of the corridor. It is left as future work to determine the best distance to keep between the robot and the pedestrian.

The Application Experiment
We proved that the robot worked properly with the proposed method. In this section, we describe the results of an experiment conducted in a more realistic environment, where there were obstacles in addition to the oncoming pedestrian. In this experiment, we evaluated whether the robot could keep a distance from the pedestrian while avoiding both the pedestrian and the obstacles.
In the experiment, we implemented that the robot detected obstacles from a distance of 2.0 m and set w dis = w deg = 1.0. Figure 21 shows the experimental environment. The distances between the robot and the left and right walls were 2 m and 4 m, respectively. The pedestrian started walking at 12.6 m away from the robot. The walking speed of the pedestrian was 0.70 m/s. We placed two obstacles, a can (φ × H, 0.05 × 0.09 m) and a box (WDH, 0.3 × 0.3 × 0.4 m). The maximum speed of the robot was 0.4 m/s. We set the waypoints before the experiment. The waypoints were aligned every 0.75 m. We conducted three trials for each of the walking speeds.  Figure 22 shows the example trajectory of the robot. We conducted three trials; the trajectory shown in the figure is the result of the first trial. In this example, the pedestrian passed the robot while the robot was avoiding the obstacle, after which the robot returned to the original waypoints directly.  Figure 23 shows the short-term trajectories (5 s) of the robot and the pedestrian. The black and blue points show the trajectories of the robot and the pedestrian, respectively. The green points are the positions of the obstacles. The robot detected the pedestrian and avoided them during 0-6 s. Then, it detected another obstacle at 5-10 s. At 10-15 s, it avoided the obstacles. Finally, it returned to the original waypoints. The pedestrian passed by the robot during t = 10-15 s, and then returned to the original waypoints. The trajectory of the pedestrian vanished after 15-20 s, as the robot stopped tracking the pedestrian after it passed by them. The second half of Video S1 shows the video recorded at the experiment. In this video, we clearly confirm that the robot started avoiding the oncoming pedestrian first, after which it avoids the obstacles nearby. Finally, Figure 24 shows the human-robot distances in the three trials. We can see that the human-robot distances became smaller, and then became large again. As the robot stopped tracking the pedestrian, most data ended after the human-robot distance became minimal. The average of the minimum distances was 1.87 m. Overall, the system operated properly. The proposed pedestrian avoidance algorithm worked under a more complex situation, and combination with the obstacle avoidance algorithm also worked without any problem. The average minimum human-robot distance when the robot passed by the pedestrian was 1.87 m, greater than the mentally-safe distance, 1.2 m.

Conclusions
In this paper, we have proposed a method for a robot to avoid an oncoming pedestrian in a corridor while moving along a recorded path. The proposed method involves methods for detecting the pedestrian, determining the area to avoid, calculating the distance to move aside, generating the avoidance path, determining the passing-by of the pedestrian, and returning to the original path. When avoiding the pedestrian, the distance to the pedestrian was 9.3 m on average, which was far enough to keep a public distance. When passing by the pedestrian, the distance to the pedestrian was 1.19 m, which was far enough, considering the person's impression [20]. All of the avoiding behaviors were performed while guiding a person by moving in front of them.
In addition, we carried out an experiment on pedestrian avoidance in an environment with other obstacles. As a result, the robot could avoid the obstacles while avoiding the pedestrian from 8 m away.
There are four limitations to our method. First, only one oncoming pedestrian was considered; if there were more pedestrians, the robot could not maintain a public distance and uses only the existing obstacle avoidance method to avoid pedestrians. Second, this method assumes that the pedestrian moves toward the robot from the front. Third, the corridor must be wide be enough for the robot to avoid the pedestrian. Finally, the floor of the corridor must be flat, such that obstacles on the floor can be detected by the LRF.
Our method can be applied for controlling an autonomous mobile robot, not only for the proposed situation but also for broader situations, such as for guiding robots in hospitals [38,39] or museums [40][41][42], where there are a relatively small number of persons and long, flat corridors. It may also be applicable in intelligent wheelchairs [43,44]. Our future work is to design avoidance behavior methods for larger spaces with many people [45]. In the present work, we used a simple control strategy for maintaining a distance to the following person. This may be improved by introducing a more sophisticated control method, which considers the distance to the follower [46].