Generating Large-Scale Trajectories Efficiently using
Double Descriptions of Polynomials
Abstract
For quadrotor trajectory planning, describing a polynomial trajectory through coefficients and end-derivatives both enjoy their own convenience in energy minimization. We name them double descriptions of polynomial trajectories. The transformation between them, causing most of the inefficiency and instability, is formally analyzed in this paper. Leveraging its analytic structure, we design a linear-complexity scheme for both jerk/snap minimization and parameter gradient evaluation, which possesses efficiency, stability, flexibility, and scalability. With the help of our scheme, generating an energy optimal (minimum snap) trajectory only costs 1 per piece at the scale up to 1,000,000 pieces. Moreover, generating large-scale energy-time optimal trajectories is also accelerated by an order of magnitude against conventional methods.
I Introduction
Smooth polynomial trajectories generated from minimizing jerk/snap are widely used in the navigation of quadrotors [1, 2, 3]. Among these applications, the double descriptions of polynomial trajectory are frequently involved. One description, consisting of piece coefficients and piece times, is convenient for cost evaluation and trajectory configuration. Another description, consisting of piece end-derivatives and times, is convenient and stable for cost minimization [4].
Although these double descriptions offer an efficient and accurate way to obtain energy-optimal trajectories, the overhead and instability are often inevitable caused by numerical transformations between them [5]. Besides, piece times are coupled into transformations. Without knowing its structure, directly optimizing times becomes hard or quite inefficient. In this situation, many perturbed energy-optimal trajectories are often generated to obtain gradient information [6], thus ruining the convenience from descriptions.
To overcome these drawbacks, we study the transformation between double descriptions. Its concrete structure and analytic expression are clearly provided, which is indeed a diffeomorphism. Leveraging its analytic form, we first design a scheme for linear-complexity jerk/snap minimization. Unnecessary computation on transformation is eliminated from this scheme, making its speed faster than many known schemes by at least an order of magnitude. Utilizing the smoothness, we also derive an analytic gradient for waypoints and times, which also enjoys minimal complexity. The exact gradient information makes it possible to directly optimize all parameters under complex constraints.

