C language implementation of inertial navigation update algorithm (mechanical arrangement)

Quaternion

Quaternion can be used to describe rigid body rotation or attitude transformation, and its expression is concise compared with direction cosine matrix. A quaternion is a column vector containing four elements. The first element of the column vector represents the angle that the rigid body has rotated around the rotation axis, and the remaining 3 elements represent the direction of the rotation axis.
insert image description here

Attitude Update Algorithm

The recursive calculation of the attitude of this program is realized by quaternion, and the change of attitude is represented by the equivalent rotation vector.
When updating the attitude, the attitude quaternion at k-1 time and the two gyroscope angles at k-1 to k time are used. Incremental sampling, the calculation method is as follows:

insert image description here
The normalization of the quaternion in the program qmulrv()is carried out in the function, and the function of this function is: update the attitude quaternion by using the rotation vector.
insert image description here
In the program, the twin-sample coning error compensation coningcom()is carried out in the function. The function of this function is: to perform coning error compensation and output the compensated rotation vector.
insert image description here

speed update algorithm

Guess you like

Origin blog.csdn.net/absll/article/details/130212857