{'fraction_non_alphanumeric': 0.048314606741573035, 'fraction_numerical': 0.01564390665514261, 'mean_word_length': 4.025190010857763, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Online learning-based trajectory tracking for underactuated vehicles with uncertain dynamics

Underactuated vehicles have gained much attention in the recent years due to the increasing amount of aerial and underwater vehicles as well as nanosatellites. Trajectory tracking control of these vehicles is a substantial aspect for an increasing range of application domains. However, external disturbances and parts of the internal dynamics are often unknown or very time-consuming to model. To overcome this issue, we present a tracking control law for underactuated rigid-body dynamics using an online learning-based oracle for the prediction of the unknown dynamics. We show that Gaussian process models are of particular interest for the role of the oracle. The presented approach guarantees a bounded tracking error with high probability where the bound is explicitly given. A numerical example highlights the effectiveness of the proposed control law.


I. INTRODUCTION
The demand for unmanned aerial and underwater vehicles is rapidly increasing in many areas such as monitoring, mapping, agriculture, and delivery. These vehicles are typically underactuated due to constructional reasons which poses several challenges from the control perspective [1]. The dynamics of these systems can often be expressed by rigid bodies motion with full attitude control and one translational force input. This is a classical problem in underactuated mechanics and many different types of control methods have been proposed to achieve an accurate trajectory tracking. Most of the control approaches are mainly based on feedback linearization [2] and backstepping methods [3] which are also analyzed in terms of stability, e.g., in [4].
However, these control approaches depend on exact models of the systems and possible external disturbances to guarantee stability and precise tracking. An accurate model of typical uncertainties is hard to obtain by using first principles based techniques. Especially the impact of air/water flow on aerial/underwater vehicles or the interaction with unstructured and a-priori unknown environment further compound the uncertainty. The increase of the feedback gains to suppress the unknown dynamics is unfavorable due to the large errors in the presence of noise and the saturation of actuators. A suitable approach to avoid the time-consuming or even unfeasible modeling process is provided by learningbased oracles such as neural networks or Gaussian processes (GPs). These data-driven modeling tools have shown remarkable results in many different applications including control, machine learning and system identification. In datadriven control, data of the unknown system dynamics is collected and used by the oracle to predict the dynamics in areas without training data. In contrast to parametric models, data-driven models are highly flexible and are able to reproduce a large class of different dynamics, see [5].
The purpose of this article is to employ the power of online learning-based approaches for the tracking control for a class of underactuated systems. At the end, stability and a desired level of performance of the closed-loop system should be guaranteed. The problem of tracking control of underactuated aerial/underwater vehicles with uncertainties has been addressed in [6], [7] but these approaches are restricted to structured uncertainties such as uncertain parameters or use high feedback gains for compensation. Safe feedback linearization based on GPs are introduced in [8], [9] for a specific class of systems but they do not capture the general underactuated nature of the here considered model class and are limited to single input systems.
Learning-based approaches for Euler-Lagrange systems with stability guarantees are presented in [10]- [12]. However, the systems are required to be fully actuated or are limited to the class of balancing robots. For a specific type of aerial vehicles, a safe Gaussian process based controller is proposed in [13] but with additional assumptions such as an initial safe controller. The contribution of this article is a online learning-based tracking control law for a large class of underactuated vehicles with stability and performance guarantees. Instead of focusing on a particular type of oracle, the proposed approach allows the usage of various learning-based oracles. The online learning approach allows to improve the model and, thus, the tracking performance during runtime.
The remaining article is structured as follows: After the problem setting in Section II, the online learning-based oracle and the tracking controller are introduced in Section III. Finally, a numerical example is presented in Section IV.

II. PROBLEM SETTING
We assume a single underactuated rigid body with position 1 p ∈ R 3 and orientation matrix R ∈ SO(3). The bodyfixed angular velocity is denoted by ω ∈ R 3 . The vehicle 1 Vectors are denoted with bold characters and matrices with capital letters. The term A i,: denotes the i-th row of the matrix A. The expression N (µ, Σ) describes a normal distribution with mean µ and covariance Σ. The probability function is denoted by P. The set R >0 denotes the set of positive real numbers. has mass m ∈ R >0 and rotational inertia tensor J ∈ R 3×3 . The state space of the vehicle is S = SE(3) × R 6 with s = ((R, p), (ω,ṗ)) ∈ S denoting the whole state of the system. The vehicle is actuated with control torques τ ∈ R 3 and a control force u ∈ R, which is applied in a body-fixed direction defined by a unit vector e ∈ R 3 . We can model the system as where the map(·) : R 3 → so(3) is given by with the components of the angular velocity ω = [ω 1 , ω 2 , ω 3 ] . The functions f : R 6 → R 3 and f ω : S → R 3 are state-depended disturbances and/or unmodeled dynamics. It is assumed that the full state s can be measured. The general objective is to track a trajectory specified by the . For simplicity, we focus here on position tracking only. The extension to rotation tracking is straightforward and will be discussed later.

A. Equivalent system
In preparation for the learning and control step, we transform the system dynamics (1) in an equivalent form. For the unknown dynamics f and f ω , we use the estimateŝ f : R 6 → R 3 andf ω : S → R 3 , respectively, of an oracle. The estimation error is moved to ρ(x) = f (x) −f (x) and ρ ω (s) = f ω (s) −f ω (s). With the system matrix A ∈ R 6×6 and input matrix B ∈ R 6×3 given by and I 3 ∈ R 3×3 as identity matrix, we can rewrite (1) aṡ where x = [p ,ṗ ] ∈ R 6 , s ∈ S and g : SO(3)×R → R 3 is a virtual control input with g(R, u) := Reu. As consequence, (4) is equivalent to (1) without loss of generality.
III. LEARNING-BASED CONTROL An overview about the proposed control strategy is depicted in Fig. 1. As introduced in the vehicle's dynamics (4), we assume that parts of the dynamics are known and some are unknown, i.e., f and f ω . The proposed control strategy is based on a backstepping controller using an internal model that is updated by the predictions of an oracle. The data for the oracle is collected in arbitrary time intervals of the vehicle's dynamics during the control process. Then, the predictions of the oracle are updated based on the collected dataset and the vehicle model is improved. In the following, we present the online learning and control part in detail.
x Vehicle Collection Oracle update

A. Learning
For the learning of the unknown dynamics of (1), we consider an oracle which predicts the values of f , f ω for a given state s. For this purpose, the oracle collects N (n) : N → N training points of the system (1) to create a data set The output data y ∈ R 6 are given by such that the first three components of y correspond to f and the remaining to f ω . The data set D n(t) with n : R ≥0 → N can change over time t, such that at time t 1 ∈ R ≥0 the data set D n(t1) with N (n(t 1 )) training points exists. This allows to accumulate training data over time, i.e., N (n) is monotonically increasing, but also "forgetting" of training data to keep N (n) constant. The time-dependent estimates of the oracle is denoted byf n (x) andf ω,n (s) to highlight the dependence on the corresponding data set D n . Note that this construction also allows offline learning, i.e. the prediction of the oracle depends on previous collected data only, or any hybrid online/offline approach. Remark 1: Simple oracles can be parametric models such as a linear model, where the parameters are learned with a least-square approach based on the data set D n . More powerful oracles are given by neural networks, due to their universal function approximation property [14]. Furthermore, non-parametric oracles such as Gaussian processes and support vector machines have led to promising results as probabilistic function approximators [15], [16]. For the later stability analysis of the closed-loop, we introduce the following assumptions, which cover various types of oracles.
Assumption 1: Consider an oracle with the predictionŝ f n ∈ C 2 andf ω,n ∈ C 0 based on the data set D n (5). Let S X ⊂ (SE(3) × (X ⊂ R 6 )) be a compact set where the derivatives off n are bounded on X . There exists a bounded functionρ n : S X → R ≥0 such that the prediction error is given by with probability δ ∈ (0, 1] for all x ∈ X , s ∈ S X and n(t).
Assumption 2: The number of data sets D n is finite and there are only finitely many switches of n(t) over time, such that there exists a time T ∈ R ≥0 where n(t) = n end , ∀t ≥ T Assumption 1 is fulfilled, for instance, by a Gaussian process model as oracle as shown in the next section. The second assumption is little restrictive since the number of sets is often naturally bounded due to finite computational power or memory limitations and since the unknown functions f , f ω in (1) is not time-dependent, long-life learning is typically not required. Furthermore, Assumption 2 ensures that the switching between the data sets is not infinitely fast which is natural in real world applications.

B. Gaussian process as oracle
Gaussian process models have been proven as very powerful oracle for nonlinear function regression. For the prediction, we concatenate the N (n) training points of D n in an input matrix X = [s 1 , s 2 , . . . , s N (n) ] and a matrix of outputs Y = [y 1 , y 2 , . . . , y N (n) ], where y might be corrupted by additive Gaussian noise with N (0, σI 6 ). Then, a prediction for the output y * ∈ R 6 at a new test point s * ∈ S X is given by for all i ∈ {1, . . . , 6}, where Y :,i denotes the i-th column of the matrix of outputs Y . The kernel k : S X × S X → R is a measure for the correlation of two states (s, s ), whereas the mean function m i : S X → R allows to include prior knowledge. The function K : S N X × S N X → R N ×N is called the Gram matrix whose elements are given by K j ,j = k(X :,j , X :,j ) + δ(j, j )σ 2 for all j , j ∈ {1, . . . , N } with the delta function δ(j, j ) = 1 for j = j and zero, otherwise. The vector-valued function k : S X × S N X → R N , with the elements k j = k(s * , X :,j ) for all j ∈ {1, . . . , N }, expresses the covariance between s * and the input training data X. The selection of the kernel and the determination of the corresponding hyperparameters can be seen as degrees of freedom of the regression. A powerful kernel for GP models of physical systems is the squared exponential kernel. An overview about the properties of different kernels can be found in [15]. As we use the oracle in an online setting where new training data is collected over time, the dataset D n for the prediction (7) changes over time. The GP model allows to integrate new training data in a simple way by exploiting that every subset follows a multivariate Gaussian distribution, see [15] for more details.
Remark 3: For notational simplicity, we consider identical kernels for each output dimension. However, the GP model can be easily adapted to different kernels for each output dimension.
With the introduced GP model, we are now addressing Assumption 1 using [10], [16], [18]. To provide model error bounds, additional assumptions on the unknown parts of the dynamics (1) must be introduced, in line with the no-freelunch theorem, see [19].
Assumption 3: The kernel k is selected such that f , f ω have a bounded reproducing kernel Hilbert space (RKHS) norm on X and S X , respectively, i.e. f i k < ∞, f ω,i k < ∞ for all i = 1, 2, 3. The norm of a function in a RKHS is a smoothness measure relative to a kernel k that is uniquely connected with this RKHS. In particular, it is a Lipschitz constant with respect to the metric of the used kernel. A more detailed discussion about RKHS norms is given in [20]. Assumption 3 requires that the kernel must be selected in such a way that the functions f , f ω are elements of the associated RKHS. This sounds paradoxical since this function is unknown. However, there exist some kernels, namely universal kernels, which can approximate any continuous function arbitrarily precisely on a compact set [16,Lemma 4.55] such that the bounded RKHS norm is a mild assumption. Finally, with Assumption 3, the model error can be bounded as written in the following lemma.
Lemma 1 (adapted from [10]): Consider the unknown functions f , f ω and a GP model satisfying Assumption 3. The model error is bounded by f ω,n (s) s, D n ≥ δ for x ∈ X , s ∈ S X , δ ∈ (0, 1) with β ∈ R 6 given by [10, Lemma 1] Proof: It is a direct implication of [10, Lemma 1]. With Assumption 3 and the fact, that universals kernels exist which generate bounded predictions with bounded derivatives, see [18], GP models can be used as oracle to fulfill Assumption 1. In this case, the prediction error bound is given byρ n (s) := β Σ Remark 4: An efficient greedy algorithm can be used to find β based on the maximum information gain [21].

C. Tracking control
For the tracking control, we consider a given desired trajectory x d (t) : R t≥0 → X , x d ∈ C 4 . The tracking error is denoted by z 0 (t) = x(t) − x d (t). Before we propose the main theorem about the safe learning-based tracking control law, the feedback gain matrix G n is introduced. As part of the controller, G n penalizes the position tracking error and the result is fed back to both inputs, the force control u and the torque control τ of the system (1). The feedback gain matrix is allowed to be adapted with any update of the oracle based on a new data set D n to lower the feedback gains when the oracle's accuracy is improved.
Property 1: The matrix G n ∈ R 3×6 is chosen such that there exist a symmetric positive definite matrix P n ∈ R 6×6 and a positive definite matrix Q n ∈ R 6×6 which satisfy the Lyapunov equation for each switch of n(t). Property 1 is satisfied if the real parts of all eigenvalues of (A − BG n ) are negative. For example, this can be achieved by any G n = [G n,1 , G n,2 ], where G n,1 , G n,2 ∈ R 3×3 are positive definite diagonal matrices. Theorem 1: Consider the underactuated rigid-body system given by (1) with unknown dynamics f , f ω and the existence of an oracle satisfying Assumptions 1 and 2. Let G z1 , G z2 ∈ R 3×3 be positive definite symmetric matrices. With Property 1, the control law with the desired virtual control input derivative x = Ax + B g(R, u) +f n (x) (12) guarantees that the tracking error is uniformly ultimately bounded in probability by with b nend = (max{eig(P nend ), 1}/ min{eig(P nend ), 1}) 1/2 , and time constant T ∈ R ≥0 on S X . Remark 5: The control law does not depend on any state derivatives, which are typically noisy in measurements. The derivatives, i.e. the translational and angular accelerations, are only necessary for the training of the oracle, see (5), which can often deal with noisy data. For instance, GP models can handle additive Gaussian noise on the output [15]. We prove the stability of the closed-loop with the proposed control law with multiple Lyapunov function, where the nth function is active when the oracle predicts based on the corresponding training set D n . Note that due to a finite number of switching events, the switching between stable systems can not lead to an unbounded trajectory, see [22]. Proof: The term g(R, u) in (4) is assumed as virtual control input with the desired force where G n can change by the switching of n(t). The tracking error dynamics are given bẏ Using the desired accelerationp d of (14) in (15) leads tȯ In the next step, the boundedness of the tracking error z 0 is proven. For this purpose, we use the matrices P n , Q n of Property 1 to construct the Lyapunov function V 0,n (z 0 ) = 0.5z 0 P n z 0 and compute its evolutioṅ The first summand is negative for all z 0 ∈ R 6 . In the next step, we extend the previous Lyapunov function with the error term z 1 ∈ R 3 with z 1 (t, n, x, R, u) = g(R, u) − g d (t, n, x), which describes the error between the virtual and the desired control input. Thus, it leads to a switching Lyapunov function V 1,n (z 0 , z 1 ) = V 0,n + 0.5z 1 z 1 ≥ 0. The derivative of V 1,n leads tȯ where p  (14), we construct a desired value ofġ with Instead of having dependencies on the typical noisy state derivativeẋ, we use the estimationẋ ∈ R 6 given by (12), which only contains the known parts of the system dynamics (4). Then, the expression (17) is used to substituteġ in (16). This leads to the evolutioṅ Next, we define the error z 2 ∈ R 3 with and an extended Lyapunov function The derivative of V n leads tȯ V n =V 1,n +z 2 g−mp (4) d +G nz0 +BP nż0 + d dt ∂f n ∂xẋ and we construct a desired value ofg with gd given by (11). Then, it is substituted intoV n to obtaiṅ +(z 0 P n +z 1 D(x)+z 2 E(x))Bρ n (x)+z 2 (g−gd) To eliminate the last summand in (21) except for the estimation error ρ ω , we note thaẗ Using (25) and Assumption 1, the evolution of the Lyapunov function V can be upper bounded by with the upper boundsD,Ē ∈ R 3×3 andc ∈ R, which exist due to Assumption 1. Thus, the evolution is negative with probability δ for all z = [z 1 , z 2 , z 3 ] outside a ball where a maximum ofρ n exists regarding to Assumption 1. Finally, the Lyapunov function (20) is lower and upper bounded by α 1 ( z ) ≤ V n (z) ≤ α 2 ( z ), where α 1 (r) = 0.5 min{eig(P n ), 1}r 2 and α 2 (r) = 0.5 max{eig(P n ), 1}r 2 . Thus, we can compute the radius b n ∈ R ≥0 of the bound by b n = max{eig(P n ), 1} min{eig(P n ), 1} .
Since Assumption 2 only allows a finite number of switches, there exists a time T ∈ R ≥0 such that n(t) = n end ∈ N for all t ≥ T . Thus, P{ z 0 (t) ≤ max s∈S Xρ nend (s)b nend , ∀t ≥ T } ≥ δ. Remark 6: Extension to the rotation are analogously to perform with additional terms in the Lyapunov function as given in [4], [6].
Remark 7: The torque control law of (10) has a singularity at u = 0 as without control force u no tracking control is possible in general. To overcome the singularity, a reasonable trajectory planning can be performed, see [6] or the control torques are set to zero at this point. In practice, this leads to chattering that can be alleviated by a slight modification of the control law to remove the singularity, see [23].
Remark 8: The proposed approach allows multiple ways of data collection and adaptation of the feedback matrix G n . A possible strategy can be time-triggered where new data points are recurrently attached to the data set D n to improve the prediction accuracy of the oracle and the magnitude of G n is decreased over time. More advanced strategies can be based on the model uncertainty or the tracking error as used in, e.g., [8]. The proof shows that the bound of the tracking error (27) depends on the prediction errorρ n of the oracle.

IV. NUMERICAL EXAMPLE
In this section, we present a numerical example of a quadrocopter within an a-priori unknown wind field. The dynamics of the quadrocopter are described by (1) with mass m = 1 kg, inertia J = diag(2, 2, 1)kgm 2 and the direction e = [0, 0, 1] of the force input u. As unknown dynamics f and f ω , we consider an arbitrarily chosen wind field and the gravity force given by (29) A GP model is used as oracle to predict the z-component of f (x) and the x-component of f ω (s) with the squared exponential kernel, see [15]. The prior knowledge about the existing gravity in f (x) is considered as estimate in the mean function of the GP with m 3 (s) = −10. At starting time t = 0, the data set D n is empty such that the prediction is solely based on the mean function. The initial position of the quadrocopter is p(0) = [0.1, −0.1, 0] whereas the desired trajectory starts at p d (0) = [0, 0, 0] due to an assumed position measurement error. In this example, we employ an online learning approach which collects a new training point every 0.1 s such that the total number of training points is N = 5n. In Fig. 2, the first 3 s of the desired (dashed) and the actual trajectory (solid) is shown. The crosses denote the collected training data. Each training point consists of the actual state s and y as given by (5). Since the training point depends on the typically noisy measurement of the accelerationsp andω, Gaussian distributed noise N (0, 0.08 2 I 3 ) is added to the measurement. The GP model is updated every second until t = 12 s, where the last 10 collected training points are appended to the set D n and the hyperparameters are optimized by means of the likelihood function, see [16]. Thus, the function n is the integer part of 2t up to t = 12 s given by n(t) = min(12 s, 2t ). The initial feedback gain matrix is set to G n=0 = [diag(10, 10, 40), diag(10, 10, 10)] and G z1 = G z2 = 2I 3 . In this example, we adapt the feedback gain matrix based on the number of training points. When the GP model is updated with new training data, the feedback gains are decreased by G n = 0.9 n G n=0 . Thus, after the first update, the feedback gains are 90% of the initial gains, see Fig. 3. The simulation time is 14 s. Figure 4 visualizes that the actual position (solid) of the quadrocopter converges to a very tight set around the desired position (dashed). The effects of the switching to the updated GP model are more noticeable in the evolution of the Lyapunov function in Fig. 3. The function might increase after an update of the GP model due to the change of G n and the new prediction accuracy of the GP model. However, the function converges to a bounded set as proposed in Theorem 1 after the finite number of switching events.

CONCLUSION
We present an online learning-based tracking control law for a class of underactuated systems with unknown dynamics typical for aerial and underwater vehicles. Using a various type of oracles, the tracking error is proven to be bounded in probability and the size of the bound is explicitly given. The online fashion of the proposed approach allows to improve the quality of the oracle over time and, thus, to improve the tracking performance. Even though no particular oracle is assumed, we show that Gaussian process models fulfill all requirements to be used as oracle in the proposed control scheme. Finally, a numerical example visualizes the effectiveness of the control law.