In this paper, we propose a framework based on the above results. Provided with a collection of waypoints and piece times, the minimization of jerk/snap is taken as a black box with promising efficiency. Through the cheap exact gradient, our framework directly optimizes intermediate waypoints and piece times to meet the safety constraints and dynamic limits, respectively. Its flexibility and efficiency are validated by applications and benchmarks on classic problems. Summarizing our contributions in this work:
-
•
An analytic transformation between double descriptions is derived.
-
•
A linear-complexity minimum jerk/snap solution is designed with extreme efficiency.
-
•
An analytic gradient for waypoints and piece times is provided with linear complexity.
-
•
Applications and benchmarks on classic problems are provided to validate the superiority of our framework.
-
•
High-performance implementation of solution and gradient computation are open-sourced for the reference of the community111Source code: https://github.com/ZJU-FAST-Lab/large_scale_traj_optimizer.
II Related Work
Quadrotor trajectory planning using polynomials has been prosperous since Mellinger et al. [6]. They eliminate differential constraints from quadrotor dynamics via differential flatness. Then, enough smoothness of flat output trajectories guarantees the constraint satisfaction by default. It is thus quite different from common robotics trajectory generation where standard Nonlinear Programming (NLP) approaches must be employed to enforcing complicated dynamic constraints. Consequently, they conduct snap minimization for smooth flying trajectories with description of the first kind, where the coefficients are optimized through a Quadratic Programming (QP) with prescribed times and waypoints. The gradient for time is roughly estimated by solving perturbation problems. Richter et al. [1] propose the description of the second kind which eliminates equality constraints in the QP, thus forming a closed-form solution. For large problems, its efficiency deteriorates because of the involved sparse matrix inverse. Safety constraints and dynamic limits are heuristically enforced, which can cause low trajectory quality. The two methods above provide many insights in quadrotor trajectory planning, even though there are weaknesses.
Many schemes are proposed to improve the above two frameworks. To improve efficiency, Burke et al. [8] first propose a linear-complexity scheme to solve primal and dual variables of the QP, which generates trajectories with pieces in less than minutes. However, its efficiency is still not satisfactory because of the redundant problem size and block inverses. Optimizing waypoints and times is still not considered. Burri et al. [2] and Oleynikova et al. [3] directly optimize all end-derivatives of inner pieces through NLP, where piece times are fixed. Almeida et al. [9] train a supervised neural network to learn time allocation offline. Thus relatively good piece times can be allocated online. Our previous work [10] proposes an efficient optimization scheme for piece times, while the handling for safety constraints lacks flexibility.
Due to the seeming inflexibility in raw polynomial splines, other methods describe trajectories via control points of B-Splines and Bézier curves [11, 12, 13]. The safety constraints and dynamic limits can be easily enforced via the convex hull property. Tordesillas et al. [14] utilize the property and optimize the interval allocation. A Mixed Integer Quadratic Programming (MIQP) is formulated to assign each trajectory piece into a convex region. However, the property can be conservative since the temporal profile of the trajectory is limited by the geometrical profile. To handle the issue, Gao et al. [7] propose a convex formulation to improve the dynamic performance of an already-known geometrical curve.
III Preliminaries
Since the differential flatness of quadrotor has been validated in [6], polynomial trajectories are widely used in the continuous-time motion planning for quadrotors. Consider an -order -piece spline whose -th piece is indeed an -degree polynomial , where is a coefficient vector of this piece and a natural basis. The entire spline on the duration is defined by where and .
For any given differentially flat quadrotor, high-order continuity is required to satisfy the differential constraints induced by the dynamics. Besides, the smoothness is also ensured by penalizing the integral of square of the high-order derivative. Assuming the order of the penalized derivative to be , the cost function can be written as
(1) |
where is a coefficient vector of the entire spline and is a piece time vector. The cost implicitly decouples for each dimension [4], thus we only consider -dimensional splines. According to the Linear Quadratic Minimum-Time (LQMT) problem [15], we set the degree as hereafter because it is the optimal degree for the minimizer of .
A spline can be naturally described by the collection , i.e, the first description. Consider the minimization of with fixed and some derivatives specified at certain timestamps. It can be formulated as a QP [6] if is taken as a vector of decision variables. The second description is denoted by the collection where is an end-derivative vector where
(2) |
Bry et al. [4] leverage the convenience of to eliminate equality constraints in the QP so that a closed-form solution for the optimal is constructed. Obviously, the double descriptions of polynomial trajectories provide a lot of convenience for energy minimization.
IV Efficient Solution and Gradient Computation With Double Descriptions
In this section, we derive an explicit diffeomorphism between double descriptions of polynomial trajectories. Based on the transformation, we construct the solution for with any in linear complexity. Utilizing its properties, we obtain the analytical gradient for problem parameters, i.e., specified derivatives and , which offers much flexibility to further improve the trajectory quality.
IV-A Explicit Diffeomorphism Between Double Descriptions
First, we explore the relation between parameterization spaces of both descriptions. We denote by the space for and by the space for . The relation between and is given as below.
Proposition 1.
For a polynomial trajectory, denote by its parameters in and by its parameters in . The map from to is a -diffeomorphism between and . An explicit diffeomorphism consists of an identity map on and a smooth bijection between and :
(3) |
where , , and is the direct sum stacking all diagonal sub-matrices. The forward and backward sub-matrices are
(4) |
which are partitioned into four blocks in . The entry at the -th row and -th column of any block is defined by
(5) | ||||
(6) | ||||
(7) | ||||
(8) | ||||
(9) | ||||
(10) |
Proof.
The forward sub-matrix given in (4), (5), (6), and (7), comes from the definition of in (2). Actually, is a general confluent Vandermonde Matrix generated from two variables and , both with multiplicity . According to Spitzbart’s Theorem [16], the inverse of always exists for , whose entries are exactly coefficients of a set of polynomials constructed from and . The backward sub-matrix given in (4), (8), (9), and (10), is derived following [16]. The process only involves lengthy but mechanical derivation thus is omitted here for brevity. Obviously, the map from to and the inverse are always smooth at any . The bijectivity and the smoothness imply a diffeomorphism. ∎
Proposition 1 gives analytic transformations between double descriptions, which have long been evaluated unwisely. In [1], is numerically computed by inverting for any given . In [2], the structure of is exploited so that is evaluated efficiently and stably via Schur complement, where only the inverse of a sub-matrix is needed. Our previous work [10] has the fewest online computations, where coefficients in is offline numerically computed by setting . However, all of these schemes involve numerically unstable matrix inverse. Proposition 1 is free of these drawbacks for the exact analytic expression. The diffeomorphism structure can be further utilized to greatly improve the efficiency and quality of trajectory generation.
IV-B Linear-Complexity Trajectory Generation
Consider the following trajectory generation problem,
(11) | ||||
(12) | ||||
(13) | ||||
(14) |
The initial and terminal derivatives are specified by and , respectively. Each is a specified intermediate waypoint at . The times continuous differentiability of on is implicitly required by the definition of , which is not explicitly formulated as equality constraints here.
Although a closed-form solution of (11) is given by Bry et al. [4], its efficiency is limited by the numerical evaluation of and the sparse permutation matrix inverse. To attain the linear complexity, Burke et al. [8] leverage the problem structure to calculate both primal and dual variables through a block tridiagonal linear equation system. However, it still needs frequently inverting sub-blocks. The size of the system is also redundant because of the dual variables. Therefore, we give a linear-complexity scheme with minimal problem size, where the matrix inverse is totally eliminated.
Consider the description of . We only need to obtain all unspecified entries in , which are indeed for and . Rewrite as
(15) |
where is a vector containing all unspecified entries. The constant vector is defined as
(16) |
where is a zero vector. The permutation matrix is defined as
(17) |
The matrix is defined as
(18) |
where . It should be noted that computing (15) only involves orderly accessing entries. We do not really need to compute the matrix product considering that and is highly structured.
The cost function indeed takes a quadratic form
(19) |
in which . Note that the symmetric matrix has an analytical form whose entries are simple power functions of . Its analytical form is provided by Bry et al. in the appendix of [4], to which we refer for details. Substituting (3) and (15) into (19) gives
(20) |
in which is a symmetric matrix. All its diagonal blocks is fully determined by the matrix function
(21) |
Obviously, the analytical form of can be easily derived for a fixed by combining our Proposition 1 and the result from Bry et al. [4]. Therefore, we omit the parameter and denote hereafter because it is trivial to obtain all diagonal blocks for any given in linear time and space.
Differentiating w.r.t. gives
(22) |
The optimal satisfies , i.e.,
(23) |
where and .
Actually, the computation for and is quite easy. We partition each into four square blocks as
(24) |
Expanding gives
(25) |
where
(26) | |||
(27) |
Similarly, we partition as
(28) |
where each is a constant vector. Expanding gives
(29) |
in which the -th part can be computed as
(30) |
Now we conclude the procedure to obtain the optimal trajectory. Firstly, compute each for any given using the analytical function defined in (21). Secondly, compute according to its definition (16) for the specified derivatives. Thirdly, compute nonzero entries in and according to (26), (27) and (30). Fourthly, solve the linear equation system (23) using Banded PLU Factorization [17]. Finally, recover the optimal coefficient vector through (15) and (3).
The above-concluded procedure only costs linear time and space complexity. There is no numerical matrix inverse needed in the whole procedure because is overcome by deriving its analytical form. Moreover, the linear equation system needed to be solved only involves necessary primal decision variables, thus achieving the minimal problem size.
IV-C Parameter Gradient Computation in Double Descriptions
Although the double descriptions make it possible to obtain the solution of (11) in a cheap way, the resultant trajectory quality is still determined by the parameter of the problem, i.e., intermediate waypoints and piece times . Further optimization on and is needed to improve the trajectory quality while maintaining feasibility. Therefore, we utilize the diffeomorphism between double descriptions of the trajectory to derive the analytical gradient w.r.t. and . The gradient helps to obtain optimal and , which bridges the gap in many traditional trajectory planning methods such as [18] and [19].
For any pair of and , denote by the corresponding optimal , which satisfies
(31) |
Then, the optimal , denoted by , is computed as
(32) |
Define a new cost as . The gradient we concern is indeed for , i.e., and .
Without causing ambiguity, we temporarily omit the parameters in , , , , and for simplicity. As for the cost function in (31), is a stationary point, which means its gradient w.r.t. satisfies . Now we know that the gradient computation in either or possesses its convenience. In , the gradient and both have easy-to-derive analytic expressions. In , the gradient of the cost (31) by is already zero. Thus, we first express and by and . Then, the diffeomorphism in Proposition 1 is utilized to transform them into such that terms relevant to can be eliminated.
As for the gradient of w.r.t. , we have
(33) |
As for the gradient of w.r.t. , we have
(34) |
where is the -th column vector of . As for and , their analytic expressions are clearly derived in the appendix of [4].
It is obvious that the gradient computations given in (IV-C) and (IV-C) are both irrelevant to the piece number . Thus, computing the gradient w.r.t. and only costs linear time and space complexity. Besides, all involved formulas have smooth analytic forms for , which much increase the efficiency of gradient computation.
Aside from efficiency, our analytical gradient scheme enjoy advantages in numerical stability. Specifically, the major numerical issue comes from the structure of on . As analyzed in [10], if any piece time goes to zero, the trajectory energy goes to infinity, thus making behave like a barrier function. Consequently, any scheme that evaluates gradient indirectly suffers instability from bad accuracy because this requires unrealistically small step size for finite difference [6] near the barrier. In comparison, ours is free from this issue because of the available accurate gradient.
V Applications
V-A Fast Minimum Jerk/Snap Trajectory Generation
One natural application of the previous linear-complexity solution scheme is that we can compute minimum-jerk/snap trajectory with extreme efficiency. Actually, there are already many reliable trajectory generation schemes for this topic. One thing that really matters is whether we can use a scheme as a black box without even worrying about its computation burden. We show that our scheme almost satisfies the requirements on this black box.
To demonstrate the efficiency of our scheme, we benchmark it with several conventional schemes, including the QP scheme by Mellinger et al. [6], the closed-form scheme by Bry et al. [4] and the linear-complexity scheme by Burke et al. [8]. As for Mellinger’s scheme, we use OSQP [20] to solve the QP formed by linear conditions and quadratic cost. As for Bry’s scheme, both the dense and sparse linear system solvers are implemented to calculate the closed-form solution. As for Burke’s scheme, we implement an optimized version of our own for the sake of fairness. More specifically, it only costs several seconds to calculate a minimum-snap trajectory with pieces, while the one in their paper is reported to cost more than minutes [8]. All schemes are implemented in C++11 without any explicit hardware acceleration.

