Path Planning Algorithm for an Autonomous Electric Wheelchair in Hospitals

A novel path planning algorithm for an autonomous electric wheelchair that can be used in hospitals is proposed and verified. The objective of this study is to develop an autonomous path planning algorithm that satisfies body acceleration constraints for patient safety and follows paths suitable for hospitals. The wheelchair dynamics and equations of motion, including caster dynamics and the user’s influence on the wheelchair, are newly derived in this research. Since the proposed algorithm is based on two-wheel robot kinematics, it is applicable to most two-wheel actuated systems. When a wheelchair’s destination is set, a series of waypoints is computed and then the desired speed & attitude at each waypoint of the path are designed. Then, a speed profile is designed to minimize the travel time while adaptively changing the angular rate gain to minimize excessive lateral motion. As a result, the linear speed command of each actuated wheel is computed. Additionally, the hybrid reciprocal velocity obstacle algorithm is updated to guarantee that the body acceleration constraints are satisfied for applications with complicated dynamics. The performance of the proposed algorithm, with the full dynamics of the wheelchair, is demonstrated by extensive numerical simulations with conventional toy problems and then evaluated in two hospitals. The simulation results demonstrate that the proposed algorithm satisfies body acceleration constraints while following paths which are suitable for hospitals and that the proposed autonomous electric wheelchair could be applied in hospitals.


I. INTRODUCTION
The patient transportation system is an important hospital system that should receive attention for patient safety and efficient clinical care [1]. Demand for transportation systems among individuals with disabilities has been increasing with the aging population and increased number of survivors after life-threatening diseases [2], [3]. Recently, technology for autonomous transportation has demonstrated the potential for widespread adoption in numerous healthcare fields [4]. The wheelchair system, which is one of the conventional The associate editor coordinating the review of this manuscript and approving it for publication was Emre Koyuncu . transportation devices in a hospital, could be advanced via the application of a new technology-autonomous controlto enhance the performance and safety of wheelchairs by considering input methods, operating modes, and human factors [5].
Research related to wheelchair path planning can be classified into three categories: the shared control approach, local path planning to avoid collision, and global path planning to a destination or waypoint. In previous studies where shared control is applied, estimating the user's intention is most important because global path planning is conducted by the user; the wheelchair only assists in local path planning [6]- [11]. In [9], [10], the user model was constructed as a Bayesian model using the user's driving data. Even though the shared control approach is a good option for assisting users, it is not suitable for operating an autonomous wheelchair in a hospital. First, it is difficult to collect and learn the data because the wheelchair is used by untrained and unspecified persons, so the user model cannot be specified. Second, in a hospital, destinations for users are determined according to the treatment or examination. Thus, estimating the intent of all users is not possible and/or inefficient.
Prior studies have designed global paths based on the comfort of wheelchair users [12], [13]. In [12], a path was designed for the user to feel psychological comfort across the entire floor. To this end, discomfort was quantified as a three-variable cost function, which consists of a location discomfort cost, an area visibility cost, and a path length cost, and was evaluated by participants in an experiment. Each cost relates the distance from a wall and the speed of travel in a straight corridor, an area that can be seen, and the distance the wheelchair has to travel. In [13], not only the psychological comfort of the user but also that of a pedestrian passing by the wheelchair were considered. The wheelchair, however, only follows a predetermined path in the both studies and does not avoid a pedestrian, which means it is entirely the responsibility of the pedestrian to avoid the wheelchair. Additionally, only one pedestrian was considered in [13] and there is no consideration about pedestrians in [12]. This situation is not suitable for hospitals, where many people are traveling in various directions and some patients are unable to avoid the wheelchair. This situation not only makes the wheelchair user vulnerable to moving obstacles and changing maps but also leads to a measure of discomfort in each new place, incurring expensive costs.
Other studies have focused on the design of a local path to avoid collisions [14]- [17] but have considered only faceto-face situations and did not cover global path planning. In these studies, simple models such as a point mass system were used as the wheelchair model. In [16], an improved collision avoidance algorithm was proposed for a wheelchair with a companion traveling side-by-side while pedestrians pass face to face. The motivation of this study was to create a collision avoidance path that takes into account the relationship between the occupant and companion, with the ultimate goal of mapping out a human-like collision avoidance strategy. To this end, data were collected on the path generated by a user for collision avoidance, and a navigation model was developed using the data. The navigation model addresses only the situation in which a wheelchair and a pedestrian are encountered in a straight corridor and generates a local path for collision avoidance. Global path planning and local path planning, however, have to be considered together because of the need for efficient transportation in a hospital and collision avoidance for user safety, respectively.
Although the considered plant is not a wheelchair, some studies designed global and local paths using the potential field method with a social force, called social-aware navigation. The studies included path planning approaches that consider the context of people around the path [18]- [23]. Global and local paths that used the potential field method with a social force were constructed in some studies. In [19], [20], a social-aware path using a social zone was designed, which is an area constructed by people who share a relationship. A learning algorithm was also used to investigate which path is suitable in a crowded environment [21], [22], and psychological constraints were used to predict the path of people around a plant [23]. Although some interesting results have been reported, only a simple two-wheel robot was employed to verify the algorithms, and the user's safety was not considered in the research because the plants considered in these studies were robots without a user.
In this study, a path planning algorithm for an autonomous electric wheelchair operated in hospitals is proposed. The proposed algorithm designs suitable path for hospital, not only a local path but also a global path to reach a destination. The local path planning is defined as planning the path to avoid collision and the global path planning is defined as planning the speed and direction to get to the destination or waypoint. Two-wheel robot kinematics with a first-order dynamic system are used in the proposed algorithm such that it can be applicable to most two-wheel actuated system with more complex components in general. Furthermore, the wheelchair dynamics are newly derived, including not only a friction model and caster dynamics but also the user's influences on the wheelchair, and are used in numerical simulations. The proposed algorithm satisfies the body acceleration constraints for user safety by designing the speed profile and adjusting the gain related to the angular rate. The hybrid reciprocal velocity obstacle (HRVO) algorithm is modified to guarantee that the body acceleration constraints are satisfied while avoiding collisions and to ensure that the algorithm can be applied to complicated dynamics. The algorithm is demonstrated by numerical simulations with the wheelchair dynamics in both toy problems and real hospital maps.

