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