We benchmark all these five schemes on -dimensional minimum jerk () and minimum snap () problems. All comparisons are conducted on an Intel Core i7-8700 CPU under Linux environment. For small-scale problems, the piece number ranges from to . In each case, sub-problems are randomly generated to be solved by these schemes. The results are provided in Fig. 2. For large-scale problems, we only benchmark two linear-complexity schemes, where the piece number is sparsely sampled from to . The results are given in Fig. 3.
As shown in Fig. 2, Bry’s closed-form solution and Burke’s scheme are faster than Mellinger’s scheme for small piece numbers. The dense version of Bry’s scheme becomes the slowest since the cubic complexity for the dense solver dominates the time. Its sparse version still retains the efficiency as piece number grows. Due to the linear complexity, Burke’s scheme and our scheme consume significantly less time than all other schemes. Moreover, ours is nearly an order of magnitude faster than Burke’s at any problem scale in Fig. 2 or Fig. 3. Intuitively, ours is able to generate trajectories with pieces in less than second.

V-B Fast Global Trajectory Optimization
Now we give another application for the linear-complexity solution and gradient. We provide a simple example here to significantly improve the efficiency of large-scale global trajectory optimization.
A drawback in traditional minimum snap based schemes is the lack of flexibility to adjust the piece times and waypoints. Such kind of scheme can only obtain gradient information unwisely by solving several perturbed problems [6]. To avoid this drawback, Gao et al. [7] propose a more flexible framework. It alternately optimizes the geometrical and temporal profile of a trajectory through two well-designed convex formulations. This framework generates high-quality large-scale trajectories within safe flight corridors while it cannot be done in real-time.
We assume that a polyhedron-shaped flight corridor has been generated as in [7]. The flight corridor is defined as
(35) |
where each is a finite convex polyhedron
(36) |
Besides, locally sequential connection is also assumed
(37) |
For such a , the start and goal position is located in and , respectively. As is shown in Fig. 4, we assign each -dimensional intermediate waypoint in the intersection , which roughly ensures the trajectory safety.