II. PRELIMINARY
In this section, the HRVO algorithm is described, followed by a series of equations for the two-wheel robot kinematics and model approximation. Model approximation makes the proposed algorithm applicable to most two-wheel actuated system with more complex components. Finally, a proper shape of the path for the wheelchair in a hospital is proposed.

A. HYBRID RECIPROCAL VELOCITY OBSTACLE ALGORITHM
The HRVO algorithm [24] is one of the variations of the velocity obstacle (VO) algorithm [25]. The HRVO algorithm solves the oscillation problem known as ''reciprocal dances'' [26] in the reciprocal velocity obstacle (RVO) algorithm [27], which is also one of the variations of the VO algorithm. The VO algorithm is a local and reactive navigation algorithm that uses a collision cone [28] to avoid a collision. The VO algorithm makes the VO area where an agent's velocity vector should not be located to avoid the collision, as shown in Fig. 1(a). The RVO algorithm considers the counterpart's movement to avoid collision. The RVO algorithm assumes that the counterpart will perform half of the movement to avoid collision. Thus, the RVO area's boundaries are parallel to the boundary of the VO area and through a point that is the midpoint of the agent's velocity vector and counterpart's velocity vector, as shown in Fig. 1(b). The HRVO algorithm mixes the boundary of the VO area and the boundary of the RVO area as shown in Fig. 1(c). The RVO algorithm considers only the amount of the counterpart's movement to avoid collisions. On the other hand, the HRVO algorithm considers the direction and amount of the movement. If the agent's velocity vector is to the left of the centerline, which is through the vertex of the RVO area, the left boundary of the HRVO area is that of the RVO area, and the right boundary of the HRVO area is that of the VO area. Thus, the agent and the counterpart choose the same direction to avoid collision. If the agent wants to choose a new velocity on the other side by the centerline to avoid collision, the agent has to avoid the collision under the assumption that the counterpart does not act in the collision avoidance movement. If the desired velocity vector is in the HRVO area, the velocity vector that has a small norm of the difference from the desired velocity vector and is outside the HRVO area is chosen as the collision-free velocity vector.

B. TWO-WHEEL ROBOT KINEMATIC EQUATIONS AND MODEL APPROXIMATION
The two-wheel robot kinematic equations and each linear speed of the wheels are represented as follows [20]: where x, y is the position of the two-wheel robot's center, v r and v l are the linear speeds of the right and left wheels, respectively, θ is the attitude, v d is the desired speed at the middle point of the actuated wheels, θ d is the desired attitude, K is the angular rate gain, and d is the two-wheel robot's width, as shown in Fig. 2. The complexity of the wheelchair model and model uncertainties, including the friction model, displacement of the center of gravity (CG), moment of inertia, etc., make it harder to employ the full dynamics of a wheelchair for path planning. Thus, the two-wheel robot kinematics with the first-order dynamic system are used not only to address the uncertainties but also to make the proposed algorithm applicable to most two-wheel actuated systems with more complex components in general. For this purpose, the linear speeds of the wheels in (2) are modeled as the first-order dynamic system as where v r,d , v l,d are the desired linear speeds of each wheel, which are the reference signals generated by the proposed algorithm. τ c is a design parameter used to address the uncertainties of the system, including not only model uncertainties but also any time-delay components caused by performance of the controller, actuator dynamics, etc. τ c indicates how slowly the wheelchair follows the desired linear speed of each wheel compared to the two-wheel robot. Thus, the first-order dynamic system will represent the difference between the two-wheel robot and the wheelchair dynamics. As a result, if the system has two actuated wheels and the kinematics of the wheels can be approximated as the two-wheel robot kinematics, then the proposed path planning algorithm can be used.

C. PROPER SHAPE OF THE PATH FOR A WHEELCHAIR OPERATED IN A HOSPITAL
Generally, path planning algorithms with dynamic constraints can satisfy the constraints by generating a smooth path with a large radius of curvature. The path could pass by the waypoint, as shown in Fig. 3(a), or just pass nearby, as shown in Fig. 3(b). A path with a large radius of curvature, however, is not suitable for hospitals because the hospital environment usually has narrow spaces that are not sufficient for turning with a large radius of curvature such as in narrow corridors, confined spaces, and a lobby with many people moving in any direction. In addition, a user has to endure lateral body acceleration over a longer amount of time in the case of a large radius of curvature. It could be dangerous because some patients using the wheelchair cannot withstand the lateral body acceleration due to lack of core muscles, spinal injury, or any other reasons. Therefore, the wheelchair should nearly stop and turn at the waypoint, as shown in Fig. 3(c), which is more feasible in a hospital with narrow spaces and decreases the amount of time to endure body acceleration. In this sense, we propose a path planning algorithm that meets the constraints by adjusting the wheelchair's speed and angular rate instead of designing the path that has a large radius of curvature.

