-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathUAVSoloEmpiricData.h
112 lines (97 loc) · 6.85 KB
/
UAVSoloEmpiricData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#ifndef UAVSOLOEMPIRICDATA_H_
#define UAVSOLOEMPIRICDATA_H_
static const u_int NUM_ANGLES = 11;
static const float VOLTAGE = 14.8;
static const float ANGLE2SPEED[NUM_ANGLES][3] = {
// angle [°], mean speed [m/s], stddev
{ -90.0, 1.836668, 0.031363919 }, //
{ -75.6, 1.842679, 0.022660066 }, //
{ -57.9, 2.011912, 0.054985077 }, //
{ -34.8, 2.449783, 0.041437770 }, //
{ -15.6, 3.577951, 0.127245911 }, //
{ 000.0, 8.050838, 0.408570489 }, //
{ +15.6, 6.016608, 0.099157007 }, //
{ +34.8, 3.335669, 0.054730422 }, //
{ +57.9, 2.814473, 0.171185809 }, //
{ +75.6, 2.718997, 0.006420997 }, //
{ +90.0, 2.718687, 0.030244684 } //
};
static const float ANGLE2POWER[NUM_ANGLES][2] = {
// angle [°], mean power [W]
{ -90.0, 248.72 }, //
{ -75.6, 263.72 }, //
{ -57.9, 251.73 }, //
{ -34.8, 253.47 }, //
{ -15.6, 235.09 }, //
{ 000.0, 241.11 }, //
{ +15.6, 274.69 }, //
{ +34.8, 295.56 }, //
{ +57.9, 307.21 }, //
{ +75.6, 313.67 }, //
{ +90.0, 307.05 } //
};
static const u_int NUM_ANGLELAGS = 30;
static const float ANGLE2LAGS[NUM_ANGLES][NUM_ANGLELAGS + 1] = {
// angle [°], lag pacf values 1..30
{ -90.0, 0.602870, -0.099348, 0.326906, 0.043453, 0.116452, 0.029241, 0.030929, 0.030780, 0.034543, -0.001088, 0.006448, 0.021622, -0.009272, 0.025219, 0.021189, 0.033977, 0.016235, 0.038448, 0.019304, -0.000470, 0.048786, 0.001455, -0.040031, 0.038297, 0.015086, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 }, //
{ -75.6, 0.543535, -0.193648, 0.425100, 0.019627, 0.083271, 0.034254, 0.051246, 0.013434, 0.058274, 0.031759, -0.048089, 0.029717, -0.005071, -0.046914, -0.014648, 0.030528, -0.062127, -0.016262, 0.009044, 0.022704, 0.075686, 0.088229, 0.023119, -0.053067, 0.057553, 0.025576, -0.046556, -0.026023, 0.019708, 0.000000 }, //
{ -57.9, 0.546199, -0.135652, 0.283193, 0.049428, 0.046967, -0.026055, -0.015441, 0.008284, 0.025462, -0.044673, -0.020539, 0.020894, 0.014251, -0.055059, -0.035020, 0.004948, -0.032977, -0.007416, 0.009487, -0.028416, 0.000771, -0.023837, -0.006336, -0.028849, 0.023474, 0.015457, 0.000000, 0.000000, 0.000000, 0.000000 }, //
{ -34.8, 0.635358, -0.065782, 0.253598, 0.010649, -0.034858, -0.040617, -0.022051, 0.005176, -0.008139, 0.017821, -0.060356, 0.014838, 0.054062, -0.015288, 0.019326, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 }, //
{ -15.6, 0.746985, -0.023296, 0.142823, -0.084610, -0.140694, -0.046345, -0.065839, -0.077775, 0.025977, -0.076740, 0.011289, 0.013626, 0.032180, 0.032767, -0.008552, -0.013131, 0.022933, -0.035067, -0.036558, -0.015937, 0.028912, -0.073561, -0.046366, -0.018824, -0.002654, 0.040818, 0.000000, 0.000000, 0.000000, 0.000000 }, //
{ 000.0, 0.624368, -0.049391, 0.149585, 0.041685, 0.011993, -0.053053, 0.034759, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 }, //
{ +15.6, 0.713970, -0.089637, -0.007911, -0.148626, -0.101049, -0.035941, -0.102095, -0.076515, 0.105317, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 }, //
{ +34.8, 0.846963, 0.002103, 0.172759, -0.054571, -0.002496, -0.057763, -0.000821, 0.025253, -0.087966, -0.068253, -0.041401, -0.047207, -0.035327, -0.071814, -0.121728, 0.024005, -0.034875, -0.066401, 0.000864, 0.044081, 0.000089, 0.006394, 0.014177, -0.011933, 0.000213, -0.061582, -0.038674, -0.065684, 0.005749, 0.045202 }, //
{ +57.9, 0.701395, 0.003879, 0.421778, 0.076800, 0.047875, 0.006602, -0.028975, -0.014768, 0.044708, -0.019010, -0.052806, 0.033230, 0.030930, -0.072363, -0.076551, -0.004834, 0.016707, -0.039474, -0.011696, -0.016923, -0.003455, -0.030162, -0.022031, -0.000910, 0.044917, -0.001328, 0.017818, -0.032323, 0.052376, 0.000000 }, //
{ +75.6, 0.648853, -0.082543, 0.353282, 0.085898, 0.012150, 0.049080, 0.098551, -0.034794, -0.005522, -0.094013, 0.043546, -0.039463, 0.022750, -0.066608, -0.103445, 0.076182, 0.037266, -0.118397, -0.058987, -0.005028, 0.022697, -0.069520, -0.054269, -0.126105, -0.000649, 0.055750, 0.003544, -0.014064, 0.068961, 0.000000 }, //
{ +90.0, 0.598692, -0.082910, 0.369154, 0.105814, 0.092360, 0.001905, -0.012166, 0.029412, 0.074414, -0.029588, -0.032907, 0.038135, 0.071966, -0.034125, -0.065830, 0.011362, 0.033535, 0.018062, -0.002315, -0.031160, -0.016724, 0.000113, -0.050036, -0.021369, -0.032415, 0.018942, 0.013067, -0.005622, 0.045842, 0.000000 } //
};
static const float HOVER_MEAN = 262.7; // mean power [W]
static const u_int NUM_HOVERLAGS = 14;
static const float HOVER_LAGS[NUM_HOVERLAGS + 1] = {
// empty (0), lag pacf values 1..14
0, 0.682, -0.058, 0.233, 0.076, 0.096, -0.028, -0.060, 0.036, 0.067, 0.057, 0.017, 0.014, -0.009, 0.085
};
static const float STANDBY_MEAN = 16.0; // mean power [W]
static const int LAGS_SAMPLES_PER_SECOND = 10;
/**
* ACF variance inference method by Prof Hotz
* Compare chapter 4.4. of thesis
*/
inline float getVarianceFromHFormula(int angleIdx, float duration)
{
float variance = 0;
float sum = 0;
u_int n = (u_int) (duration * LAGS_SAMPLES_PER_SECOND);
if (angleIdx == -1) {
// Hover Maneuver
for (u_int h = 1; h <= n-1; ++h) {
if (h >= NUM_HOVERLAGS) break;
sum += (n - h) * HOVER_LAGS[h + 1];
}
variance = n * HOVER_LAGS[0 + 1] + 2 * sum;
} else {
// Movement Maneuver
for (u_int h = 1; h <= n-1; ++h) {
if (h >= NUM_ANGLELAGS) break;
sum += (n - h) * ANGLE2LAGS[angleIdx][h + 1];
}
variance = n * ANGLE2LAGS[angleIdx][0 + 1] + 2 * sum;
}
variance = variance / pow(LAGS_SAMPLES_PER_SECOND, 3);
return abs(variance);
}
#endif /* UAVSOLOEMPIRICDATA_H_ */