To obtain the spatial-temporal optimal trajectory within , we optimize the following cost function
(38) |
The cost term is also the -dimensional version. The cost term is just a logarithmic barrier term to ensure that each is confined within , defined as
(39) |
where is a constant barrier coefficient, an all-ones vector with an appropriate length and the entry-wise natural logarithm. Actually, any clamped barrier function is an alternative to further eliminate the potential of the barrier in the interior of , which can be easily constructed by following [21]. The cost term is just a penalty to adjust the trajectory aggressiveness. It is defined as
(40) | |||
where is a penalty function, the velocity limit and acceleration limit. The constant prevents the entire duration from growing too large. Constants and prevent the trajectory from being too aggressive. It also costs linear-complexity time for the value and gradient computation on . Then, we utilize the L-BFGS [22] with strong Wolfe conditions as an efficient quasi-Newton method to minimize the cost function.

As for constraints, it is possible that the interior part of a piece becomes unsafe or violates the limit too much. To handle such situations, we first utilize the feasibility checker proposed in [10] to locate such a piece. Then, the corresponding is split into two intersecting parts, and , as shown in Fig. 5. An intermediate waypoint is added as decision variables. Accordingly, we increase the corresponding penalty or barrier coefficient only for these two new pieces. In general, a larger penalty coefficient and shorter piece length make the soft constraint tighter. A larger barrier coefficient in makes more likely to be in the interior of , which helps to ensure the safety. Empirically, these operations are seldom needed according to our simulations.