III. WHEELCHAIR DYNAMIC EQUATIONS
In this section, the wheelchair dynamics are derived anew by referring to [29], [30]. The wheelchair dynamics consider not only caster dynamics but also the displacement of the CG that represents the user's influences on the wheelchair. The wheelchair dynamics are used in the numerical simulation, unlike other studies that used two-wheel robot kinematics [14], [20], [24]. This approach shows that the proposed path planning algorithm can be applied to more complicated wheelchair dynamics, although the two-wheel robot kinematics are used in the algorithm, which is addressed in Sections IV and V.

A. FREE BODY DIAGRAM
The wheelchair model considered in this study has two actuated rear wheels and two passive front casters, as shown in Fig. 4(a). Coordinate {i} is the inertial coordinate and coordinate {b} is the body coordinate. The actuator is modeled as the first-order dynamic system with saturation. Fig. 4(b) shows a free body diagram of the wheelchair's body frame. In Fig. 4(b), G is the CG, R is the right actuated wheel's position, L is the left actuated wheel's position, C R is the position of pivot of the right passive caster, C L is that of the left passive caster, d is the wheelchair's width, a is the distance from the CG to the midpoint of C L and C R , b is the distance from the midpoint of two actuated wheels to the CG, andx,ȳ is the displacement of the CG. F R is the right actuated wheel's force, which is represented as where τ R is the torque of the right wheel's actuator modeled as the first-order dynamic system, and r is the wheel's radius. f R is the friction force at R, f CR is the force applied to the body frame by the right passive caster, and R R is the reaction force caused by assuming that R does not slip sideways. The force with subscript L has the same meaning as above but for the left wheel. f msd,x , f msd,y are the forces representing the user's influences on the wheelchair. The friction force and the normal force at R, L, C R and C L are modeled by referring to [29] and [30], respectively.

B. DISPLACEMENT OF THE CENTER OF GRAVITY
There exists an uncertainty about the wheelchair's CG as a result of the user's movement while driving. In this study, the displacement of the CG is designed as a mass-springdamper system actuated by the wheelchair's body acceleration as where m msd , c, and k are the mass, spring constant, and damping constant, respectively, and a is the body acceleration vector.

C. DYNAMIC EQUATIONS OF THE BODY FRAME
The dynamic equations of a wheelchair body frame are defined as where m is the total mass, i P v G/i is the derivative of v G/i in the inertial frame, F react is the sum of reaction forces, R R + R L , J b is the moment of inertia of the system with respect to the body coordinates' z-axis, α b/i is the angular acceleration, and M z is the z component of the total moment. The assumption that the actuated wheels do not slip sideways can be expressed as where j b is the body frame's y direction unit vector.
208202 VOLUME 8, 2020 The sum of reaction forces represented in the body coordinates, F b react , can be found as follows. By taking the time derivative of (10) in the body frame, the following equation can be obtained.
Additionally, (8) can be transformed to the following equation in the body frame. bvb Then, substituting (9) and (12) into (11), the sum of reaction forces is calculated as where F b is the total force vector except for the reaction force represented in the body coordinates, and F react,y represents the y components of F b react . The x and z components of F b react are zero, as shown in Fig. 4(b).

D. DYNAMIC EQUATIONS OF THE CASTERS
Fig . 5 shows the free body diagram of the caster [30]. In Fig. 5, {b} is the body coordinate, {c} is the caster coordinate, α is the angle of the caster coordinate about the body coordinate, f C lon is friction applied to the caster's longitudinal direction, and f C lat is friction applied to the caster's lateral direction. Note that α is a second-order dynamic systems as Furthermore, the force applied from the caster to the body frame is represented as where J c is the caster's z axis moment of inertia, µ c is the friction coefficient of the caster, and v c C is the velocity at the caster's pivot in the caster coordinates. Fig. 6 shows a schematic diagram of the autonomous wheelchair system for operation in hospitals. When a destination is specified, the proposed path planning algorithm computes each desired linear speed of the actuated wheels based on the destination and state. Then, the controller computes each actuator input to follow the desired linear speed of the actuated wheels. In this study, a proportional-integralderivative (PID) controller is used, but any other controllers can be used. The proposed path planning algorithm block in Fig. 6 consists of four main blocks, namely, the ''Waypoint and Attitude Planning (WAP) algorithm'', ''Speed Profile Design (SPD) algorithm'', ''Angular Rate Gain Adaptation (ARGA) algorithm'', and ''modified HRVO (mHRVO) algorithm'' blocks. The ''Desired Linear Speed of Wheels'' block just converts the desired speed and attitude to the desired linear speed of the wheels using (2). Every block obtains the state feedback, which makes each block more robust. To be brief, WAP and SPD compute the desired attitude and speed considering the proper shape of the path and body acceleration constraints, respectively. Then, mHRVO modifies the desired attitude and speed to avoid collision, while AVGA modifies the angular velocity gain to satisfy body acceleration constraints.

