Numerical simulation of collision-free near-shortest path generation for Dubins vehicle via Hamilton–Jacobi–Bellman equation: A case study

Abstract Motivated by modeling an unmanned aerial vehicle at a constant altitude plane above ground level as Dubins vehicle with signed upper-bounded curvature as constrained input and the flight path as Dubins path, the class of flight paths we study is restricted to the paths composed by path segments with zero or constant curvature satisfying the curvature constraint. We start with time-optimal control formulation incorporating mixed constraints for Dubins vehicle in cluttered planar environment and derive the associated Hamilton-Jacobi-Bellman (HJB) equation for the value function from the necessary time-optimality condition. The Kruzkov transform is used to modify the HJB equation for scaling of the solution to be bounded near the obstacles. Numerical solutions based on the fast-sweeping methods with consistent, monotone upwind Godunov Hamiltonian and semi-Lagrange methods are implemented for solving the two-point boundary value problem of modified HJB equation. Comparative validation simulations suggest the appropriateness of both schemes for the numerical collision-free shortest path via Kruzkov transformed HJB equation but with different convergence rate. Two schemes both perform satisfactory path planning, while Godunov Hamiltonian scheme provides more accurate in order of convergence. It is also found by example simulations that the grid resolution and time-step size required for switching structure is finer than that of the convergence criterion.

Jing-Sin Liu received his PhD degree from National Taiwan University in 1990. He is an Associate Research Fellow at Institute of Information Science, Academia Sinica, an IEEE Senior Member. The group lead by J.-S. Liu has steadily studied different computational methodologies of path planning for unmanned vehicles. Our work focuses on the nonholonomic path optimization in the presence of obstacles for unicycle or Dubins vehicle subject to curvature constraint. The methodologies employed are fast marching method, fluid dynamics (harmonic functions) method, metaheuristics and numerical nonlinear optimal control including learning-based methods in the presence of uncertainties. This paper is a lasting work on shortest path planning, which is equivalent to time-optimal trajectory planning in the case of constant speed Dubins vehicle, to see if the numerical methods, which is iterative thus expensive in nature, can acquire an accurate solution with a limited time budget.

PUBLIC INTEREST STATEMENT
Unmanned aerial vehicles (UAVs) are emerging in commercial missions such as package delivery in cities, monitoring of typhoon or air quality PM 2.5. To achieve the mission goal, generation of flyable paths is crucial to the efficient operation of uavs with operating and vehicle constraints. Dubins vehicle is an ideal model for a UAV moving forward at constant speed at constant low altitude with curvature constraint. Dubins paths are the shortest path linking two configurations for a Dubins vehicle in the absence of obstacles. In the presence of obstacles such as radar sites and prohibited areas, Dubins path can be extended via numerical time-optimal control (bang-singularbang) corresponding to the case of Dubins-like path composed by line and left or right turn of minimum turning radius. Assessment of accuracy of numerically obtained paths demonstrates the appropriateness of the numerical methods for path generation for given boundary conditions and obstacle distributions.
simulations that the grid resolution and time-step size required for switching structure is finer than that of the convergence criterion.