We benchmark our simple scheme with the global trajectory optimizer in Teach-Repeat-Replan [7] which minimizes under the same constraints. The interval allocation optimization in FASTER [14] is also compared here since it supports polyhedron-shaped corridor constraints. Due to the fact that it does not optimize time, we initialize it using total time from Teach-Repeat-Replan. We set , , and for all schemes and for the proposed one. The relative cost tolerance is set as for ours and the default value for the other two open-source implementations. The time out is set as . For each size, the computation time is averaged over randomly generated corridors. The results from three methods is shown in Fig. 6. An intuitive comparison for large-scale trajectory generation is also provided in Fig. 1 where a spatial-temporal optimal trajectory is generated by our scheme using significantly less time.
VI Conclusion
In this paper, we explore and exploit the relation between double descriptions of quadrotor polynomial trajectory. The resultant linear-complexity solution and gradient computation provide much flexibility and efficiency in classic trajectory generation problems. Simple applications are provided to demonstrate their promising performance. Our future work focus on incorporating our results into existing local planners that use polynomial trajectories. It remains to be validated whether our results can greatly improve the trajectory quality in these planners without sacrificing the efficiency.
References
- [1] C. Richter, A. Bry, and N. Roy, “Polynomial trajectory planning for aggressive quadrotor flight in dense indoor environments,” in Proc. of the Intl. Sym. of Robot. Research, Singapore, Dec 2013.
- [2] M. Burri, H. Oleynikova, M. Achtelik, and R. Siegwart, “Real-time visual-inertial mapping, re-localization and planning onboard MAVs in unknown environments,” in Proc. of the IEEE/RSJ Intl. Conf. on Intell. Robots and Syst., Hamburg, Germany, Sep 2015.
- [3] H. Oleynikova, C. Lanegger, Z. Taylor, M. Pantic, A. Millane, R. Siegwart, and J. Nieto, “An open-source system for vision-based micro-aerial vehicle mapping, planning, and flight in cluttered environments,” Journal of Field Robotics, vol. 37, no. 4, pp. 642–666, 2020.
- [4] A. Bry, C. Richter, A. Bachrach, and N. Roy, “Aggressive flight of fixed-wing and quadrotor aircraft in dense indoor environments,” The International Journal of Robotics Research, vol. 34, p. 1002, 2015.
- [5] M. M. De Almeida and M. Akella, “New numerically stable solutions for minimum-snap quadcopter aggressive maneuvers,” in Proc. of the American Control Conference, Seattle, USA, 2017.
- [6] D. Mellinger and V. Kumar, “Minimum snap trajectory generation and control for quadrotors,” in Proc. of the IEEE Intl. Conf. on Robot. and Autom., Shanghai, China, May 2011.
- [7] F. Gao, L. Wang, B. Zhou, X. Zhou, J. Pan, and S. Shen, “Teach-Repeat-Replan: A complete and robust system for aggressive flight in complex environments,” IEEE Transactions on Robotics, vol. 36, no. 5, pp. 1526–1545, 2020.
- [8] D. Burke, A. Chapman, and I. Shames, “Generating minimum-snap quadrotor trajectories really fast,” in Proc. of the IEEE/RSJ Intl. Conf. on Intell. Robots and Syst., Las Vegas, USA, 2020.
- [9] M. M. de Almeida, R. Moghe, and M. Akella, “Real-time minimum snap trajectory generation for quadcopters: Algorithm speed-up through machine learning,” in Proc. of the IEEE Intl. Conf. on Robot. and Autom., Montreal, Canada, May 2019.
- [10] Z. Wang, X. Zhou, C. Xu, J. Chu, and F. Gao, “Alternating minimization based trajectory generation for quadrotor aggressive flight,” IEEE Robotics and Automation Letters, vol. 5, no. 3, pp. 4836–4843, 2020.
- [11] J. A. Preiss, K. Hausman, G. S. Sukhatme, and S. Weiss, “Trajectory optimization for self-calibration and navigation.” in Robotics: Science and Systems, 2017.
- [12] F. Gao, W. Wu, Y. Lin, and S. Shen, “Online safe trajectory generation for quadrotors using fast marching method and Bernstein basis polynomial,” in Proc. of the IEEE Intl. Conf. on Robot. and Autom., Brisbane, Australia, May 2018.
- [13] B. Zhou, F. Gao, L. Wang, C. Liu, and S. Shen, “Robust and efficient quadrotor trajectory generation for fast autonomous flight,” IEEE Robotics and Automation Letters, vol. 4, no. 4, pp. 3529–3536, 2019.
- [14] J. Tordesillas, B. T. Lopez, and J. P. How, “FASTER: Fast and safe trajectory planner for flights in unknown environments,” in Proc. of the IEEE/RSJ Intl. Conf. on Intell. Robots and Syst., Macau, China, 2019.
- [15] E. Verriest and F. Lewis, “On the linear quadratic minimum-time problem,” IEEE Transactions on Automatic Control, vol. 36, no. 7, pp. 859–863, 1991.
- [16] R. Schappelle, “The inverse of the confluent vandermonde matrix,” IEEE Transactions on Automatic Control, vol. 17, no. 5, pp. 724–725, 1972.
- [17] G. H. Golub and F. V. Loan, Matrix Computations. The Johns Hopkins University Press, 2013.
- [18] H. Oleynikova, M. Burri, Z. Taylor, J. Nieto, R. Siegwart, and E. Galceran, “Continuous-time trajectory optimization for online uav replanning,” in Proc. of the IEEE/RSJ Intl. Conf. on Intell. Robots and Syst., Daejeon, Korea, 2016.
- [19] F. Gao, W. Wu, W. Gao, and S. Shen, “Flying on point clouds: Online trajectory generation and autonomous navigation for quadrotors in cluttered environments,” Journal of Field Robotics, vol. 36, no. 4, pp. 710–733, 2019.
- [20] B. Stellato, G. Banjac, P. Goulart, A. Bemporad, and S. Boyd, “OSQP: An operator splitting solver for quadratic programs,” Mathematical Programming Computation, pp. 1–36, 2020.
- [21] M. Li, Z. Ferguson, T. Schneider, T. Langlois, D. Zorin, D. Panozzo, C. Jiang, and D. M. Kaufman, “Incremental potential contact: Intersection-and inversion-free, large-deformation dynamics,” ACM Transactions on Graphics, vol. 39, no. 4, 2020.
- [22] D. C. Liu and J. Nocedal, “On the limited memory BFGS method for large scale optimization,” Mathematical programming, vol. 45, no. 1-3, pp. 503–528, 1989.