IV. PROPOSED PATH PLANNING ALGORITHM
In this study, the local path planning is defined as planning the path to avoid collision and the global path planning is defined as planning the speed and direction to get to the destination or waypoint, so mHRVO is for the local path planning, WAP and SPD are for the global path planning, and AVGA meets the body acceleration constraints by assisting other blocks. Especially, SPD takes greater account of longitudinal body acceleration constraints and AVGA takes greater account of lateral body acceleration constraints to make the user feel safe and comfortable.

A. WAYPOINT AND ATTITUDE PLANNING ALGORITHM
The main purposes of this block are determining a set of waypoints that should be used to travel to the destination in the shortest way based on the current position and computing the desired attitude. Determining the set of waypoints is VOLUME 8, 2020 performed using Dijkstra's algorithm [31] based on given information of a global map, that is, which waypoints are connected. The desired attitude is either the waypoint attitude or driving attitude depending on the distance between the current position and the waypoint to go. If the distance is within a certain distance, the waypoint attitude is the desired attitude. Otherwise, the driving attitude is the desired attitude.
The waypoint attitude is a desired attitude at the waypoint. If the waypoint is the destination, then the desired attitude is a predefined attitude based on an action taken by the user. For example, if the destination is the reception desk, then the user would want to look at the reception desk at the destination. Thus, the waypoint attitude at the destination is the direction toward the reception desk. If the waypoint is not the destination, the waypoint attitude is the direction toward the next destined waypoint. The driving attitude is the direction from the current position to the destined waypoint.

B. SPEED PROFILE DESIGN ALGORITHM
The main purpose of this block is to design a speed profile that minimizes the transportation time to the destination while satisfying the body acceleration constraints and makes the wheelchair have a path in the shape addressed in II-C. One of the easiest ways for a wheelchair to have a path in the shape addressed in II-C is stopping at every waypoint and turning to the desired direction. However, it causes bump friction at every waypoint, which not only makes users uncomfortable but also makes them unsafe. In addition, if the change in the direction at the waypoint is small, then every stop at the waypoint is a waste of time becasue the wheelchair can turn to the desired direction with nonzero speed while satisfying the body acceleration constraints. Thus, SPD designs the speed at the waypoints, called waypoint speed, and the speed profile reduces the transportation time to the destination while satisfying the body acceleration constraints. Note that it is natural that the desired speed at the destination is zero.
The waypoint speed that satisfies the body acceleration constraints can be calculated using the approximated model and waypoint attitude computed by WAP. We havė by (3) and substituting v r,d and v l,d into (2). In addition, v r − v l can be expressed as . (17) by solving (16) and setting the time t as t a , which is the design parameter used to address model uncertainty such as τ c . As a result,θ can be obtained by (1) and (17) aṡ where v r,0 and v l,0 are the current linear speeds of the right and left wheels, respectively. Let us define t a as the approaching speed, which indicates how fast the wheel's linear speed approaches the desired speed. Additionally, t a can be interpreted as the similarity between the two-wheel robot and the real plant including a controller. Therefore, if t a increases to ∞, (18) turns to (1), which means that the wheel's linear speed immediately becomes the desired speed and the plant with the controller is same as the two-wheel robot.
Because the lateral body acceleration is vθ, which must not exceed the maximum lateral body acceleration, the waypoint speed can be calculated as , where v f is the waypoint speed, θ f ,w is the waypoint attitude, θ w is the direction from the current position to the waypoint, e θ is θ f ,w − θ w , is an arbitrary small constant, a y,max is the maximum lateral body acceleration, and v max is the maximum speed of the wheelchair set for user safety.
Once the waypoint speed is generated, the procedure designing the speed profile can be formulated as an optimization problem, i.e., a minimum time problem with a fixed final state and inequality constraints on the control and state variables. In this study, the optimization problem is defined as and v where l is the distance from the current position to the waypoint, a is the acceleration, a x,lb and a x,ub are the lower and upper bounds of the longitudinal acceleration constraint, respectively, and v is the speed of the middle point of the actuated wheels. Let us define the Hamiltonian function as Then, the optimal control input with corner conditions can be found [32] as where a * is optimal control input. Note from (23) that the optimal input is 0, a x,lb , or a x,ub . The results are similar to bang-bang control but take into account the time delay of the wheelchair. In addition, the controller inputs are continuous because they are generated by (29). Thus, the response of the wheelchair is smoother. It makes the user safer and more comfortable.
The corner conditions are too complicated to determine which optimal input should be selected through the equation, so the graphic conditions shown in Fig. 7 are used in this study to determine which optimal input should be chosen. The optimal input depends on the current speed, waypoint speed, and distance from the current position to the waypoint. If the current speed and waypoint speed are both v max , it is natural that the optimal input is zero. Additionally, while the wheelchair is turning at the waypoint, the desired speed is maintained as its waypoint speed.
If the current speed is v max and the waypoint speed is smaller than v max , then the optimal input is either zero or a x,lb . In this case, the optimal input depends on whether the distance from the current position to the waypoint is longer than the following distance, S 1 .
In Fig. 7(a), if the distance from the current position to the waypoint is longer than S 1 , the optimal input is zero, and otherwise, the optimal input is a x,lb .
If the waypoint speed is v max and the current speed is smaller than v max , then the optimal input is either zero or a x,ub . In this case, the optimal input depends on whether the distance from the current position to the waypoint is longer than the following distance, S 2 .
In Fig. 7(b), if the distance from the current position to the waypoint is longer than S 2 , the optimal input is a x,ub , and otherwise, the optimal input is zero.
If both the waypoint speed and the current speed are not v max , then the optimal input can be one of (23), which depends on whether the distance from the current position to the waypoint is longer than the following distance.
If the distance from the current position to the waypoint is shorter than S 3 , the optimal input is a x,ub , whereas the distance to the waypoint is longer than S 4 . Then, the optimal input is a x,lb , as shown in Fig. 7(c). If the distance to the waypoint is longer than S 3 and shorter than S 4 , the optimal input is a x,ub unless the current speed reaches v max . Then, the optimal input is zero if the distance to the waypoint is longer than S 1 , and the optimal input is a x,lb if the distance to the waypoint is shorter than S 1 , as shown in Fig. 7(d).
The speed at the middle point of the two actuated wheels can be expressed by (1) and (3) as If the optimal acceleration is found from the minimum time problem, the desired speed at the middle point of the actuated wheels can be computed as To speed up the response of the system's speed, the large τ c will increase the change in the desired speed, which relates to the longitudinal body acceleration. On the other hand, at the initial position where the wheelchair is at a standstill, it is good to set the attitude of the wheelchair along the desired direction before moving to the destination for the user. For example, the wheelchair should change the direction first and then move to the destination if the direction to the destination is different from the wheelchair's initial attitude. Thus, the desired speed at the initial position is set to zero until the wheelchair's attitude is toward the desired direction. VOLUME 8, 2020