Introduction
State-to-state transfer is a common mobility task for bringing a system from an initial state to a target state. Among the many admissible state-to-state transfer trajectories in which the dynamics of the system is explicitly accounted for, the optimal maneuvering of unmanned vehicles that requires minimizing a cost functional, i.e., generation of constrained optimal input and state trajectories (or optimization-based physically realizable trajectory generation) or even better feedback motions, is challenging. In finding the input/control command that could be saturated on the convex compact set of constrained input, the optimal control formulations are powerful for optimal utilization of actuation capabilities. By following the standard optimal control formulation for the motion of a dynamic system described by state equations, it is possible that optimization of a multitude of cost functional (e.g. time-to-go, energy expenditure, distance or their mixture), especially for missions or tasks which are repeatedly executed a number of times by a dynamic system can be achieved. To solve for the state and control trajectories while optimizing a cost function subject to physical and environmental limitations described by the equality or inequality state and control constraints can be viewed as a type of model-based path planning or kinodynamic motion planning (Wolek & Woolsey, 2017). A wealth of numerical methods and tools has developed to optimize the control input and state trajectories, while their accuracies or efficiencies are validated across a variety of model systems and problems (Bardi & Capuzzo-Dolcetta, 2008;Consolini et al., 2019;Szuster & Hendzel, 2018;Tonon et al., 2017). For example, a tool FALCON.m (http://www.fsd.mw.tum.de/software/falcon-m/) for Matlab is developed to solve a wide variety of optimal control problems. PRONTO for trajectory optimization is another example (Aguiar et al., 2017).
A well-known optimal constrained trajectory that has been extensively studied is the timeoptimal trajectory along which the optimizing bang-bang switching control command respecting the safe handling envelope drives the system from a start state to a goal state (belonging to a goal manifold) in minimum time. Time-optimal control and fastest possible motion generation have been employed for efficient operation of practical kinematic systems in the aerospace, mechatronics, vehicle and robotics applications, such as variable-stiffness-actuated (VSA) systems (Zhakatayev et al., 2017), double integrator (Castro & Koiller, 2013;Sundar & Shiller, 1997), the differential drive mobile robot (e.g. Poonawala & Spong, 2017;Manor et al., 2018), Dubins vehicle (Kaya, 2017;Takei & Tsai, 2013), car-like vehicle (Bertolazzi and Frego, 2018)- (Desaulniers, 1996), unmanned aerial vehicles (UAVs) (Consolini et al., 2019;Patten et al., 1994;Techy & Woolsey, 2009;Zollars et al., 2018), and aerospace systems (Zhu et al., 2017). The state-to-state transfer time depends on the aggressiveness of maneuver, given the input constraints, boundary conditions (in terms of position, velocity and acceleration). A computationally practical approach to time-optimal trajectory planning is the decoupled approach. Decoupled approach assumes that a geometric path is preplanned first for the system, so that time-optimal trajectory planning reduces to the generation of optimal velocity (a time scaling function) along the prespecified geometric path that meets the kinodynamic limits on the velocity and acceleration derived from the system dynamics are considered separately (see e.g. Bertolazzi and Frego, 2018;Jamhour & Andr'e, 1996;Zdesar & Škrjanc, 2018). Fast, accurate and robust numerical integration is developed for the decoupled approach to generate a time-optimal velocity profile by construction of the admissible region of safe speed for each vehicle position in the phase plane of distance-velocity (Pham, 2014).
The decoupled approach is not fully dynamic optimization, since the shape and length of the path are not changed by the time-scaling function simultaneously (Zdesar & Škrjanc, 2018) during the optimization.
A general formulation of time-optimal state-to-state transfer trajectory planning in the cluttered environment and its numerical schemes can incorporate the mixed constraints, i.e., the path or safety constraints of obstacles with general shapes, not only input saturation constraint. It reduces to a two-point boundary value problem of a type of Hamilton-Jacobi-Bellman (HJB) partial differential equations (PDEs). HJB PDEs are derived from the first-order necessary conditions for the optimality of trajectory and control for a dynamic system based on Pontryagin Maximum Principle (PMP) or Dynamic Programming Principle (DPP). Central to numerically solve the HJB PDEs is the concept of viscosity solution defined by (Crandall & Lions, 1984), (Michael, 1983). They showed that any monotone (thus first order), finite difference methods (FDMs), consistent numerical Hamiltonian would yield the numerical solution of HJB equation, i.e. the value function (i.e. the value of the minimum cost), converge to the viscosity solution. Other numerical methods to approximate the value function (i.e. travel time or cost-to-go) solutions to the HJB PDEs associated with the time-optimal control problems, for example, pseudospectral method (orthogonal collocation method) where a proper choice of collocation points is crucial (Gong et al., 2009;Mehrali-Varjani et al., 2018), adaptive sparse grid method (Bokanowski et al., 2013), radial basis function (Ferretti et al., 2017) based on interpolation and collocation, continuation methods (Zhu et al., 2017), among others are also popular in numerical nonlinear optimal control, but they are beyond the scope of the paper. Very useful comparisons are provided among the performance of different numerical schemes for solving the HJB equations, usually limited to one or two dimensions due to curse of dimensionality (Falcone, 2013;Font & Pedregal, 2018;Mehrali-Varjani et al., 2018;Kang & Wilcox, 2017;Zhu et al., 2017). Falcone (2013) showed that the numerical solutions of HJB equation resulting from time-optimal control problems are feasible for systems with at most dimension 3 but can be raised up to 10 with a combination of policy iteration and value iteration schemes.
A constant speed UAV at constant low altitude above ground level is modeled as a Dubins vehicle (Chen et al., 2018;Lugo-Cárdenas et al., 2014;Techy & Woolsey, 2009;Tsourdos et al., 2010;Zollars et al., 2018). It is essential to determine a flyable, even aggressive path or trajectory for constrained UAV flight. Among the flyable paths, Dubins path is the shortest curvatureconstrained path which connects the initial and final positions and matches heading directions at both ends in the plane in the absence of obstacles. First introduced in 1957 (Dubins, 1957), Dubins work on shortest bounded-curvature paths, now called Dubins path, is widely employed in generation of wheeled mobile robot trajectory and flyable level flight paths of UAVs (see e.g. Chen et al., 2018;Lugo-Cárdenas et al., 2014;Techy & Woolsey, 2009;Tsourdos et al., 2010;Wu et al., 2000;Yang & Kapila, 2002), Due to the nature of Dubins path that is composed by tangential circular arcs for meeting the boundary conditions and straight lines (see Section 2.2) in the absence of obstacles, we restrict the families of desired constrained flight paths in cluttered environment to Dubins-like paths, i.e. the class of flight paths that begins and ends with circular arcs with minimum turning radius suitable for serving as a near-optimal tangent-continuous reference generator for UAV flyable path at constant low altitude. The reformulation of Dubins path based on optimality principle as a time-optimal collision-free trajectory of Dubins vehicle (Castro & Koiller, 2013;Kaya, 2017;Takei & Tsai, 2013) is followed in this paper. A commonly adopted two-level sequential strategy for vehicle steering is first design a path at the higher level, then a path following control design at the lower level. By contrast, from the control design point of view, a great advantage of this reformulation is, that it naturally results in optimal state feedback control and state trajectory simultaneously for steering the vehicle, and provides the insights into the problem and solution structure. More importantly, it allows the consideration of path constraints resulting from obstacles that introduce additional significant difficulty, and thus extending the computation of shortest paths into more realistic and sophisticated situations (cluttered environments), not analytically solvable even for the simple double integrator (Sundar & Shiller, 1997). Instead of the HJB equation considered by (Takei & Tsai, 2013), we consider a slightly modified HJB equation via Kruzkov transform to avoid unboundedness in the initial condition (such as the region neighboring the obstacle) to assure the existence of viscosity solution and computational feasibility. The obtained approximate numerical value function that generates approximation to viscosity solution of HJB equation is used for numerical time-optimal path generation. For revealing the optimality of numerically obtained control and state trajectories of considered HJB equation of Dubins vehicle, the algorithms of our implementation choice to demonstrate are two historical numerical iterative algorithms, Godunov numerical Hamiltonian and semi-Lagrange scheme. The two algorithms are two typical methods satisfying the conditions of convergence (Tsai et al., 2017), which produce intermediate solutions ensuring a decrease in value function for every iteration, regardless of initial conditions, to converge to the final outcome. To implement those schemes, fast sweeping method is an efficient method that demonstrates impressive numerical results (Tsai et al., 2017;Zhao, 2005Zhao, , 2016. The method is faster with complexity O N ð Þ and easier to implement than fast marching method whose complexity is O NlogN ð Þ, where N is the number of grid points used in the computational domain. with fast sweeping method. As is well known, numerical methods based on discretization into grids will round the state (in particular, the vehicle heading) to elements of a fixed set of discretized states, and these roundoff errors can accumulate. The propagation of errors gives traversal time error, thus the optimality of the numerical schemes needs to be checked. The aim of this paper is to assess the optimality or accuracy of the collision-free paths obtained by the numerical implementations with comparison to analytical Dubins-like paths composed by two typical path primitives of line segments and circular arcs satisfying the curvature constraint and paths generated by Hybrid A*. A thorough investigation of the numerical issues of HJB equation for time-optimal trajectory generation of Dubins vehicle is beyond the scope of the paper.
The rest of the paper is organized as follows. Section 2 contains the introduction of Dubins path and time-optimal control reformulation of Dubins path along with the associated derivation of HJB equation summarized mainly from (Takei & Tsai, 2013). The modified HJB equation by Kruzkov transform is presented. The DPP is proven to be satisfied in the time-optimal problem and the value function is the unique viscosity solution of the equation. Section 3 presents two historical numerical methods for solving the modified HJB equation. In Section 4, feasibility study of numerical schemes is studied by verifying the solution accuracy or optimality via comparisons with the analytical Dubins path in a computational domain without obstacles and then extends to a computational domain with obstacles by comparisons with analytical Dubins-like paths and with the paths generated by Hybrid A*. In Section 5, we conclude the paper.

Generation of time-optimal trajectory for Dubins vehicle via HJB equation
Notations: (1) The workspace Ω � R 2 is an open and connected set with any point x ¼ x; y ð Þ 2 Ω.
(5) T is the total time for travel or motion in Ω pose of the concerned Dubins vehicle.
(6) The state trajectory at time t 2 0; T ½ � of Dubins vehicle with current control α at t and initial condition ρ is minimum radius of left or right turning.
(9) The minimum distance between a point x and the obstacle P k is denoted: where dist x; y ð Þ ¼ x À y is the Euclidean distance between x; y 2 Ω.

Kinematics of Dubins vehicle
A Dubins vehicle platform (Figure 1) which is a very popular simplified four-wheeled model of highfidelity vehicle with curvature constraint has been used as the unmanned ground, aerial or underwater vehicles. It attracts special interests in the study of UAV trajectory generation when the UAV fly only forward during a level flight with a constant altitude. In this paper, a Dubins vehicle is assumed a particle vehicle which can only move forward with constant speed v and with path maximal curvature bounded with.
With the arc length parametrization, the kinematics of a Dubins vehicle model with rolling and without slipping constraints is described as where s is the arc-length along the path; x; y; θ ð Þ 2 Ω pose is the configuration of Dubins vehicle with tangent direction θ � ð Þ 2 0; 2π ½ Þ along the path, and it defines a unit tangent vector cosθ; sinθ ½ � T along the path at the point s; v is the constant speed of vehicle; is the minimal turning radius with κ max ¼ tanϕ max ð Þ=L and ω max is maximal angular velocity (turn rate), where ϕ max is the maximum of steering angle ϕ by front wheels and L is the distance between the front and real axels of wheels.
The curvature is bounded due to bounded steering angle or minimum turn rate. Now by changing the parameter s in (2.1) to time t>0 via a time-scaling function s ¼ s t ð Þ: ρ v with input α t ð Þ 2 À 1; 1 ½ �, we obtain the following model: with a constraint on maximal angular velocity or equivalently maximal curvature (as α ¼ �1), where + for left (counterclockwise, ccw) turn,-for right (clockwise, cw) turn. The signed curvature α t ð Þ ρ can be positive or negative that controls the rate of change of tangent direction (turn rate), for the motion of vehicle.
For more compactly, we denote:

Brief on Dubins path and shortest path with obstacle-avoidance
The Dubins vehicle (2.2) has only three types of forward motion: straight, left turn and right turn with lowered bounded turning radius as the input.
The Dubins path is composed by concatenating circular arcs with maximum curvature and line segment tangential to circular arcs, so that at most three control input sequence of α t ð Þ ¼ 0; 1; À 1 are sufficient to characterize the Dubins path.
This corresponds to, respectively, zero curvature (line) or constant speed forward translation, maximum curvature left(ccw) turn, maximum curvature right (cw) turn.
For given initial and final configurations, there are six types of shortest paths which is characterized in two families, namely CCC type and CSC type, where C denotes either the Left (L) or Right (R) turn circular arc of maximal curvature 1 ρ � � , and S denote the straight line segment that is the common tangent line segment to the two circles tangential with the start and final poses. For the CSC type path (bang-singular-bang with two switching points) (Bui et al., 1994), the first turn is to turn from initial heading to the one end of line segment and the last turn is to turn from the other end of segment to the final heading. It is similar for the CCC type path (bang-bang type) except the middle one is a consecutive circular arc with beginning and end poses connecting to the end pose of first arc and the beginning of third arc, respectively. It is known that CSC has four possibilities: LSL and RSR, LSR and RS, while CCC has two possibilities: RLR and LRL of which the intermediate circular arc has an angle larger than ρπ (Dubins, 1957). In general, CSC is more generic and common to occur than CCC for the distance pair of initial and final points is larger than 6ρ (Techy & Woolsey, 2009). So, for the case of state-to-state transfer with two end points far apart, the scenario in this paper's (and others e.g. (Hota & Ghose, 2010;Pharpatara et al., 2015;Yang & Kapila, 2002) simulations, it takes the form of CSC (Kaya, 2017). It is clear that CSC type path is feasible for tangent-continuous constrained level flight path for UAVs.
However, though the tangent direction of Dubins path is continuous along the entire path, there are curvature (i.e. angular velocity) discontinuities in the junction of line and circular arc. Due to zero angular/rotational velocity and zero linear/translational velocity at two junctions of CSC path, there should be three acceleration-deceleration motion sequences along the first arc, straight line segment and the other arc of CSC path based on velocity limit curve generated from the statedependent acceleration/input constraint and unicycle kinematics.
The work (Lugo-Cárdenas et al., 2014;Tsourdos et al., 2010;Yang & Kapila, 2002) aiming for application to UAV level flight path at low altitude provide a geometric construction of CSC type paths composed by four possible paths, the shortest of which is the Dubins path and is in closed form. It is also the way in the paper to determine the desired exact Dubins path with given initial and goal poses without obstacles. Note that the minimum radius turning circle of Dubins path for shortest path length could be relaxed to a range of admissible radii for UAV applications to offer flexibility in generation of Dubins-like paths (Chen et al., 2018). In (Manor et al., 2018;Wu et al., 2000), time-optimal velocity planning is studied for Dubins paths. Previous work (Castro & Koiller, 2013;Desaulniers, 1996;Liang et al., 2015;Sundar & Shiller, 1997;Yang & Kapila, 2002) studied the length-shortest path which avoids obstacles. (Liang et al., 2015) showed that length-minimal path should be composed of arc segments and line segments, and finding the shortest path which avoids obstacles is an NP hard problem. The works (Castro & Koiller, 2013;Desaulniers, 1996;Sundar & Shiller, 1997;Yang & Kapila, 2002) (for only one circular obstacle) showed that the shortest path comprises of arc segments of maximum curvature, line segments and portion of the boundary of the obstacle.

Kruzkov transformed HJB equation for shortest path with obstacle-avoidance
Take advantage of the boundary-value problem of HJB equation resulting from Hamiltonian formulation to time-optimal trajectory generation problem was proposed and analyzed in (Castro & Koiller, 2013;Takei & Tsai, 2013;Sundar & Shiller, 1997). Because in the context, the speed v of Dubins vehicle (2.2) moving forward is constant, it is noted that the shortest path between two configurations is also time-optimal trajectory. The literature (Kaya, 2017;Takei & Tsai, 2013) reformulated the Dubins path (shortest curvature-constrained path in the plane) as the time-optimal trajectory generation of the control problem. In this approach, without obstacles, mathematically, the value function (the value of length-minimal Dubins path linking any initial pose to the given goal pose, as defined in (2.4)) is the solution to the HJB equation, whose ordinary differential equations for characteristic lines (in (2.12)) provides the necessary conditions of optimality of the control via PMP or DDP (see THEOREM 1) and state (position and heading) trajectory. The reformulation of characteristic line equations yields stationary solutions of bangbang type (CCC type Dubins curve) where switching between α t ð Þ ¼ 1andα t ð Þ ¼ À 1 may occur, or a concatenation of bang and singular arcs as bang-singular-bang type (CSC type Dubins curve) where at most two switchings between α t ð Þ ¼ 1; α t ð Þ ¼ 0 and between α t ð Þ ¼ 0; α t ð Þ ¼ À 1 may occur (Bui et al., 1994). Therefore, this allows the extension of Dubins path to the computation of shortest path or time-optimal trajectory of Dubins vehicle in cluttered environment (Takei & Tsai, 2013), where the obstacles are represented by environment or path constraints imposed on the motion of (2.2), and in 3D environment (Hota & Ghose, 2010;Pharpatara et al., 2015), or incorporation the effect of wind into the UAV flight (Techy & Woolsey, 2009).
We start the reformulation of HJB equation via PMP or DDP from the constrained optimal control problem whose cost is identity during the travel time which is required for the Dubins vehicle to move from the initial configuration to the goal configuration with the following constraints.
(ii) The set of admissible control A ad due to actuator saturation (equivalent to define the maximum angular velocity or maximum curvature of Dubins vehicle) is compact, convex. (iii) Safety/obstacle avoidance/state constraints on account of obstacles or forbidden zones: Let the signed distance field be positive, since ϕ k x ð Þ � 0 if and only if x 2 P k .
The state constraints enforced by the obstacles to be avoided define the feasible region by Ψ k x t ð Þ ð Þ � 0, t 2 0; T ½ �: For circular obstacle, the collision condition simplified to a safety zone represented by a circular constraint function x À r k � d s , where d s is a user-defined safety distance to account for the size of the vehicle, so that the robot could be reasonably shrunk into a point.
(i) The boundary conditions are given: The final pose could be relaxed to be a compact region � for different simulation purposes. Now, the value function (or so called cost-to-go function in control theory) of the problem can be so defined the minimum time cost of the path from an initial state x; y; θ ð Þ to the state Sinceα 2 A ad is with all aforementioned constraints satisfied, the definition is both valid with or without obstacles. If there is no feasible path z α � ð Þ x;y;θ ð Þ then we take the convention u x; y; θ ð Þ ¼ 1.

Remark.
Only convex state constraints resulting from nonlinear inequality constraints representing obstacle avoidance are considered, more complex nonconvex state constraints require additional transformation or convexification. In this formulation, obstacles are hard constraints so that the trajectory is dynamically feasible and is guaranteed to be collision-free, in addition to timeoptimal. Therefore, for guaranteed obstacle avoidance, obstacle is better represented as state constraint as above, instead of augmenting into the cost function.
The following restates essential principles and theorems used for derivation of the HJB equation for the Dubins vehicle (2.2) from the value function (2.4) using variational arguments.
THEOREM 1 (Bardi & Capuzzo-Dolcetta, 2008;Tonon et al., 2017): If the initial pose x; y; θ ð Þ is given, u x; y; θ ð Þ is defined by (2.4), then it satisfies the DPP (where the time stepτ is so small such that 0<τ<u x; y; θ ð Þ): Now applying Taylor expansion to u in (2.5), dividing by τ and let τ ! 0, we transform (2.5) to obtain the follwoing: Þ, since all possibly desired paths must satisfy (2.2) under any α 2 A ad , the above equation yields This concludes the optimal state feedback control, i.e. the optimal mapping from the optimal state trajectory to the optimal control trajectory, is determined by the sign of u θ which coincides the bang-bang principle that only one actuator is saturated (reaches the border of the input constrained set) at a time (2.7) coincides the bang-bang principle that only one actuator is saturated (reaches the border of the input constrained set) at a time. Thus, (2.6) leads to the HJB equation as introduced in (Takei & Tsai, 2013) which the value function u satisfies: which has the boundary conditions: where, (2.9) is trivial from the definition of (2.4), The infinite boundary condition (2.10) describes when the vehicle collides with obstacles, it will never go any further to the final pose. (2.11) is the periodic boundary condition because x; y; 0 ð Þ, x; y; 2π ð Þ denote the same pose of the vehicle. Since for linear/nonlinear first-order PDE, there is also a resolution method called the method of characteristics. As the PDE is (2.8), the equations of characteristic lines are: Remarks. (i) Since (2.7), the optimal control at any t>0 coincides to the bang-bang principle, it is necessary to make assumption that the obstacle boundaries have curvature larger than 1 ρ . (ii) HJB equation (2.8) derived from value function (2.4) also leads to the result that Hamiltonian is zero along the time-optimal trajectories of Dubins vehicle (2.2) for free terminal time (Szuster & Hendzel, 2018) and zero terminal cost (Mehrali-Varjani et al., 2018).
(iii) For any starting pose x; y; θ ð Þ such that u x; y; θ ð Þ is finite, there is an optimal control α � 2 A ad which navigates the vehicle from x; y; θ ð Þ to x B ; y B ; θ B ð Þ 2 �. From THEOREM 1, the value function decreases as the vehicle follows α � . Therefore, u x; y; θ ð Þ could not be a local minimum of the value function if u x; y; θ ð Þ is only finite.
(iv) A practical advantage of the optimal control in state feedback form (2.7) resulting naturally from the value function solution of the HJB equation (Guo & Wu, 2017) is robust with respect to computation and modeling errors (Mehrali-Varjani et al., 2018). Only the gradient of optimal value function (or the optimal value function over a small neighborhood) of the current state, is required for constructing time-optimal state feedback control (2.7). In addition, the HJB equation approach allows the construction of whole characteristic lines (2.12) for finding a time-optimal trajectories between any given pair of initial and final configurations in the free configuration space, while analytical or geometric construction based on Dubins path is feasible only for one specific pair of initial-final configurations and has the advantage of constant computation time, independent of the spatial and temporal resolutions or the number of grids and time step size.
However, on the region where either the obstacles occupy or no feasible path exists, the value function is infinite that causes ill numerical issues. To tackle with it, let's introduce the Kruzkov transform (Falcone, 2013;Tonon et al., 2017): So THEOREM 1 (or the DPP (Bardi & Capuzzo-Dolcetta, 2008)) should be rewritten for the corresponding new value function: With this transform, we could derive again via above process the following transformed PDE: which satisfies the corresponding boundary conditions: ( 2:16) For simplicity, we write H ¼ H Dw Now, the Kruzkov transformed value function (2.13) which is well-defined by (2.4) is the solution of (2.15) with boundary conditions (2.16). But what kind of solution is it? It is known that the Dubins vehicle does not satisfy the small-time locally controllable condition (or STLC condition) introduced in (Bardi & Capuzzo-Dolcetta, 2008;Takei & Tsai, 2013). That is equivalent to say w is discontinuous on a neighborhood of x B ; y B ; θ B ð Þ 2 �. Mathematically, there is not always the classical smooth solution for a general HJB equation with initial/boundary conditions. Therefore, several concepts of solutions (like, weak solutions, generalized solutions, viscosity solutions … etc.) are raised to overcome this drawback. In these solutions, the viscosity solution is well accepted as a reasonable solution. The "reasonable" means it may occur (or appear) in the real physical world. Another advantage of taking it as solution is it shares many good properties, including, existence theorem (by the method of vanishing viscosity or Perron's method), uniqueness theorem and stability (The uniform limit of solutions is a viscosity solution). However, in this case, we do not require the viscosity solution to be necessarily bounded and uniformly continuous. It belongs to a more general kind of solution called discontinuous viscosity solution, introduced in (Bardi & Capuzzo-Dolcetta, 2008;Takei & Tsai, 2013). In most cases, numerical schemes are required to solve the value function, or the time-optimal collision-free trajectory generation of Dubins vehicle (2.2). We should mention that there is a wealth of literature on numerical solutions of HJB equations. It is desirable to know which numerical schemes for which problem give the correct interpretation of results. The main goal of the case study of Dubins paths in this paper is to reveal the numerical issues related to accurate time-optimal trajectory computation for Dubins vehicle through the application of two numerical schemes for the considered HJB equation.

Remarks.
(i) In the case of constant speed, (2.2) is differentiated to obtain for a path composed of straight line and circular arcs so that dα ρ v 2 is the normal acceleration of the vehicle orthogonal to velocity, while the tangential acceleration is always zero for following a Dubins-like path composed of straight line segments and tangential circular arcs.
(ii) Depending on the level of complexity and accuracy of models required, the modeling issues such as incorporation of other quantities as state or control variables are related to model-based time-optimal trajectory and control. Differential drive mobile robot is a typical Dubins vehicle. It can be modeled as torque-controlled system, and when the vehicle is driven as fast as possible, its bang-bang control (input torque profile is at its limit) was solved by PMP (Poonawala & Spong, 2017). An extended acceleration-controlled Dubins vehicle model of (2.2) is to use instead of variable speed v (Ben-Asher et al., 2020;Wolek et al., 2016), the constrained tangential acceleration α 1 ¼ dv dt ; α 1 � α 1b as one input, in addition to the angular velocity input ρ v (or equivalently the lateral/normal acceleration α t ð Þ ρ v 2 ) that is orthogonal to the path tangent/velocity vector (Manor et al., 2018) as Dubins vehicle (2.2). The inclusion of non-zero tangential acceleration in vehicle model complicates the time-optimal solution. In (Manor et al., 2018), the solution to time-optimal trajectory of extended Dubins vehicle model involves the simple quadrature, and the gradient is computed by IPOPT or FALCON.m. Another aspect regarding the model is that he bound of admissible control/curvature in (2.2) is assumed symmetric so that both right and left turn are allowed, as well as zero input that yields straight line motion. The work (Fedotov & Patsko, 2018) considers the general bound on the admissible control, which can be asymmetric and not include zero input. Another work (Zollars et al., 2018) considers the use of angular acceleration (second derivative of heading) as the control input to Dubins vehicle.

Two numerical schemes
HJB equations are a general type of PDEs which comes from many different fields, like optimal control and trajectory optimization of mechatronic systems studied in this paper, differential games (Botkin et al., 2011), geometrical optics and computer vision. Eikonal equation is one well-known example of HJB equations that motivates the FSM and other numerical techniques. This section introduces the methods of our numerical implementation for two-point boundary value problem resulting from the necessary time-optimality condition.

Brief on numerical methods for HJB PDE
A HJB PDE can be solved numerically in different ways. It is well understood that there is no general numerical method for all kinds of HJB equations in terms of accuracy and efficiency. FDM and finite element method (FEM) are two dominant numerical methods for solving PDEs. The former is via direct discretization called finite differences for approximating gradient of value function and the latter uses a linear combination of basic functions such as polynomials or trigonometric polynomials to approximate solutions of variational formulations. Because the HJB equations and hyperbolic PDEs of conservation laws have many mathematical similarities in common, advances in the conceptual principles and higher-order methods for conservation laws are borrowed as effective solvers for the HJB equations (Kao et al., 2004;Tsai et al., 2017;Zhao, 2005Zhao, , 2016. Firstly, Crandall and Lions (1984) and Michael (1983) first proposed not only an adequate weak solution for HJB equations, namely, viscosity solution, but also along with a principle that any monotone, differenced form with consistent numerical Hamiltonian must converges to its viscosity solution (Crandall & Lions, 1984). Now it is well understood that the convex HJB equation can be solved with monotone upwind scheme on general meshes, such as discussed in (Wang et al., 2000).
For a time-independent HJB equation, as the discretization of HJB equation (2.15) is determined, a suitable iteration method is needed because the equation is lack of time-evolution. The FSM is a well-known iteration method which is firstly invented in (Zhao, 2005). It is a powerful and effective method for computing first-order linear or nonlinear PDE solution due to two reasons: (i) it matches the corresponding upwind direction that allows information along characteristics efficiently; and (ii) it is an iterative method which applies the Gauss-Seidel method to accelerate convergence based on the idea of alternating the order that the grid nodes are visited with different directions in which characteristic lines might be along (Zhao, 2005(Zhao, , 2016. To (i), it can be shown that a consistent upwind scheme is a monotone differenced form and therefore, it converges to the viscosity solution with at most first-order accurate (Crandall & Lions, 1984). The Hamiltonian in Godunov scheme from solving conservation laws is one example of such schemes. For solving stationary HJB equation, FSM iteratively evaluates the values upwind (i.e. propagates the information upward to a neighboring grid with subsequent path cost decreased) or along characteristic lines for updating the solution. FSM is faster with complexity O (N) and easier to implement than FMM which is with complexity (NlogN) (where N is the number of grid points used in the grid system) (Zhao, 2005(Zhao, , 2016. To the other key ingredient, the motivation behind it is the information of solution of the HJB equation propagates along characteristics. All characteristics can be divided into a finite number of pieces according to their directions and each one can be covered by one of the sweeping orderings simultaneously. The number of iterations is proportional to the maximum number of pieces for all characteristics. Moreover, values at all grid points are monotonically nonincreasing with iterations. Once the correct value at a grid point is obtained it will not be changed in later iterations (Zhao, 2016).

Solving numerical schemes by fast sweeping method (FSM)
Though both time-optimal control and state trajectories can be obtained by numerical methods of solving Kruzkov modified HJB equation, implementation issues encountered are: (i) The numerical solvers are iterative in nature, where the update direction and the step size of each iteration need to be computed. (ii) In addition, choice of initial guess and avoiding stuck in local minima such as saddle trajectories are required for fast and accurate convergent solution. A choice of an appropriate numerical scheme is essential to obtain a satisfying solution for the specific problem considered here with a compromise between accuracy (time step for numerical integration and state grid resolution) and speed or real-time feasibility (computation time). The choice should be on the basis of implementing numerical solvers, possibly combined with the knowledge of the problem or the system. In this section, among a large class of numerical methods available for solving the value function of the discrete finite-time HJB equation, we use the fast-sweeping method (FSM) (Takei & Tsai, 2013;Tsai et al., 2017;Zhao, 2005Zhao, , 2016. For FSM, ordering of grid nodes is based on causality principle. Two historical numerical schemes, numerical Hamiltonian in Godunov scheme and semi-Lagrange method, are introduced here, where (2.14) is the foundation of semi-Lagrange scheme (Bardi & Capuzzo-Dolcetta, 2008;Takei & Tsai, 2013) and (2.15) is the foundation of Godunov scheme. One reason for the choice of the methods to use is both methods are based on FDM, which is robust and easy to implement. The other is accuracy of first-order methods suffices for presenting time-optimal, collision-avoidance trajectory generation via HJB equation approach. The optimality (approximation error) of the paths obtained using various numerical algorithms is controlled by the grid resolution and time discretization, which are shown later in simulations.

Godunov scheme
We first discretize the transformed HJB Equation (2.15) in state space. By spatial discretization of the computational domain of configuration space Ω pose (as depicted in Figure 2) into N x � N y � N θ grid points with grid size h x ; h y , respectively, in x-,y-variables which corresponds to the discrete θvariable with grid size h θ in [0, 2π]. Let the notation be the approximation value function of w at the grid point x i ; y j ; θ k À � .
The derivatives of w with respect to the arguments are then approximated by the corresponding finite difference expressions. Thus, the approximated sided-differences with respect to x is defined: As being introduced in (Kao et al., 2004;Tsai et al., 2017;Zhao, 2005), the Godunov Hamiltonian scheme for a nonnegative, Lipschitz continuous and strictly convex Hamiltonian (which (3.15) satisfies) is provided as the following: p � , q � , r � are variables with respect to the different finite difference to x, y and θ with þ for forward difference and À for backward difference.
By substituting sided-differences into (3.1), it becomes: After brute computation one case by another, each ext term becomes: Now, applying the fast sweeping method with Gauss-Seidel-iterations whose appropriate ordering of grids gets the numerical solution. Note, we can solve W ijk from (3.2), (3.3) to obtain the following: if last ext of (3.3) is nonzero and obtain if the last ext of (3.3) is zero. Since the transformed HJB Equation (2.15) is time-independent, solving (3.2) needs iteration method. Since (3.3) has two possibilities of evaluations while (3.4) has only one. By the principle of FSM, the updated value is the minimum of all candidates (3.4), (3.5) and W n ijk : In the end, for computational implementation, the initial value is set by the following: And the convergence criterion for the iteration methods in this study is set in the infinity norm as kW nþ1 ijk À W n ijk k 1 <� with a small positive stopping tolerance �. The tolerance is used to control the computation accuracy and the required computation time. Note that error in the infinity norm is always larger than error in the 1-norm (Manor et al., 2018).
Godunov Hamiltonian scheme is first-order accurate by truncation error, but it is shown in (Crandall & Lions, 1984;Michael, 1983;Takei & Tsai, 2013) that the order of accuracy is only half , h is the grid size of each variable) commonly happens even when the desired viscosity solution is discontinuous. We list Algorithm 1, the pseudo code of solving Godunov scheme by FSM.

Semi-Lagrange scheme
Semi-Lagrange schemes are also another popular numerical way to solve HJ equation in general. It is based on roughly discretizing and approximating the formulation of HJB (2.14) and characteristic equations (2.12). The first-order scheme is also convergent at most half order accurate to the viscosity solution (Takei & Tsai, 2013). In our numerical simulations, that the actual order of accuracy is low. There are possible two reasons: (i) the constraint of order of accuracy of scheme used; (ii) the viscosity solution (same as the value function (2.13)) is discontinuous. The first-order semi-Lagrange scheme with linear interpolation is by first to choose the time step τ � min hx;hy ;hθ f g v (this constraint is followed from THEOREM 1) and apply the locally bang-bang control in each time step to (2.14), then (2.12) can be integrated over time to determine the state at each grid. We use forward Euler method, because of its simplicity of implementation, to obtain Since there are three choices for control U 2 0; �1 f g; we obtain three possible results of such The same convergence criterion on Godunov scheme is used to terminate the iteration of FSM.
The following Algorithm 2 is a pseudo code for FSM with semi-Lagrange scheme.   This gives how the system state evolves under time-optimal control sequence. The control is represented as a sequence of gradient of value function of HJB equation, which is analytically piecewise constant of 0, 1, −1, and the state is piecewise-constant trajectory solved from the Dubins vehicle kinematics. The optimal trajectory segment corresponding to α ¼ 1 can be obtained by integrating (3.6). The resulting trajectory takes the form

Numerical methods for solving characteristic lines equations
where c 1 ; c 2 are constants. Clearly, this is a circle for (x, y) with center (c 1 ; c 2 ) and radius v. Similarly, for α ¼ À 1, where the heading is fully reversed. For α ¼ 0, the optimal trajectory takes the form Typically, sampling instants are when the control inputs are applied. Let the time discretization step size be Δt: To compute the optimal control based on approximation of gradient of value function u θ , one can use forward Euler method with the piecewise constant gradient computed by the centered-difference on the given numerical value function U ijk on all of the grid points. By propagating the initial configuration (3.7) and (3.6) via optimal control, the Dubins vehicle model (2.2) along the state and control trajectories is discretized, yielding a discrete-time dynamical system controlled discretely of the form (3:7) where Δtv is the linear travel distance of Dubins vehicle (approximately the arc length s t n þ Δt ð Þ À s t n ð Þ in one time step ΔtÞ. Or to compute the grid-dependent trajectory z n :¼ z Þ by a forward integration of determined by the input sequence via Dubins vehicle kinematics, in each iteration (3.8) is written in compact form as This model is used to generate a system of characteristics lines in each iteration from any z 0 at t = 0 to arbitrary z B ¼ x B ; y B ; θ B ð Þ T at t � T in free space. The numerical path will be a finite sequence of such characteristic line in each iteration, verified as approaching the time-optimal collision-free trajectory from an initial pose z 0 to the final pose z N : However, as the numerical experiments in Section 4 show, the grid resolution and time discretization step would be sufficiently small.

Applications of CSC Dubins path parametrized by switching times
In particular, we establish some properties for verifying the switching structure of numerically obtained CSC type Dubins path. For steering a Dubins vehicle along a CSC Dubins path, given a time step size, the applied control is α 1 ; α 2 ; α 3 2 À 1; 0; 1 f g: The time-optimal open-loop control for CSC path is bang-singular-bang sequence, which can be parametrized in terms of two switching points between two segments or three durations of the first, second and the last path segment. Let the two control switchings of curvature at t sw1 ¼ s sw1 T 2 0; T ð �; t sw2 ¼ s sw2 T 2 t sw1 ; T ð � happen at configuration z(t sw1 ), zðt sw2 ) at path length s sw1 ; s sw2 ; respectively. From (3.6), it is seen that the position x; y ð Þ depends only onθ. Note thatθ t sw1 ð Þ ¼ θ t sw2 ð Þ is the slope angle of the tangential line of CSC Dubins path. For simplicity, consider the control command sequence of α t ð Þ to be −1, 0,-1 for LSL type Dubins path. The heading changes linearly with slope À v ρ on the first segment duration [0, t sw1 � from θ A , maintain a constant heading θ t sw1 ð Þ on the second segment duration [t sw1 ; t sw2 �; and finally another linear change of slope À v ρ from θ t sw1 ð Þ to θ B on the duration [t sw2 ; T� of final segment. By integrating the third equation of (3.6) from initial configuration with optimal input sequence −1, 0, −1, the final heading is obtained as Thus, T þ t 1 À t 2 is a constant. Similarly, from The first integral on right-hand-side is a constant since T þ t sw1 À t sw2 is a constant. It implies that the interval t sw2 À t sw1 in the second integral is also constant, regardless of that T is a priori unknown. Therefore, for CSC type Dubins path, T þ t sw1 À t sw2 is the total time interval for two arcs, while t sw2 À t sw1 denotes the time interval of line segment portion of the path. Both time intervals are constant, and can be a priori determined solely from the given boundary conditions and minimum turning radius. Therefore, there are two control (curvature) switching times but only one control switching time t sw1 is an unknown constant to be determined optimally by timeoptimal control over [0,T] (Fedotov & Patsko, 2018;Poonawala & Spong, 2017). This corresponds to the Dubins path of CSC type has to determine the first tangential point on the initial turning circular arc of minimum radius ρ. It can be determined analytically (via Euclidean geometry) or numerically, as we demonstrate in the following section. Therefore, in addition to the switching structure revealed, an important characteristic of CSC Dubins path (for UAV flight for example) is that the path length is predictable before the path is actually computed or executed.
Remark (analytical justification of CSC type Dubins path). Instead of time-discretized equation of motion (3.8) for numerically obtained CSC type Dubins path, or geometric computation of Dubins path, the optimal trajectory takes the following form by integrating the Dubins vehicle kinematics corresponding to α ¼ 1; À 1; 0.
where C 1 ; C 2 ; C 3 are constants. This is a circle equation in x; y ð Þ with center C 1 ; C 2 ð Þ and radius v.
• If α ¼ À 1 (right bang), then similarly the optimal path is a circle with the heading fully reversed.
where L 1 ; L 2 ; L 3 are constants. This is a line equation with slope L 3 : It is the common tangent required to connect the two incoming and departing circles of maximum curvature passing, respectively, the initial and the target configurations, if the distance between them is large enough, as Dubins path verifies.

Validation of numerical results
For different initial and final configurations, there are different valid trajectories that can be generated. In the absence of obstacles, the curvature-constrained shortest path is unique and hence global optimal. Geometric analysis of the optimal trajectories and understanding of the vehicle physics are necessary for a satisfying computational approach for optimal maneuvering based on PMP, as proposed in (Zhu et al., 2017). Following this, we bring together the numerical solutions of HJB equation for time-optimal control of Dubins vehicle and well-established geometry of Dubins path to provide the insights into the problem and solution structure. In this section, for a case study of numerical issues such as solution validation and error analysis, we restrict the Dubins path (optimal state trajectory) to the CSC type resulting from bang-singular-bang control input sequence (Yang & Kapila, 2002), one of the most commonly occurred shortest paths (Techy & Woolsey, 2009), for simplicity of demonstrating and verifying the numerical results of time-optimal state-to-state transfer trajectory. For CSC type path, its analytical algebraic solution in the absence of obstacles can be computed exactly using geometric method. This known exact solution is used in the first two examples for the validation of feasibility (satisfaction of the input constraint) and time (or length)-optimality of input and state trajectories simultaneously obtained with both numerical solvers. In cluttered environment, even simple obstacles add significant complexity (with challenging geometry and topology of solution space) to the shortest path problem. We will demonstrate in last two test examples that the numerically obtained paths satisfy the safety and curvature constraints (the input and state constraints) at the expense of sacrificing the travel time. In addition, we will compare the numerical path and heading with those obtained analytically or by Hybrid A* in these examples. Level curves for the numerical schemes are also shown.
In the following simulations, the C++ implementations of numerical schemes follow the outline of Algorithm1 and Algorithm 2 running on a notebook PC with 1.60 GHz CPU: 8GB RAM. The workspace in all simulations is given by a bounded square domain Ω ¼ À 10; 10 ½ � � À 10; 10 ½ �: The inadmissible regions (no-fly zones) introduced by obstacles are represented as identical unit circles defined by their centers. The Dubins vehicle is a point with constant vehicle velocity v ¼ 1 and the minimum turning radius ρ ¼ 1: The Dubins vehicle is required to steer from any initial configuration x A ; y A ; θ A ð Þ in the free workspace to a distant goal configuration x B ; y B ; θ B ð Þ in the free workspace without collisions with the obstacles in least amount of time. In the simulations presented here, the convergence is defined as if the state error norm of the successive iteration is less than a stopping tolerance � ¼ 10 À 10 as aforementioned in Section 3.2, not too fine with respect to the accuracy of numerically computed gradient.
A way of visualizing the value function is through level sets, i.e. the level curves of the viscosity solution (level-curve field). The level curve is formed from the set of all points corresponding to contours of the value function (2.4) at the same timet>0. Thus, to obtain the level curves, it is necessary to consider all the x; y; θ ð Þcorresponding to value function with the same travel time t: Then the time-optimal path starting from an initial configuration has a headingθnormal to the level curves. In terms of the optimal vector filed f x; y; θ; α � ð Þ of Dubins vehicle (2.3) moving along time-optimal path, the optimal heading is the projection of f x; y; θ; α � ð Þ onto the x-y plane, which should be normal to the level curves at each point x; y ð Þ along the path (cf. Figure 2). This is used in the following simulation to visualize the heading error of each numerically obtained path.

Example 1. Dubins path in an environment without obstacles in the workspace (Ground truth comparison)
In the first example, we present validation-based performance studies on the accuracy, and computation time of time-optimal trajectory and switching structure (number, types and times of control switching). We are given the initial pose x A ; y A ; θ A ð Þ ¼ À 8; 0; 0 ð Þ; thegoal pose x B ; y B ; θ B ð Þ ¼ 6; 0; 0 ð Þ. Note that as θ A ¼ θ B , the shortest state-to-state transfer path is the straight line between the given two poses. The exact solution, i.e. CSC Dubins path, has analytical expression for a pair of initial and final poses and thus its length is known (Dubins, 1957). To verify the appropriateness of the numerical schemes for time-optimal trajectory generation, the optimality of the numerical trajectories that are obtained after hundreds of iterations of running numerical schemes (or convergence of numerical trajectories to Dubins path) is checked in this simulation.

Accuracy assessment
The numerical HJB solvers with user-specified tolerance to determine the optimal state and control trajectories are iterated by increasing the precision of the discretization in state and control (number of grids used). Table 1 provides an accuracy assessment of the resulting numerical solutions. It shows the L 2 errors and the orders of accuracy of each numerical method in terms of the error measured in L 2 norm with respect to the Dubins paths. The order of accuracy p is obtained by L 2 error denoted by Error , where U ijk is obtained by inversely Kruzkov transforming the convergent result W ijk . Table 1 reveals the following observations. For numerical methods, the discretization of state and admissible control sets causes approximation errors and the propagation of errors through Dubins vehicle motion, and thus traversal time error. This is due to motion transition where control is applied can occur only at grids and at sampling times. As shown in Table 1, the error norm decreases as the resolution is finer at the price of increased computation time. As is usually the case, it is essential that the rate of convergence and accuracy for calculating time-optimal state-to-state transfer path is also inherently limited by the grid resolution of discretizing configuration space (the number of grids) and time discretization step size of integrating Dubins vehicle kinematics equation, however the effectiveness is algorithm-specific. As indicated in this simulation, both methods match the results and estimates by Crandall and Lions (Crandall & Lions, 1984), i.e. Error L 2 e O Δx p ð Þ, where p is nearly 1 2 . From our numerical simulations, the order of accuracy by using Godunov Hamiltonian scheme is slightly better than that by semi-Lagrange scheme, i.e. less approximation error of time-optimal path is induced by the use of Godunov scheme. The accuracy enhancement (correct grids closer to optimal trajectory are selected) of Godunov scheme over semi-Lagrange scheme is even better as the resolution of discretization is finer (e.g. grid number in the computational domain is larger than 80).

Computational demand
For computation time, the analytical Dubins path has a closed-form, thus it can be computed accurately and fast, suitable for online computation. On the contrary, an advantage offered by the time-optimal trajectory of Dubins vehicle computed by numerical schemes (such as Gudunov numerical Hamiltonian and semi-Lagrange in this paper) for HJB boundary value problems is that it is in feedback form. However, accuracy of computation of switching structure, which may be required in some applications, depend strictly on the resolution for each state variable discretization and time discretization. In addition to that, Table 2 shows the computation time of each numerical scheme with respect to the grid number N ¼ N x � N y in Cartesian space with the same spatial resolution in x-, y-coordinates. Note that a reduction of grid resolution by a factor r, the number N of grid points in the computational domain increases by a factor r 2 . As expected, solving a HJB PDE with fast sweeping method spends a computation time proportional to total number N. The reported time in Table 2 is high since it covers all pairs of arbitrary initial and final configurations in the free configuration space of computational domain (finding solutions over the entire configuration space), instead of yields a single trajectory of state and control. The computation time of both state validity check and finite difference gradient over the whole discretized state space adds significantly to the overall time required. In all cases, the computational time grows The time costs increase as grid number increases. In our simulation results, Than semi-Lagrange scheme, Godunov scheme not only saves more time but is closer to complexity O N ð Þ, where N ¼ N x � N y � N θ , which is known as the ideal one of FSM. Step 2 and Step 3 is the main body of FSM. The time costs increase moderately with the resolution. The time cost of semi_Lagrange scheme is much larger than Godunov scheme.
quickly with the spatial resolution, while that of Godunov scheme varies slower than that of semi-Lagrange scheme. For further analysis of the computation time, Tables 3 and 4 show detailed computation time of the steps of running Algorithm 1 and Algorithm 2, respectively, for Table 2. To verify the presented numerical algorithms, since the objective is to reach the goal with shortest distance under the kinodynamic constraints, we implement a discrete approximation algorithm Hybrid A* (Dolgov et al., 2008). Hybrid A* is a classical search method A*, a common option for shortest path planning, in conjunction with an admissible heuristic. This heuristic estimates the distance from current configuration to the goal configuration and that from the initial state to the current state the Dubins vehicle would actually follow. There are a number of heuristics that can be defined, for example, the admissible heuristic can be built on the known Dubins path or Euclidean distance without obstacles in the search space of configuration space. Instead of Euclidean distance, the length of Dubins path is much closer to the minimum distance a Dubins vehicle must travel to reach the target from the start in constrained configuration space. The length of Dubins path is more appropriate as admissible heuristic of Hybrid A*. Hybrid A* searches the lowest cost state as the next state until the goal state is reached, however, the admissible heuristic might be able to generate only suboptimal solutions or even optimal solutions in very rare situations. To apply Hybrid A*, the state space is discretized into N x � N y � N θ grid, where the discretization of orientation increases the dimension of search space of Hybrid A*. To find the path, Hybrid A* needs to expand to search the decent direction θ that minimizes the travel time by setting one more tuning parameter of path step size l to determine the next path point from current point and control the segment size of the discretized path produced by the search. The family of oriented points found by Hybrid A* with given initial configuration, set of discretized orientations and path step size l for path optimization, ignoring the smoothness of path, fully describes a piecewise path that would not be smooth. We set path step size one (l = 4 grid size) for the constant velocity Dubins vehicle in the simulation. We carry out simulation experiment of this example whereas running Hybrid A* using the heuristic of Dubins path on a different but better notebook PC (Intel i5-7200, RAM12G with Python) with path step size equal to 4 grid size. In addition, a fairly coarse orientation discretization for fast computation causes a large variation of orientation, while finer resolution of state discretization to increase the accuracy of solution will cause the size N x � N y � N θ of search space grow quickly, thus the computation time. In our implementation, the orientation is discretized into N θ ¼ 80 states. It is noted that the path step size of numerical methods in our implementation is path step size Δt ¼ min hx;hy;hθ f g 10 and N θ ¼ 80: Therefore, the accuracy of numerical methods at a given resolution is higher than Hybrid A* search.
In summary, Tables 1 and 2 together show that numerical path accuracy of the schemes based on FSM can be improved by employing higher resolution square grid at the cost of linearly increased computational effort. The example 1 also shows significant benefits in both accuracy and computation time by Godunov scheme over those by semi-Lagrange scheme in high-resolution grid. Tables 1 and 2 carefully represents time costs in each step of each algorithm introduced in Section 3.3.

Example 2 (Dubins path)
Thanks to the availability of the exact solution of the considered HJB equation, which a closedform explicit expression is obtained directly as Dubins path, it is possible to compare the influence of numerical HJB solvers derived from necessary optimality condition due to discretization on the quality of each path resulted from both numerical schemes in terms of the accuracy or optimality. In this example, we compare the analytical Dubins path with numerically obtained characteristic line of HJB equation based on numerical value function which has the effect of numerical errors. We are given the initial pose x A ; y A ; θ A ð Þ ¼ À 6; 6; π It could be visualized in Figure 3 that good collision-free trajectories close to the time-optimal trajectory (the analytical Dubins path) are obtained by numerical schemes. Figure 4 shows plots of heading angle θ vs arc-length s, where it is seen that that the final heading angle is achieved by numerical trajectories. The numerical results also verify that additional necessary optimality conditions for the Dubins path of the type LSL (Techy & Woolsey, 2009) within the families of CSC aforementioned, but here L denotes left (counterclockwise) turn, is the sum of angles of the initial and final circular arcs, each within 0; 2π ½ Þ, is less than 2π: This validates that the solutions obtained by numerical and analytical method are in excellent agreement. Furthermore, the path and length computed by Godunov Hamiltonian scheme is closer and more accurate to the analytical Dubins path than by semi-Lagrange method. And the overall convergence rate of semi-Lagrange scheme is lower than Godunov scheme.
In a cluttered environment of Examples 3 and 4 presented in the following, analytical collisionfree Dubins-like paths could be generated via beginning and ending tangential circular arcs and line segments, as an alternative open-loop approach to numerical methods (Liang et al., 2015;Yang & Kapila, 2002) for comparison. In simulation Examples 3 and 4, by taking advantage of Dubins path as part of collision-free path generation: it follows the boundary of the circular obstacle when in close proximity, and follows the tangential line when between two circles to shorten the path.

Example 3 (Time-optimal collision-free path planning)
Same as Example 2, except the initial pose x A ; y A ; θ A ð Þ ¼ À 8; 0; 0 ð Þ, and the final pose In the absence of obstacles, the Dubins path is the horizontal line segment fromx ¼ À 8to8: Suppose there are four circular obstacles of radius 1 with center located at obstacle avoidance, it suffices to use the tangential lines connections between the initial turning circle and an entrance point on the obstacle circle with radius greater or equal to 1, follow the obstacle boundary to another exit point on the obstacle circle, then exit from this point on the obstacle circle to the goal turning circle (Yang & Kapila, 2002). This analytical path based on geometric construction for this example has the length 2ρ π À 2θ ð Þ þ 2 ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi 65 À 2ρ ð Þ 2 q ,where θ ¼ arctan ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi 65 À 2ρ ð Þ 2 q 2ρ 0 @ 1 A þ tan À 1 1 8

� �
In Figure 5, we show the numerical collision-free paths and an analytical path for this example, and the evolution of heading change, which depends on the discretization of orientation, along the path is shown in Figure 6.
ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi 61 À 8 ffi ffi ffi 2 p p 2 ! À tan À 1 ffi ffi ffi 2 p 16 À ffi ffi ffi 2 p ! Figure 7 shows the paths obtained analytically and numerically. Figure 8 demonstrates the heading evolution along the analytical Dubins path and the numerically obtained paths in this simulation.
In practice, suppose the selection of obstacle to be avoided at the current vehicle position is determined. It is advisable to set a safety zone for the obstacle to be avoided to account for the vehicle size and the uncertainties in the detected obstacles, map, control and modeling. To explicitly avoid generating paths that are too close to the obstacle, a clearance is added to augment or dilate the obstacle to enlarge the area that obstacle may occupy so that the distance between the vehicle and the obstacle is kept from a safety zone. The clearance is used to account for the magnitude of uncertainties in obstacle geometry and location sensed by the sensors, inaccuracy in navigation and the vehicle size. To show the effect of setting clearance around the obstacle, two collision-free paths for Example, 3, 4 are shown, respectively, in Figure 9, where the obstacle to be avoided is enlarged by expanding the radius of the obstacles to radius 2.0 for setting a safety margin around the obstacles. We see that the obtained Dubins-like path has a path length a little longer with a larger turn but keeps a larger distance to the obstacle for the benefit of safety. As can be seen, the paths depicted in Figures 5, 7 and 9 composed by the path primitives consisting of circular arcs and line segments respect the safety constraint in clufsttered environment, either following the border of an obstacle or very close to the border of an obstacle when in close proximity to shorten the length, as mentioned previously. In Figure 10, we show another class of valid paths generated with Hybrid A* using the heuristic of Dubins path or Euclidean distance (Dolgov et al., 2008) for Example3 and Example 4 in a cluttered environment. The resulting path generated by Hybrid A* in Example 3 is comparable to Dubins-like path in length since a large portion of the path is straight. However, the path generated by Hybrid A* search method in Example 4 contains more small detours in turning motion due to grid resolution to meet the curvature constraint, thus longer and needs path smoothing for Dubins vehicle. For these examples, the path can be searched within 1-2 s. However, for more accurate search, the computation time dramatically increases.
In the case of more complex environment, waypoint navigation of Dubins vehicle is applied so that a UAV visits a sequence of subgoals sequentially (Yang & Kapila, 2002) and remains constant speed between consecutive waypoints to collect or deliver data. The ordering and configuration of the waypoints could be determined a priori, and the desired state (configuration) corresponds to the waypoint to be reached. In our approach of considering only the Dubins-like path, continuously planning Dubins-like path connecting two waypoints could be simply based on Dubins path or applying the numerical approaches based on HJB equation, as we have demonstrated by the above instances of path generation. The computation time increases with the number of waypoints to be traversed by Dubins vehicle. Very recently, in (Chen & Shima, 2019), shortest Dubins paths of 18 types constituted by a concatenation of the successive Dubins paths of CSC or CCC types between two consecutive configurations are derived for passing through three consecutive points with specified initial and terminal headings, where the optimal heading at the intermediate waypoint can be iteratively determined by finding the zero of a polynomial. It is clear that other path primitives such as Bezier curves or B-spline curves (Rousseau et al., 2019), not discussed here, could be employed for waypoint navigation with complex flight trajectories to accomplish different tasks.

Remarks on errors sources
The switching structure (i.e. discontinuities of control) of state and control trajectories such as the exact switching time t sw2 of CSC Dubins path, as evident from Figure 4, is not detected accurately or aligned with the time grids when approximating the bang-singular-bang solutions using state space discretization based numerical methods with fixed time step size for numerical integration using forward Euler method. The error in heading, which ideally is tangent to the path, for  numerically obtained trajectory is more evident in Figure 6. A thorough analysis of the overall numerical error should consider several factors: (1) After discretization, the accuracy of numerical methods for the boundary value problem of HJB equation for the approximation of value function is inherently limited by the resolution due to the way in which the gradient of value function is approximated. This is because the Dubins vehicle is allowed to change the values of state, control (i.e. gradient of optimal value function) only at the state space grids and time grids at which the control and path constraints are only enforced, while the constraints may be violated and control switching can occur between the space grids and time grids in real situations. The approximate value function over the entire state space is obtained by interpolation between neighboring grids, thus incurs additional interpolation error (Kang & Wilcox, 2017). Thus, it is essential to apply the higher order more accurate Runge-Kutta method or use a smaller time step size for integrating the Dubins vehicle kinematics to produce more accurate state at a grid for fixed state-space resolution or use more and finer grids for solving HJB equation. (2) The propagation of numerical errors through vehicle motion and constraint sets from the view of computational performance.
To sum up, due to discretization, only a subset of possible motions is generated and this limits the accuracy, besides the interpolation error and error propagation through the integration of vehicle equation over time. The overall numerical error tendency in Table 1 leads to a general conclusion about accuracy improvement by finer grid resolution, despite the numerical schemes used to compute the time-optimal trajectory. Specifically, Table 1 reveals that a finer grid leads to moderate accuracy improvement for Godunov scheme over the semi-Lagrange scheme. A general strategy is that we can use the information of switching timest sw1 ; t sw2 (Section 3.4) obtained during simulations to (re)set the time step or using variable time step size until a satisfactory accuracy (or aggressiveness in our case) is achieved.

Conclusion
UAV is an emerging technology, and Dubins vehicle is an ideal kinematic model for constant speed UAV level flight at low constant altitude above ground level in two-dimensional plane. Dubins path is the analytical shortest path between two configurations for a Dubins vehicle. This paper focuses on a class of CSC Dubins-like paths that begin and end with circular arcs of radius not larger than minimum turning radius, precisely composed by a middle line segment connected to tangential circular arcs for heading change at the initial and final configurations. This class of path is feasible for tangent-continuous constrained level flight path generator of constant-speed Dubins vehicle. The path is generated as feedback motion using the approach of HJB equation derived from the necessary condition of time-optimality of state (position and heading) and input (curvature) trajectory in cluttered environment (Takei & Tsai, 2013) modified via Kruzkov transform to tackle with the scaling of the initial condition (such as in the region neighboring the obstacle). The HJB equation approach produces feedback time-optimal control and trajectory, and allows the construction of whole characteristic lines for time-optimal trajectories for any pair of initial-final configurations on a computational domain. For optimal trajectory computing techniques, all of which requires the choice of an analytical method or most often numerical methods. We implement two historical numerical schemes for modified HJB equation to reveal the appropriateness and what resolution of the state, control and time discretization is required for time-optimal trajectory by each numerical scheme. For computational efficiency and path quality, it is seen by a reference to the path produced by Hybrid A* search, the numerical HJB solvers are appropriate. The nearness of trajectories obtained by numerical schemes to the analytical Dubins path of CSC type in a map without obstacles is observed even for a few number of grids, and is enhanced if the grid resolution is finer. Furthermore, Godunov numerical scheme exhibits better performance in generating a position, heading trajectory and curvature profile of Dubins vehicle, guaranteeing collision-free and near time-optimal in cluttered environment. However, to obtain accurate switching structure of time-optimal trajectory that may be essential for some applications, it is observed that in addition to finer grid resolution, time step for generating characteristic lines of Dubins vehicle should be correspondingly smaller than the convergence requirement, preferably taking advantage of the switching time information obtained from the simulations. In the future, it is thus possible to online generate collision-free time-optimal trajectory of Dubins vehicle such as level flight of UAV with optimal state feedback control for more complex scenarios, for example, pursuitevasion game (such as racing drones) or incorporation of the vehicle motion constraints such as kinodynamic constraints such as vehicle handling limits (velocity and acceleration constraints), in addition to curvature constraint considered in this paper, via HJB equation approach with newest class of faster numerical schemes, and compare with other flyable paths. Furthermore, additional input such as the velocity of Dubins vehicle can be considered (Ben-Asher et al., 2020;Wolek et al., 2016), and complex switching structure can be generated.