## 2 Methodology
### Path Propagation Using Motion Primitives  
To control differentially flat dynamical systems, such as quadcopters [35], a widely used trajectory planning method is the MPs [31; 32]. The MPs are defined by a UAV's initial state, the desired motion duration, and any combination of components of its position, velocity, and acceleration at the motion's end. Given those states and conditions, the MPs generate smooth trajectories by minimizing a cost function \(\mathcal{J}_{\Sigma}=\frac{1}{t}\int_{0}^{T}\|\mathbf{j}(t)\|^{2}\,dt\), where \(\mathbf{j}(t)\) and \(T\) denote the jerk and a terminal time, respectively. Indeed, the dynamics into three orthogonal inertial axes are assumed to be decoupled, so the generated MPs minimize the cost value for each axis independent of the other axes. In other words,  
\[\mathcal{J}_{\Sigma}=\sum_{q=1}^{3}\mathcal{J}_{q}=\sum_{q=1}^{3}\frac{1}{T} \int_{0}^{T}j_{q}^{2}(t)\,dt, \tag{1}\]  
where \(\mathcal{J}_{q}\) represents a per-axis cost. For each axis \(q\), let the state \(\mathbf{s}_{\mathbf{q}}(t)=[\,p_{q}(t),v_{q}(t),a_{q}(t)\,]^{\mathrm{T}}\) be the scalar components of position, velocity, and acceleration. The control input is the jerk \(j_{q}(t)\) such that  
\[\mathbf{\dot{s}}_{\mathbf{q}}(t)=f_{\mathrm{s}}(\,\mathbf{s}_{\mathbf{q}}(t),j_{q}(t)\,)=[\,v_{q}(t),a_{q}(t),j_{q}(t)\,]^{\mathrm{T}}. \tag{2}\]  
For shorthand notations, it neglects axis subscript \(q\) when only a single axis is considered and time argument \((t)\), when it is not ambiguous. The control input jerk is chosen \(\forall t\in[0,T]\) to minimize objective functional in Equation (1). Hamiltonian function \(\mathcal{H}\) is constructed by introducing the time-varying Lagrange multiplier vector \(\boldsymbol{\lambda}=[\lambda_{1},\lambda_{2},\lambda_{3}]^{\mathrm{T}}\), whose elements are called the costates of the system as follows:  
\[\mathcal{H}(\mathbf{s},j,\boldsymbol{\lambda})=\boldsymbol{\lambda}^{\mathrm{ T}}f_{\mathrm{s}}(\mathbf{s},j)+\frac{1}{T}\,\dot{\beta}^{2}=\lambda_{1}\,v+ \lambda_{2}\,a+\lambda_{3}\,j+\frac{1}{T}\,\dot{\beta}^{2}. \tag{3}\]  
The [PERSON]'s minimum principle [36] states that optimal state trajectory \(\mathbf{s}^{*}\), optimal control \(j^{*}\), and corresponding Lagrange multiplier vector \(\boldsymbol{\lambda}^{*}\) minimize \(\mathcal{H}\) so that the following costate equation must be satisfied:  
\[-\dot{\boldsymbol{\lambda}}=\
abla_{\mathbf{s}}\,\mathcal{H}(\mathbf{s}^{*},j ^{*},\boldsymbol{\lambda})=[\,0,\lambda_{1},\lambda_{2}\,]^{\mathrm{T}}, \tag{4}\]  
where \(\
abla_{\mathbf{s}}\,\mathcal{H}(\mathbf{s}^{*},j^{*},\boldsymbol{\lambda})\) represent the gradient of \(\mathcal{H}\) with respect to \(\mathbf{s}\). Integrating the costate differential equation in Equation (4) with constants \(\alpha,\beta\), and \(\gamma\) yields  
\[\boldsymbol{\lambda}(t)=\frac{1}{T} \begin{bmatrix}-2\alpha\\ 2\alpha t+2\beta\\ -\alpha t^{2}-2\beta t-2\gamma\end{bmatrix} . \tag{5}\]  
Figure 1: A flowchart of the overall process proposed. From Equation (3), \(j^{*}\) is solved by  
\[ \begin{split} j^{*}(t)&=\operatorname*{arg\,min}_{j(t)} \,\mathcal{H}(\,\mathbf{s}^{*}(t),j(t),\boldsymbol{\lambda}(t)\,)=-\frac{T}{2} \,\lambda_{3}(t)\\ &=\frac{1}{2}\alpha t^{2}+\beta t+\gamma,\end{split}  \tag{6}\]  
and \(\mathbf{s}^{*}\) is obtained by integrating Equation (2) given the initial condition \(\mathbf{s}(0)=[\,p(0),v(0),a(0)\,]^{\mathrm{T}}=[\,p_{0},v_{0},a_{0}\,]^{ \mathrm{T}}\) as follows:  
\[\mathbf{s}^{*}(t)= \begin{bmatrix}p^{*}(t)\\ p^{*}(t)\\ a^{*}(t)\end{bmatrix} = \begin{bmatrix}\frac{\alpha}{120}t^{5}+\frac{\beta}{24}t^ {4}+\frac{\gamma}{6}t^{3}+\frac{a_{0}}{2}t^{2}+v_{0}t+p_{0}\\ \frac{\alpha}{24}t^{4}+\frac{\beta}{6}t^{3}+\frac{\gamma}{2}t^{2}+a_{0}t+v_{0 }\\ \frac{\alpha}{6}t^{3}+\frac{\beta}{2}t^{2}+\gamma t+a_{0}\end{bmatrix} . \tag{7}\]  
One solves remaining unknowns \(\alpha,\beta\), and \(\gamma\) depending on the given components of the desired end translational state.