C. ANGULAR RATE GAIN ADAPTATION ALGORITHM
There exist two factors that decide the lateral body acceleration, (i) speed, and (ii) angular rate, but the SPD adjusts only the speed. The angular rate, however, should also be considered to meet the lateral body acceleration constraint. The main purpose of this block is to adjust the angular rate gain so that the lateral body acceleration constraint is not exceeded and to minimize the transportation time.
The angular rate can be expressed as by (18) and assuming v r,0 = v l,0 . Thus, K can be obtained as Note that there are two variables, v and |θ d − θ| in (31). It is obvious that if a wheelchair's speed increases, the angular rate gain decreases so that the lateral body acceleration constraint is not exceeded. On the other hand, if |θ d − θ| decreases, the angular rate gain increases until K max to quickly reach the desired attitude. The role of K max is that if |θ d − θ| is sufficiently small, the process of θ approaching θ d will be slow. This prevents a chattering problem around θ d .

D. MODIFIED HRVO ALGORITHM
The HRVO algorithm is a collision avoidance algorithm suitable for various collision avoidance problems. Three problems, however, have to be considered for an application of an autonomous wheelchair operated in a hospital. First, the HRVO algorithm cannot address the case in which the desired speed is zero and the wheelchair needs to change only the attitude. Most collision avoidance problems do not consider this case because the objective is mostly to minimize time, fuel, or travel distance. When the wheelchair starts to move from a standstill, however, it is natural that the wheelchair changes the attitude to the desired direction first because of the need for user safety. In a hospital, the wheelchair often stops as one waits for their turn, sees a doctor, etc. Second, although the HRVO algorithm considers the system's acceleration limitations [24], it cannot address a time delay in the system. It is difficult to apply the HRVO algorithm to a complicated system since the HRVO algorithm assumes the system reacts immediately. Third, in the HRVO algorithm, if the desired velocity vector is in the HRVO area, then the velocity vector that has a small norm of the difference from the desired velocity vector and is outside the HRVO area is chosen as the collision-free velocity. If the objective of the algorithm is to minimize the time-to-go to the goal without a collision, the best strategy is to maintain a minimum variation from the desired velocity. The most important aspect in wheelchair path planning, however, is user safety. Thus, the collision-free velocity has to be selected in a different way. For those problems, the HRVO algorithm is modified to address the standstill situation, the complicated system application, and the guarantee of user safety in this study.
For the first and second problems, the modified HRVO algorithm makes a modified HRVO area and finds the collision-free speed and attitude instead of finding the collision-free velocity vector. The modified HRVO area has two differences from the HRVO area. First, if the desired speed is zero and a static obstacle is considered, the boundaries of the VO area become those of the modified HRVO area. If an obstacle is a moving obstacle, choosing the boundaries of the modified HRVO area depends on whether the obstacle moves closer or not. If the obstacle moves closer to the wheelchair, one boundary of the modified HRVO area is parallel to the obstacle's velocity vector, and the other boundary is toward the obstacle. Otherwise, there is no modified HRVO area from the obstacle. Whether the obstacle moves closer or not is defined by whether the obstacle's relative velocity vector has an element toward the wheelchair. Second, a modified HRVO area is made not using the current wheelchair's position but using the predicted position of the wheelchair. As the system in the proposed algorithm is considered as two-wheel robot kinematics with the first-order dynamic system, the system's speed can be computed with Now, let us consider that the wheelchair maintains the current speed during e − 1 τc t a seconds because of the system's time delay. Then, when making the modified HRVO area, the wheelchair's position is If t a grows indefinitely, which means that the system dynamics are similar to the two-wheel robot kinematics, or τ c becomes infinitely small, which means that the system's time delay goes to zero, then the change in the wheelchair's position goes to zero. If the changed position passes by an obstacle and moves to a noncollision location, then the position is not changed, and the boundaries of the modified HRVO area become a straight line perpendicular to the wheelchair's direction. As a result, the modified HRVO algorithm determines the collision-free speed and attitude to avoid a collision in advance.
For the third problem, the collision-free speed and attitude are chosen as follows. The collision-free speed is among the desired speed, the current speed, or the smallest speed while satisfying the longitudinal acceleration constraint. The collision-free attitude is the closest to the desired attitude. When the modified HRVO area is made, the algorithm checks whether the desired speed and attitude are in the HRVO set which is a set of the speed and attitude in the modified HRVO area. If not, the desired speed and attitude become the collision-free speed and attitude. If so, a set of attitudes satisfying the lateral body acceleration constraints is made assuming that the desired speed is the current speed.
Thus, the attitude range satisfying the lateral body acceleration constraint can be computed.
. If all of the elements of the set are not in the HRVO set , the current speed and the attitude closest to the desired attitude become the collision-free speed and attitude, respectively. If so, the algorithm decreases the desired speed as much as possible while satisfying the longitudinal body acceleration constraint. The decreased speed is computed by (29), and another set of attitudes satisfying the lateral body acceleration constraint is made with the decreased speed. Finally, the algorithm checks whether all of the elements of the set are in the HRVO set . If not, the decreased speed and the attitude closest to the desired attitude become the collision-free speed and attitude, respectively. If so, the decreased speed is the collision-free speed, and of the two boundaries of the modified HRVO area, the attitude close to the current attitude is the collision-free attitude. Fig. 8 shows a summary of the modified HRVO algorithm.

