PX4 Firmware
PX4 Autopilot Software http://px4.io
K_VELY.c
Go to the documentation of this file.
1 float t2 = q0*q3*2.0f;
2 float t9 = q1*q2*2.0f;
3 float t3 = t2-t9;
4 float t4 = q0*q0;
5 float t5 = q1*q1;
6 float t6 = q2*q2;
7 float t7 = q3*q3;
8 float t8 = t4-t5+t6-t7;
9 float t10 = q0*q1*2.0f;
10 float t11 = q2*q3*2.0f;
11 float t12 = t10+t11;
12 float t13 = q1*vd*2.0f;
13 float t14 = q0*ve*2.0f;
14 float t26 = q3*vn*2.0f;
15 float t15 = t13+t14-t26;
16 float t16 = q0*vd*2.0f;
17 float t17 = q2*vn*2.0f;
18 float t27 = q1*ve*2.0f;
19 float t18 = t16+t17-t27;
20 float t19 = q3*vd*2.0f;
21 float t20 = q2*ve*2.0f;
22 float t21 = q1*vn*2.0f;
23 float t22 = t19+t20+t21;
24 float t23 = q3*ve*2.0f;
25 float t24 = q0*vn*2.0f;
26 float t28 = q2*vd*2.0f;
27 float t25 = t23+t24-t28;
28 float t29 = P[0][0]*t15;
29 float t30 = P[1][1]*t18;
30 float t31 = P[5][4]*t8;
31 float t32 = P[6][4]*t12;
32 float t33 = P[0][4]*t15;
33 float t34 = P[1][4]*t18;
34 float t35 = P[2][4]*t22;
35 float t78 = P[4][4]*t3;
36 float t79 = P[3][4]*t25;
37 float t36 = t31+t32+t33+t34+t35-t78-t79;
38 float t37 = P[5][6]*t8;
39 float t38 = P[6][6]*t12;
40 float t39 = P[0][6]*t15;
41 float t40 = P[1][6]*t18;
42 float t41 = P[2][6]*t22;
43 float t81 = P[4][6]*t3;
44 float t82 = P[3][6]*t25;
45 float t42 = t37+t38+t39+t40+t41-t81-t82;
46 float t43 = t12*t42;
47 float t44 = P[5][0]*t8;
48 float t45 = P[6][0]*t12;
49 float t46 = P[1][0]*t18;
50 float t47 = P[2][0]*t22;
51 float t83 = P[4][0]*t3;
52 float t84 = P[3][0]*t25;
53 float t48 = t29+t44+t45+t46+t47-t83-t84;
54 float t49 = t15*t48;
55 float t50 = P[5][1]*t8;
56 float t51 = P[6][1]*t12;
57 float t52 = P[0][1]*t15;
58 float t53 = P[2][1]*t22;
59 float t85 = P[4][1]*t3;
60 float t86 = P[3][1]*t25;
61 float t54 = t30+t50+t51+t52+t53-t85-t86;
62 float t55 = t18*t54;
63 float t56 = P[5][2]*t8;
64 float t57 = P[6][2]*t12;
65 float t58 = P[0][2]*t15;
66 float t59 = P[1][2]*t18;
67 float t60 = P[2][2]*t22;
68 float t87 = P[4][2]*t3;
69 float t88 = P[3][2]*t25;
70 float t61 = t56+t57+t58+t59+t60-t87-t88;
71 float t62 = t22*t61;
72 float t63 = P[5][3]*t8;
73 float t64 = P[6][3]*t12;
74 float t65 = P[0][3]*t15;
75 float t66 = P[1][3]*t18;
76 float t67 = P[2][3]*t22;
77 float t89 = P[4][3]*t3;
78 float t90 = P[3][3]*t25;
79 float t68 = t63+t64+t65+t66+t67-t89-t90;
80 float t69 = P[5][5]*t8;
81 float t70 = P[6][5]*t12;
82 float t71 = P[0][5]*t15;
83 float t72 = P[1][5]*t18;
84 float t73 = P[2][5]*t22;
85 float t92 = P[4][5]*t3;
86 float t93 = P[3][5]*t25;
87 float t74 = t69+t70+t71+t72+t73-t92-t93;
88 float t75 = t8*t74;
89 float t80 = t3*t36;
90 float t91 = t25*t68;
91 float t76 = R_VEL+t43+t49+t55+t62+t75-t80-t91;
92 float t77 = 1.0f/t76;
93 Kfusion[0] = t77*(t29-P[0][4]*t3+P[0][5]*t8+P[0][6]*t12+P[0][1]*t18+P[0][2]*t22-P[0][3]*t25);
94 Kfusion[1] = t77*(t30-P[1][4]*t3+P[1][5]*t8+P[1][0]*t15+P[1][6]*t12+P[1][2]*t22-P[1][3]*t25);
95 Kfusion[2] = t77*(t60-P[2][4]*t3+P[2][5]*t8+P[2][0]*t15+P[2][6]*t12+P[2][1]*t18-P[2][3]*t25);
96 Kfusion[3] = t77*(-t90-P[3][4]*t3+P[3][5]*t8+P[3][0]*t15+P[3][6]*t12+P[3][1]*t18+P[3][2]*t22);
97 Kfusion[4] = t77*(-t78+P[4][5]*t8+P[4][0]*t15+P[4][6]*t12+P[4][1]*t18+P[4][2]*t22-P[4][3]*t25);
98 Kfusion[5] = t77*(t69-P[5][4]*t3+P[5][0]*t15+P[5][6]*t12+P[5][1]*t18+P[5][2]*t22-P[5][3]*t25);
99 Kfusion[6] = t77*(t38-P[6][4]*t3+P[6][5]*t8+P[6][0]*t15+P[6][1]*t18+P[6][2]*t22-P[6][3]*t25);
100 Kfusion[7] = t77*(-P[7][4]*t3+P[7][5]*t8+P[7][0]*t15+P[7][6]*t12+P[7][1]*t18+P[7][2]*t22-P[7][3]*t25);
101 Kfusion[8] = t77*(-P[8][4]*t3+P[8][5]*t8+P[8][0]*t15+P[8][6]*t12+P[8][1]*t18+P[8][2]*t22-P[8][3]*t25);
102 Kfusion[9] = t77*(-P[9][4]*t3+P[9][5]*t8+P[9][0]*t15+P[9][6]*t12+P[9][1]*t18+P[9][2]*t22-P[9][3]*t25);
103 Kfusion[10] = t77*(-P[10][4]*t3+P[10][5]*t8+P[10][0]*t15+P[10][6]*t12+P[10][1]*t18+P[10][2]*t22-P[10][3]*t25);
104 Kfusion[11] = t77*(-P[11][4]*t3+P[11][5]*t8+P[11][0]*t15+P[11][6]*t12+P[11][1]*t18+P[11][2]*t22-P[11][3]*t25);
105 Kfusion[12] = t77*(-P[12][4]*t3+P[12][5]*t8+P[12][0]*t15+P[12][6]*t12+P[12][1]*t18+P[12][2]*t22-P[12][3]*t25);
106 Kfusion[13] = t77*(-P[13][4]*t3+P[13][5]*t8+P[13][0]*t15+P[13][6]*t12+P[13][1]*t18+P[13][2]*t22-P[13][3]*t25);
107 Kfusion[14] = t77*(-P[14][4]*t3+P[14][5]*t8+P[14][0]*t15+P[14][6]*t12+P[14][1]*t18+P[14][2]*t22-P[14][3]*t25);
108 Kfusion[15] = t77*(-P[15][4]*t3+P[15][5]*t8+P[15][0]*t15+P[15][6]*t12+P[15][1]*t18+P[15][2]*t22-P[15][3]*t25);
109 Kfusion[16] = t77*(-P[16][4]*t3+P[16][5]*t8+P[16][0]*t15+P[16][6]*t12+P[16][1]*t18+P[16][2]*t22-P[16][3]*t25);
110 Kfusion[17] = t77*(-P[17][4]*t3+P[17][5]*t8+P[17][0]*t15+P[17][6]*t12+P[17][1]*t18+P[17][2]*t22-P[17][3]*t25);
111 Kfusion[18] = t77*(-P[18][4]*t3+P[18][5]*t8+P[18][0]*t15+P[18][6]*t12+P[18][1]*t18+P[18][2]*t22-P[18][3]*t25);
112 Kfusion[19] = t77*(-P[19][4]*t3+P[19][5]*t8+P[19][0]*t15+P[19][6]*t12+P[19][1]*t18+P[19][2]*t22-P[19][3]*t25);
113 Kfusion[20] = t77*(-P[20][4]*t3+P[20][5]*t8+P[20][0]*t15+P[20][6]*t12+P[20][1]*t18+P[20][2]*t22-P[20][3]*t25);
114 Kfusion[21] = t77*(-P[21][4]*t3+P[21][5]*t8+P[21][0]*t15+P[21][6]*t12+P[21][1]*t18+P[21][2]*t22-P[21][3]*t25);
115 Kfusion[22] = t77*(-P[22][4]*t3+P[22][5]*t8+P[22][0]*t15+P[22][6]*t12+P[22][1]*t18+P[22][2]*t22-P[22][3]*t25);
116 Kfusion[23] = t77*(-P[23][4]*t3+P[23][5]*t8+P[23][0]*t15+P[23][6]*t12+P[23][1]*t18+P[23][2]*t22-P[23][3]*t25);
float t88
Definition: K_VELY.c:69
float t55
Definition: K_VELY.c:62
float t48
Definition: K_VELY.c:53
float t74
Definition: K_VELY.c:87
float t60
Definition: K_VELY.c:67
float t20
Definition: K_VELY.c:21
float t23
Definition: K_VELY.c:24
float t50
Definition: K_VELY.c:55
Kfusion[0]
Definition: K_VELY.c:93
float t56
Definition: K_VELY.c:63
float t49
Definition: K_VELY.c:54
float t42
Definition: K_VELY.c:45
float t84
Definition: K_VELY.c:52
float t73
Definition: K_VELY.c:84
float t30
Definition: K_VELY.c:29
float t71
Definition: K_VELY.c:82
float t77
Definition: K_VELY.c:92
float t76
Definition: K_VELY.c:91
float t41
Definition: K_VELY.c:42
float t8
Definition: K_VELY.c:8
float t53
Definition: K_VELY.c:58
float t18
Definition: K_VELY.c:19
float t87
Definition: K_VELY.c:68
float t24
Definition: K_VELY.c:25
float t69
Definition: K_VELY.c:80
float t2
Definition: K_VELY.c:1
float t31
Definition: K_VELY.c:30
float t34
Definition: K_VELY.c:33
float t67
Definition: K_VELY.c:76
float t22
Definition: K_VELY.c:23
float t93
Definition: K_VELY.c:86
float t70
Definition: K_VELY.c:81
float t29
Definition: K_VELY.c:28
float t15
Definition: K_VELY.c:15
float t12
Definition: K_VELY.c:11
float t6
Definition: K_VELY.c:6
float t19
Definition: K_VELY.c:20
float t3
Definition: K_VELY.c:3
float t37
Definition: K_VELY.c:38
float t38
Definition: K_VELY.c:39
float t54
Definition: K_VELY.c:61
float t89
Definition: K_VELY.c:77
float t66
Definition: K_VELY.c:75
float t61
Definition: K_VELY.c:70
float t92
Definition: K_VELY.c:85
float t68
Definition: K_VELY.c:79
float t27
Definition: K_VELY.c:18
float t36
Definition: K_VELY.c:37
float t45
Definition: K_VELY.c:48
float t43
Definition: K_VELY.c:46
float t35
Definition: K_VELY.c:34
float t26
Definition: K_VELY.c:14
float t39
Definition: K_VELY.c:40
float t51
Definition: K_VELY.c:56
float t83
Definition: K_VELY.c:51
float t85
Definition: K_VELY.c:59
float t33
Definition: K_VELY.c:32
float t75
Definition: K_VELY.c:88
float t7
Definition: K_VELY.c:7
float t62
Definition: K_VELY.c:71
float t9
Definition: K_VELY.c:2
float t82
Definition: K_VELY.c:44
float t58
Definition: K_VELY.c:65
float t90
Definition: K_VELY.c:78
float t78
Definition: K_VELY.c:35
float t28
Definition: K_VELY.c:26
float t91
Definition: K_VELY.c:90
float t65
Definition: K_VELY.c:74
float t16
Definition: K_VELY.c:16
float t40
Definition: K_VELY.c:41
float t81
Definition: K_VELY.c:43
float t80
Definition: K_VELY.c:89
float t59
Definition: K_VELY.c:66
float t47
Definition: K_VELY.c:50
float t52
Definition: K_VELY.c:57
float t21
Definition: K_VELY.c:22
float t64
Definition: K_VELY.c:73
float t10
Definition: K_VELY.c:9
P[0][0]
Definition: quatCovMat.c:44
float t5
Definition: K_VELY.c:5
float t11
Definition: K_VELY.c:10
float t57
Definition: K_VELY.c:64
float t72
Definition: K_VELY.c:83
float t17
Definition: K_VELY.c:17
float t25
Definition: K_VELY.c:27
float t63
Definition: K_VELY.c:72
float t4
Definition: K_VELY.c:4
float t79
Definition: K_VELY.c:36
float t86
Definition: K_VELY.c:60
float t14
Definition: K_VELY.c:13
float t44
Definition: K_VELY.c:47
float t32
Definition: K_VELY.c:31
float t13
Definition: K_VELY.c:12
float t46
Definition: K_VELY.c:49