{'fraction_non_alphanumeric': 0.030141001267427123, 'fraction_numerical': 0.011723700887198986, 'mean_word_length': 4.9311721869861405, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
RodFIter: Attitude Reconstruction from Inertial Measurement by Functional Iteration

Rigid motion computation or estimation is a cornerstone in numerous fields. Attitude computation can be achieved by integrating the angular velocity measured by gyroscopes, the accuracy of which is crucially important for the dead-reckoning inertial navigation. The state-of-the-art attitude algorithms have unexceptionally relied on the simplified differential equation of the rotation vector to obtain the attitude. This paper proposes a Functional Iteration technique with the Rodrigues vector (named the RodFIter method) to analytically reconstruct the attitude from gyroscope measurements. The RodFIter method is provably exact in reconstructing the incremental attitude as long as the angular velocity is exact. Notably, the Rodrigues vector is analytically obtained and can be used to update the attitude over the considered time interval. The proposed method gives birth to an ultimate attitude algorithm scheme that can be naturally extended to the general rigid motion computation. It is extensively evaluated under the attitude coning motion and compares favorably in accuracy with the mainstream attitude algorithms. This work is believed having eliminated the long-standing theoretical barrier in exact motion integration from inertial measurements.

and error-free, there still exists an insurmountable fact that prevents us from practically obtaining the exact attitude, namely, the non-commutativity attribute of finite rotations [9]. That is to say, switching the order of consecutive rotations normally produces different attitude. So far, approximation has to be introduced into the attitude computation.
Attitude computation is crucially important for the dead-reckoning inertial navigation, so great endeavors have been devoted to improving the attitude computation accuracy as much as possible, see e.g. [3,10]. Table I lists the landmark papers so far on approximate attitude computation using the rotation vector. The structure of the state-of-the-art or mainstream algorithms was established in early 1970s, pioneered by Jordan [1] and Bortz [9], which exclusively relies on the rotation vector to represent the incremental attitude and then update the current attitude in terms of quaternion or direction cosine matrix [1,9,11]. As the rotation vector rate is nontrivially related to the gyroscope-measured angular velocity, it has to be much simplified so as to be handled by practical approximation methods [3,11]. The attitude algorithms need several consecutive measurements (called samples) to approximate the incremental rotation vector and thus cannot update the current attitude until the last measurement comes in. It is not a big problem when attitude is what we are only concerned about, but it is a different story if the subsequent computation step needs the current attitude as an input. The latter case is what happens to the inertial navigation system [12][13][14]. To better approximate the attitude, more angular velocity samples are preferred, but the velocity or position computation is awaiting the attitude result to come out as soon as possible, also for the sake of better approximation. In addition, the state-of-the-art attitude algorithms are all designed using some special form of motion, e.g., the coning motion, as a performance optimization criterion [2,5,15] and may likely be suboptimal for other kinds of motions.
The paper proposes a functional iteration technique to analytically reconstruct the attitude from gyroscope measurements by way of the Rodrigues vector (named as the RodFIter method hereafter). The Rodrigues vector is used instead of the traditional rotation vector to represent the incremental attitude as it has a much simpler rate equation that enables exact integration iteration in terms of finite-order polynomials. The contribution of this paper is multiple-folded. Firstly, the RodFIter method gives birth to a brandnew and ultimate attitude algorithm scheme that can be naturally extended to the general rigid motion computation. Secondly, the new attitude algorithm is theoretically exact as long as the angular velocity is perfect. The incremental Rodrigues vector is obtained in the analytic form and thus the RodFIter method is able to produce attitude over the whole considered time interval. Thirdly, the RodFIter method does not depend on any special form of motion, unlike the mainstream attitude algorithms being designed with the coning motion as the criterion, and can be optimally applied to any kinds of motions.
The paper is organized as follows. Section II revisits the rotation vector and the Rodrigues vector, and their differential equations.
Section III presents the angular velocity fitting of angular velocity/increment measurements by the Chebyshev polynomial and implements the Rodrigues vector construction by way of an iteration process of functional integration. The convergence of the iteration process is provably guaranteed for cases of both perfect and erroneous measurements. Section IV discusses the natural extension of the proposed RodFIter method to the general rigid motion. Section V evaluates the proposed attitude algorithm under the coning motion and compares with the mainstream algorithms. Section VI concludes the paper.

A. Definition and Its Relation to Attitude
Among a number of parameters to represent the attitude, quaternion is the most preferred as it has the minimum number of elements and is free of singularity. Let q encode the attitude quaternion of the body frame relative to some reference frame. The Euler theorem states that any composition of finite rotations can be realized by one equivalent rotation about some fixed axis [16,17].
Denote the unit vector of the fixed axis and the magnitude of the rotation by e and  respectively, the quaternion can be expressed as The quaternion differential equation is given by where ω is the angular velocity vector expressed in the body frame and  denotes the quaternion multiplication [6].
Alternatively, the generalized kinematic vector can be used to describe the equivalent rotation [4,17]  where   f  denotes a scalar function. The kinematic vector becomes the rotation vector when We next derive the differential equation of the generalized kinematic vector using the property of quaternion [4,17].
Substitute (1) Substituting (4) into (5), the differential equation of the generalized kinematic vector is 1 cos The rotation vector has a closed-form relation to the attitude matrix as where C denotes the attitude matrix of the body frame relative to the reference frame.
The Rodrigues vector is defined as 2 tan 2         g e and the quaternion is obtained as The differential equation of the Rodrigues vector and the reverse formula are The Rodrigues vector has a closed-form relation to the attitude matrix as Equation (10) or (14) tells that the attitude cannot be simply computed by integrating the angular velocity, due to the existence of the noncommutativity rate vector. The Rodrigues vector has an apparently much simpler differential equation than the rotation vector does. The trigonometric functions in (10) and (11) do not exist in (14) and (15), owing to the special definition of the Rodrigues vector.

C. Approximation in Rotation Vector
For the fixed-axis rotation, the rotation vector rate equation (10) (with the last two terms vanishing) reduces to  g ω  while the Rodrigues vector rate equation (14) (with the middle term vanishing) only reduces to 1 ( , so the attitude algorithms have exclusively been developed from the rotation vector, for instance, in the inertial navigation field [1,3,6,7,10]. For the general rotation, the rotation/Rodrigues vector appears on the right side of the nonlinear differential equation, to which there is no analytical solution. All the modern-day attitude algorithms, pioneered by Jordan [1] and Bortz [9], approximate the right-sided rotation vector by the integrated angular velocity and then (10) is simplified as [3,6,7,10,11]         where the trigonometric function   2 sin 1 1 1 12 2 1 cos if the rotation vector's magnitude g approaches zero. In fact, the attitude algorithms in practical inertial navigation systems have only considered the first two terms in (17) so as to alleviate the complexity of the algorithm design [11], and the last term has not been taken into account until quite recently [8]. An obsolete attempt was to solve the apparently linear rate equation of the attitude matrix in terms of three column vectors by the recursive Picard integration [19]. Besides the numerical integration approximation made therein, the adverse affect, incurred by the fact that the column vectors of the attitude matrix are of unity norm, was largely disregarded.

III. ATTITUDE RECOVERY BY FUNCTIONAL ITERATION
In view of the simpler differential equation for the general rotation, the Rodrigues vector will be used instead to compute the attitude. The proposed algorithm builds on an iterative process and is proved to be convergent to the true attitude. Integrating (14), without the loss of generality, over the time interval   0 t ,

A. Reconstructing Rodrigues Vector from Angular Velocity
Construct an iterative process to calculate the Rodrigues vector as such with the initial function 0 0  g . For instance, the first two iterations yield Theorem 1: Given the true angular velocity function ω , the iterative process (19) converges to the true Rodrigues vector function over the interval when Proof. For the true angular velocity ω over the time interval   0 t , there must exist a true Rodrigues vector * g satisfying (18) and corresponding to the true attitude motion, that is, * * * * 3 0 Then the error function j ε at any time . The third equality is valid by the Mean-value Theorem of integrals. Repeat the above process, and for the considerably small time interval   0 t where g is a small quantity . We see that if as j   . So the iterative process (19) converges to the true Rodrigues vector function.
■ Proposition 1: Given the true angular velocity function ω , the iterative process (19) converges to the true Rodrigues vector function over the interval when sup 2 t  ω .
Proof. The boundedness condition in Theorem 1 can be further relaxed, ■ Proposition 1 provides a looser criterion that is easier to check the boundedness condition, namely, the product of the time interval length and the supreme magnitude of the angular velocity function over the time interval is less than 2. It can also be used to roughly determine the iteration times required to achieve the desirable accuracy, e.g., for a desirable accuracy  , we need Note the above analysis can alternatively be recast in the context of general differential equations, for which the Picard-Lindelöf theorem guarantees the iteration process's existence and uniqueness [20]. However, by making use of the specific form of the Rodrigues vector differential equation (14), Theorem 1 gives more delicate result than the general conclusion of the Picard-Lindelöf theorem.
In practice, the angular velocity function is not perfect and always contains some kinds of errors. The following theorem describes what happens to the iteration process with an error-contaminated angular velocity function ˆ  ω ω δ, where δ denotes the error function.
Theorem 2: Given an error-contaminated angular velocity function ˆ  ω ω δ , the iterative process (19) converges to the Rodrigues vector function that corresponds to the error-contaminated angular velocity function, when The proof is straightforward by referring to that of Theorem 1.
Proposition 2: Given an error-contaminated angular velocity function ˆ  ω ω δ, the discrepancy between the convergence result of the iterative process (19) and the true Rodrigues vector function is less than sup t δ in magnitude if the time interval is considerably small.
Proof. Similar with Theorem 1, for the iterative process (19) using the error-contaminated angular velocity function ˆ  ω ω δ, For a considerably small time interval   0 t , as θ and g are small quantities, We see that as j  , the second term approaches to zero and ■ Proposition 2 actually states an intuitive fact that the iterative computation accuracy of the Rodrigues vector is limited by the quality of the provided angular velocity function, which may be adversely affected by the gyroscope measurement errors and the fitting method. From another perspective, (26) depicts the quantitative contribution of both measurement errors and computation errors to the attitude reconstruction imperfection. In practice, the latter should reasonably be kept less than the former. With

B. Angular Velocity Polynomial Function Fitted from Gyroscope Measurements
In practice, we cannot directly get the angular velocity function, but are only accessible to the error-contaminated discrete measurements of angular velocity or angular increment, e.g., by gyroscopes. In view of the fact that the Chebyshev polynomial has better numerical stability than the normal polynomial [21], we use the Chebyshev polynomial to fit the discrete angular velocity or angular increment measurements. The Chebyshev polynomial of the first kind is defined by the recurrence relation as [21]           x is the i th -degree Chebyshev polynomial of the first kind.
Suppose N angular velocity/increment measurements are used. The considered time interval is   0 N t . In order to use the Chebyshev polynomials, it is required to map the time interval to   For N angular velocity measurements , 1,2, where the coefficients i c can be determined by solving the equation Similarly, for N angular increment measurements , 1,2, The fitted angular increment is related to the fitted angular velocity by Then the coefficients i c can be determined by solving the equation  Figure 1 plots the flowchart of how to reconstruct the Rodrigues vector from gyroscope measurements and to update the attitude.

C. Rodrigues Vector Reconstruction from Fitted Angular Velocity Polynomial
With the boundedness condition in mind, substituting the fitted angular velocity function (30) into the iteration process (29) is supposed to well reconstruct the Rodrigues vector function as a polynomial, as the group of polynomials are closed under elementary arithmetic operations. This is an appreciated benefit brought about by the simplicity of the Rodrigues vector's differential function (14). Referring to (29), we can see that the polynomial order of the Rodrigues vector at current iteration is equal to two times the order of that at previous iteration plus the order of the angular velocity and 1, i.e., . Analytic development of the iterative process (29) is straightforward but tedious, and one may turn to a symbolic computation toolbox in Matlab to spare the laborious work. The obtained polynomial expression can be readily saved as a function to hand.
As the Chebyshev polynomial has the same theoretical result with the normal polynomial, for better comparison we use the latter instead to exemplify the explanation. Take 2, 1 N n   as an example, the fitted angular velocity function Table I lists the reconstructed Rodrigues vector polynomials for the first two iterations. The polynomial order is 2 at the first iteration, 6 at the second iteration, and will be 14 for another iteration. Larger number of samples (N) or more iteration (j) yields a higher order Rodrigues vector polynomial.

D. Approximate Rotation Vector Reconstruction from Fitted Angular Velocity Polynomial
Approximate the rotation vector differential equation (10) as   In principle, an iteration process similar to (19) could also be used to reconstruct the approximate rotation vector (named RotFIter), i.e., with 0 0  g . It should be highlighted that this iteration process would not converge to the rotation vector, but some kind of vector whose rate equation is exactly represented by (35). It can be readily checked that two iterations will produce (17) in the integral form. In the mainstream attitude algorithm with 2 N  , the approximate rotation vector that further discards the third term in (36) is [13]   which lacks all the triple products of coefficients i c , in contrast to the Rodrigues vector polynomial at the second iteration in Table   II. The mainstream attitude algorithms for more (angular-increment) samples have been discussed in [2,5,15].

IV. EXTENSION TO GENERAL RIGID MOTION
The Chasles theorem, in analogy to the Euler theorem for pure rotation, states that the general motion of a rigid body in space consists of a rotation about an axis and a translation parallel to that axis [22]. Among many mathematical representations, dual quaternion is the most compact and efficient way to express the general rigid motion [23][24][25]. In fact, dual quaternion shares many common properties with quaternion. According to the principle of transference by Kotelnikov [26], the characteristics of quaternion are completely inherited by dual quaternion.
Therefore the above analyses and conclusions obtained from rotation/quaternion naturally extend to the general motion/dual quaternion. For example, readers are referred to [27] for an application of dual quaternion in inertial navigation representation and computation. Therein the inertial navigation principle is formulated by three dual quaternion differential equations of identical form with the quaternion differential equation (2), so the attitude reconstruction method proposed in this paper can be readily applied to the general motion problem.

V. SIMULATION RESULTS
In this section, the Rodrigues vector (and the corresponding attitude) is reconstructed and evaluated under the coning motion. The coning motion plays an important role in the inertial navigation field, as it has an analytic expression in the angular velocity and the associated generalized kinematic vector. Almost all attitude algorithms have been designed using the coning motion or its variants as the design criterion [6,7,10]. Note that the coning motion is used only as a testing motion scenario and has no affect on the design process of the RodFIter method.
The angular increment measurement from gyroscopes is assumed. The discrete angular increment measurements are uniformly generated at 100 Hz, i.e., the sampling time interval 0.01 T s  . The following angle metric is used to quantify the attitude computation error where q denotes the quaternion estimate from the reconstructed generalized kinematic vector, and   2:4  is the sub-vector formed by the last three elements of error quaternion.
The angular velocity of the coning motion is given by where the coning angle is set to 10 deg   , the coning frequency 0.74   . Figure 2 plots the angular velocity profile for the first two seconds. The magnitude of rotation is  and the unit vector of the fixed rotation axis can be readily checked that the magnitude of ω is time-invariant and 0 T  e ω which maximizes the noncommutativity rate terms of any generalized kinematic vector (6). This is the reason that the coning motion is widely used as the attitude algorithm design criterion. The corresponding Rodrigues vector 2 tan 2         g e , and the attitude quaternion can be obtained by (13). The angular increment measurements are used as the input for fitting the angular velocity polynomial (30).   Fig. 3), however, the accuracy of RotFIter-T2 cannot be further improved after two iterations. When the third term is discarded in RotFIter-T2, the result at the second iteration is unexpectedly the best and begins to degrade at further iterations (lines for the 3th-5th iterations overlapped). This phenomenon occurs because the iteration (36) converges to the some other vector whose rate equation is exactly represented by the first two terms, instead of the true rotation vector.
The left sub-figure of Figure 6 compares the attitude computation errors over the first two seconds of the RodFIter method (N = 8) and the approximate rotation vector reconstruction (RotFIter, N = 8) and the mainstream algorithm (N = 2). The number of iteration is set to 6. The RodFIter method yields the most accurate and almost drift-less attitude result. The approximate rotation vector reconstruction with the third term (RotFIter-T3) comes at the second best. Astonishingly, the approximate rotation vector reconstruction without the third term (RotFIter-T2) performs the worst, even worse than the mainstream algorithm (N = 2). It explains a frequently-encountered but never-answered phenomenon that using more samples based on the unduly-simplified rotation vector rate equation leads to worse rather than better accuracy. The right sub-figure of Figure 6 repeats the above comparison except that the sampling rate is increased to 1000 Hz. The errors of RotFIter-T3, RotFIter-T2 and mainstream algorithms (N = 2) are remarkably reduced by several orders. Notably, the RotFIter-T3 accuracy becomes comparable to the RodFIter. In contrast, the RodFIter method, still the best, gains little from the increased sampling rate, which implies the motionincurred computation error has been completely suppressed at the 100 Hz sampling rate. This observation highlights the striking capability of the RodFIter method in mitigating computation errors.
As the angular velocity/increment measurements are unavoidably contaminated by errors, sensor bias (    Figure 7 plots the attitude error of an implementation with error-contaminated measurements. The RodFIter method stabilizes within two iterations, and the result of N = 5 is much better especially between the sample times, e.g., at t = 0.015s. The error of the mainstream algorithm (37) at t = 0.02s is comparable to that of the RodFIter method, which indicates that the sensor error dominates the attitude computation error for the above simulation setting. The coning frequency is then set to 10   so as to intentionally enlarge the adverse effect of high manoeuvrs on the computation error. As shown in Fig. 8, more samples are significantly helpful to the RodFIter method in reducing the attitude errors because the computation error prevails over the sensor error in this case.
According to Proposition 1, a sufficient convergence precondition of the RodFIter method is sup 2 t  ω . We have done additional tests to explore the practical convergence region from two aspects: the supreme angular velocity and the number of samples (equivalently the iterative integration time length t N T   ). Throughout the tests, the iteration times are constantly set to seven. Specifically, we enlarge two simulation parameters, namely, the coning frequency  and the number of samples N, to see when the RodFIter method becomes to diverge, and mark the corresponding sup N     ω as the boundary of the practical convergence region. The maximum samples is ten. Figure 9 plots the test result together with the theoretical condition sup 2 t  ω .
The practical convergence region (area formed by the line and the x-y positive axes) is roughly consistent with predicted. It is obtained for fixed 0.01 T s  . That the maximum angular velocity magnitude stays below 140 rad/s for N = 2 does not mean the RodFIter method cannot be used for motion with larger rotation rate. As the signal frequency in (39)  As can be predicted, the RodFIter method imposes a huge computation load. Roughly quantified by the running time in Matlab, for example, the computation load of RodFIter (N=8) for 2-6 iterations is about 500-11000 times that of the mainstream algorithm (N=2). Hopefully, it would be alleviated by a more efficient design or hardware implementation.

VI. CONCLUSIONS
The state-of-the-art attitude algorithms in the inertial navigation field have unexceptionally relied on the simplified differential equation of the rotation vector to compute the attitude. This paper raises the RodFIter method based on the analytic iterative integration, which is enabled by the Rodrigues vector's polynomial-like differential equation and the polynomial fitting of the angular velocity/increment measurements. It is proved that the reconstructed Rodrigues vector converges to the truth if the fitted angular velocity is exact. The mainstream algorithms using multiple samples can only yield an attitude result at the time of the final sample, while the RodFIter method is analytic and able to produce attitude results over the whole iteration time interval.
Simulation tests under the attitude coning motion show that the proposed method produces a potentially ultimate attitude algorithm with the highest accuracy possible. The main idea of the RodFIter method naturally extends to the general rigid motion computation as a result of the resemblance between attitude/quaternion and general motion/dual quaternion. This work is believed having eliminated the long-standing theoretical barrier in exact motion integration from inertial measurements and diverted our attention completely to how to improve the inertial sensor quality and how to implement the proposed computation method efficiently.   Jordan, 1969 [2] by Ignagni, 1990 [3] by