V. NUMERICAL SIMULATIONS AND DISCUSSION
The performance of the proposed path planning algorithm is demonstrated by numerical simulations with python. The simulations are conducted for conventional toy problems and real hospital maps. First, the proposed algorithm is compared with the HRVO algorithm for a toy problem with static obstacles and that with moving obstacles. Then, the simulation results using the proposed algorithm with different values of the design parameters, τ c , t a , and K max , in the toy problem with static obstacles are compared to observe the influences of the parameters. After a comparison with the toy problems, the performance of the proposed algorithm for real hospital maps is demonstrated. There are two maps of real hospitals utilized in this study: One map for part of the National Traffic Injury Rehabilitation Hospital (NTIRH) and the other map for part of the Seoul National University Hospital (SNUH). In a hospital, the waypoints are markers on the hospital's wall and ceiling. The markers are pre-attached on crossroads, reception desk, outpatient clinic, cashier's office, and any other important places. The wheelchair model used in the numerical simulations is the model addressed in III with actuator dynamics including saturation. The body acceleration constraints are all 0.1 m/s 2 and the maximum desired speed is 1 m/s. The PID controller is used in the simulations, but any other controllers can be used. Outputs of the controller are torque signals of two wheels and gains of PID are 10, 0.1, 0.5, respectively. The gains are set so that the controller does not show the best performance to show that the proposed algorithm is robust to the performance of the controller. The HRVO algorithm compared with the proposed algorithm uses Dijkstra's algorithm [31] as global path planning.

A. PRELIMINARY SIMULATION WITH TOY PROBLEMS 1) TOY PROBLEM WITH STATIC OBSTACLES
In this section, the proposed algorithm is compared with the HRVO algorithm for toy problems with static obstacles. A wheelchair starts in front of a static obstacle. The wheelchair has to avoid the obstacle and turns at the center of a lobby. The design parameters are τ c = 3, t a = 0.4 and K max = 10. Additionally, the wheelchair's desired attitude at the destination is 90 • only set in the proposed algorithm.
In Fig. 9(a), the trajectory generated by the HRVO algorithm turns with a large radius of curvature, and the wheelchair almost bumps into the wall, whereas the trajectory generated by the proposed algorithm turns at the waypoint with a small radius of curvature, which is the proper shape for the path addressed in II-C, as shown in Fig. 9(b).
Additionally, the wheelchair using the HRVO algorithm cannot stop and bumps into the wall at the destination, whereas the wheelchair using the proposed algorithm arrives VOLUME 8, 2020 at the destination with the desired attitude. The reason for these results is that the HRVO algorithm does not consider the system's time delay, which is caused by differences between the real system dynamics and two-wheel robot kinematics, including the saturation and time delay of an actuator, the performance of the controller, caster dynamics, influences of a user, etc. Thus, the HRVO algorithm makes the desired speed and attitude speed command while expecting an immediate system response. On the other hand, the proposed algorithm considers and addresses the differences by generating the speed command in advance while taking into account the time delay of the system response.
In Fig. 10, the desired values are those designed by each algorithm. In Fig. 10(b), it can be seen that the WAP designs the waypoint speed to make the wheelchair satisfy the lateral body acceleration constraint at approximately 40 seconds. The desired speed profile is designed to minimize the travel time while satisfying the longitudinal body acceleration constraint. In Fig. 10(a), the HRVO algorithm does not decrease the speed command even when the obstacle is detected at approximately 35 seconds, and it makes the wheelchair almost bump into the wall. It is because the HRVO algorithm does not consider the time delay of the system response. On the other hand, the modified HRVO algorithm considers the time delay of the system response so that the wheelchair can take action in advance, which is shown again in the toy problem with moving obstacles. Note that the proposed algorithm designs the desired speed in advance so that the true speed follows the tendency of the desired speed. If the wheelchair follows this tendency, then the gap between the wheelchair's speed and the desired speed is irrelevant because the desired speed is designed in advance.
In Fig. 11, the body accelerations of the proposed algorithm are within the body acceleration constraints, whereas those of the HRVO algorithm exceed the constraints. In Fig. 11(b), when the lateral acceleration increases and is poised to exceed the limit, ARGA decreases K to restrain the lateral body acceleration.

2) TOY PROBLEM WITH MOVING OBSTACLES
In this section, the proposed algorithm is compared with the HRVO algorithm for toy problems with moving obstacles. Three pedestrians act as moving obstacles following the HRVO algorithm. Each pedestrian is modeled as the first-order dynamic system with its own time constant. The pedestrians with a small time constant represent people who can avoid obstacles quickly, and the pedestrians with a large time constant represent people who cannot avoid obstacles quickly. Every pedestrian has its own desired speed and time constant. In addition, the departure time for each pedestrian is adjusted so that the wheelchair and each pedestrian can interact. Table 1 shows the desired speed and time constant of each pedestrian and the minimum distance between the wheelchair and the pedestrians. The desired speed is set considering the average walking speed of 4 km/h for humans, and the limitation of the minimum distance is set to 0.5 m. In Table 1, the proposed algorithm is better than the HRVO algorithm in terms of the minimum distance between the wheelchair and the pedestrians taken as a whole. Even the minimum distance of the HRVO algorithm between the wheelchair and pedestrian 3 cannot meet the limitation. Furthermore, the proposed algorithm makes smaller movement than the HRVO algorithm to avoid collisions as shown in Fig. 12. In Fig. 13, the HRVO algorithm makes excessive commands in both speed and attitude so that the wheelchair cannot follow the commands. In contrast, the modified HRVO algorithm in the proposed algorithm considers the time delay of the wheelchair and generates the commands in advance so that the wheelchair can follow the commands. Furthermore, the proposed algorithm can sufficiently reduce the speed, which gives pedestrians time to avoid a collision; nevertheless, the pedestrians cannot move quickly. Thus, the minimum distances of the proposed algorithm between the wheelchair and the pedestrians are larger than that of the HRVO algorithm when considered as a whole; the wheelchair also changes the attitude less. In addition, the body accelerations of the proposed algorithm are within the body acceleration constraints, whereas those of the HRVO algorithm exceed the constraints, as shown in Fig. 14.

3) EFFECTS OF THE PARAMETERS
In this section, the effects of each design parameter are discussed. The environment is same as the toy problem with static obstacles in the previous section. First, the effects of τ c are shown and discussed by decreasing τ c from 3 to 1. Then, the effects of t a are shown and discussed by decreasing t a from 0.4 to 0.1. Finally, the effects of K max are shown and discussed by decreasing K max from 10 to 1.
τ c is the time constant of the actuated wheel's linear speed dynamics modeled as a first-order dynamic system, (3). Thus, if τ c is large, then the proposed algorithm considers that the linear speed of the wheels slowly follows the desired speed. As a result, the proposed algorithm makes a speed command more in advance considering the time delay of the wheelchair. In contrast, if τ c is small, then the proposed system makes a speed command less in advance since the proposed algorithm considers that the wheelchair will follow the speed command quickly. However, if the wheelchair is not as fast as the proposed algorithm considered, then the wheelchair cannot follow the speed command, and the mobility is decreased. As a result, the body accelerations are decreased.
If we compare Figs. 11(b) and 15(b), both the longitudinal and lateral body accelerations are decreased with small τ c . The proposed algorithm generates the desired speed command less in advance considering that the wheelchair can follow immediately. When the wheelchair's speed is not changed as expected, however, the longitudinal body acceleration and the angular rate are decreased. As a result, both the longitudinal and lateral body acceleration decrease as τ c decreases. Although τ c affects both the longitudinal and lateral body accelerations, τ c is used to meet the longitudinal body acceleration constraint since τ c is dominantly related to the desired speed command as (29).
On the other hand, t a indicates how fast the actuated wheel's linear speed approaches the desired speed. Thus, if t a is large, the proposed algorithm considers that the actuated wheel's linear speed matches quickly the desired speed. This can be interpreted as the wheelchair dynamics being close to the two-wheel robot kinematics. In contrast, if t a becomes small, the proposed algorithm considers that the actuated wheel's linear speed matches slowly the desired speed. Thus, the proposed algorithm generates a speed command more in advace assuming that the response of the wheelchair will be slow. If the time delay of the wheelchair is not as large as expected, however, the wheelchair will follow the excessive speed command, and the body accelerations will exceed the constraints. In Fig. 16, the lateral body acceleration exceeds the constraint at approximately 100 seconds and 125 seconds. In addition, if t a is small, the modified HRVO algorithm considers the response of the wheelchair to be slow. Thus, the modified HRVO algorithm makes the small speed command for safety. As a result, the speed command remains excessively small while the obstacle is detected at the beginning. It seems that t a is the counterpart of τ c . t a is, however, not involved in the longitudinal body acceleration. The desired speed is eventually computed by (29); τ c is the only design paremeter involved in the longitudinal body acceleration. Thus, τ c is first set to satisfy the longitudinal body acceleration constraint; then, t a is set to satisfy the lateral body acceleration constraint.
K max is the upper bound of K . The role of K max is that if |θ d − θ| is sufficiently small, the process of θ approaching θ d will be slow. In (31), there is a difference between the current attitude and the desired attitude in the denominator. If the difference goes to zero, the absolute value of K goes to infinity resulting in excessive angular velocity. Thus, K max means that if the difference becomes small to a certain level, K is fixed as K max , and the angular rate computed by (30) no longer increases. If we compare Figs. 11(b) and 17(b), the angular rate is decreased as a whole with small K max . As a result, the lateral body acceleration is decreased, as shown in Fig. 17(b). This means that the mobility of the wheelchair is decreased. If we compare Figs. 17(a) and 10(b), the wheelchair cannot change the attitude as desired with a small K max . If the parameters are manipulated in the opposite direction, it shows opposite results.

B. EXTENDED SIMULATION IN ACTUAL HOSPITALS
In this simulation, the proposed algorithm is validated with some scenarios in real hospital maps. There are two hospital maps: one map is part of the NTIRH's 1st floor, and the other map is part of SNUH's 1st floor. The positions of the markers that play the role of waypoints are selected temporarily, and how the locations of the markers are selected will also be an important future work. The design parameters are τ c = 3, t a = 0.8 and K max = 10. The limitation of the minimum distance is set to 0.5 m.

1) SIMULATION IN THE NATIONAL TRAFFIC INJURY REHABILITATION HOSPITAL
The NTIRH was constructed to specialize in rehabilitation. Thus, it is meaningful to verify the proposed algorithm in the NTIRH. The scenario consists of two parts. One part involves moving from the main entrance to the main reception, and the other part involves moving from the main reception to the outpatient clinic. In particular, a patient comes into the NTIRH, rides an autonomous electric wheelchair at the front of the main entrance, moves to the main reception, and moves to the outpatient clinic to see a doctor. Thus, the desired attitudes at the destinations of each part are −80 • toward the main reception and −180 • toward the outpatient clinic room, as shown in Fig. 18. Every pedestrian as a moving obstacle has their own desired speed and time constant. Table 2 shows the desired speed and time constant of each pedestrian and the minimum distance between the wheelchair and the pedestrians.  In Fig. 18, the response of the attitude, θ, oscillates because of the controller's poor performance. However, body accelerations do not exceed the body acceleration constraints because the proposed algorithm considers the time delay of the system, including the actuator dynamics, performance of the controller, and model uncertainties. Note that the wheelchair arrives at the destination with the desired attitude. From the main reception to the outpatient clinic, the wheelchair detects pedestrians at approximately 60, 100, 115, and 175 seconds. Every time, the proposed algorithm generates the speed and attitude command in advance. Thus, the wheelchair can reduce the speed and change the attitude while satisfying the body acceleration constraints.

2) SIMULATION AT SEOUL NATIONAL UNIVERSITY HOSPITAL
In this section, the proposed algorithm is applied to a more complicated environment, SNUH. The scenario consists of  three parts. First, a patient moves from the main entrance to the main reception. Second, the patient moves from the main reception to the outpatient clinic. Third, the patient moves from the outpatient clinic to the cashier's office. The desired attitudes at the destinations of each part are 135 • toward the main reception, 225 • , toward the outpatient clinic room, and −90 • toward the cashier, as shown in Fig. 19. Table 3 shows the desired speed and time constant of each pedestrians and the minimum distance between the wheelchair and the pedestrians. Fig. 19 and Table 3 show that the proposed algorithm operates well in a more complicated environment. The minimum distances between the wheelchair and the pedestrians are all above the limitation, 0.5 m. Furthermore, the body accelerations are within the body acceleration constraints, while the wheelchair arrives at the destinations with the desired attitudes.

VI. CONCLUSION
In this research, a path planning algorithm for an autonomous electric wheelchair being operated in hospitals is proposed. The proposed algorithm considers the planning of both local and global paths to satisfy body acceleration constraints, to avoid collisions, and to transfer efficiently through the clinical process in hospitals. Two-wheel robot kinematics with the first-order dynamic system are used to make the proposed algorithm applicable to most two-wheel actuated systems with more complex components. Wheelchair dynamics are newly derived, including the user's influences on the wheelchair, which are used in the numerical simulations. To satisfy the body acceleration constraints for user safety, a waypoint and attitude planning algorithm, speed profile design algorithm, angular rate gain adaptation algorithm, and modified HRVO algorithm are proposed in this study. The performance of the proposed algorithm has been demonstrated by extensive numerical simulations with the full dynamics of the wheelchair. The simulation results show that the proposed algorithm satisfies body acceleration constraints while following paths that are appropriate to hospitals and that the proposed autonomous electric wheelchair could be applied in hospitals.
Several directions of future work remain to ensure optimal operation of an autonomous electric wheelchair in a hospital. First, how marker locations are selected is an important future work, as mentioned above. Markers are widely used as waypoints in indoor environments where GPS cannot be used. In addition, markers can aid in wheelchair navigation by correcting the accumulated IMU error whenever these markers are detected. Markers are carefully chosen, with consideration for which locations are not only efficient but also safe for both a wheelchair and pedestrians. Second, the concept of path yielding has to be considered. If a wheelchair encounters people who can move freely, people will yield the path for the wheelchair. In hospitals, however, some patients cannot yield the path because their movement may be more restricted than those in a wheelchair, such as patients on stretchers. In these cases, the wheelchair must yield the path. In particular, the concept of path yielding will be important future work for a robot operated in a crowd. With those future works, experiments with actual wheelchair in real hospitals have to be conducted to evaluate and improve the proposed algorithm.