InertiaSDK

Loading...
Searching...
No Matches
OrientationSettings.h
1#pragma once
2
3 namespace inertia
4{
5
7 enum OrientationAlgorithm : unsigned
8{
9 ORIENTATION_MADGWICK = 0,
10 ORIENTATION_VALENTI = 1,
11 ORIENTATION_KALMAN = 2,
12 ORIENTATION_VQF = 3
13};
14
15
20 struct INERTIA_API MadgwickAlgorithmSettings
21{
22 double gainBeta;
23
26 MadgwickAlgorithmSettings();
27
32 MadgwickAlgorithmSettings(std::wstring const& argString);
33
34#ifdef WITH_BOOST_PROGRAM_OPTIONS
39 static const po::options_description GetOptionDescription();
40#endif
41
46 std::wstring const ToString() const;
47};
48
49
54 struct INERTIA_API ValentiAlgorithmSettings
55{
56 double accelGain;
57 double compassGain;
58 bool enableAdaptiveGain;
59
62 ValentiAlgorithmSettings();
63
68 ValentiAlgorithmSettings(std::wstring const& argString);
69
70#ifdef WITH_BOOST_PROGRAM_OPTIONS
75 static const po::options_description GetOptionDescription();
76#endif
77
82 std::wstring const ToString() const;
83};
84
85
90 struct INERTIA_API KalmanAlgorithmSettings
91{
92 double accNoise;
93 double compNoise;
94 double gyroNoise;
95 double gyroBiasNoise;
96 bool adjustToSamplingRate;
97 double accMagnitudeThreshold;
98
101 KalmanAlgorithmSettings();
102
107 KalmanAlgorithmSettings(std::wstring const& argString);
108
109#ifdef WITH_BOOST_PROGRAM_OPTIONS
114 static const po::options_description GetOptionDescription();
115#endif
116
121 std::wstring const ToString() const;
122};
123
124
129 struct INERTIA_API VQFAlgorithmSettings
130{
131 double tauAcc;
132 double tauMag;
133 bool motionBiasEstEnabled;
134 bool restBiasEstEnabled;
135 bool magDistRejectionEnabled;
136
137 double biasSigmaInit;
138 double biasForgettingTime;
139 double biasClip;
140 double biasSigmaMotion;
141 double biasVerticalForgettingFactor;
142 double biasSigmaRest;
143
144 double restMinTh;
145 double restFilterTau;
146 double restThGyr;
147 double restThAcc;
148
149 double magCurrentTau;
150 double magRefTau;
151 double magNormTh;
152 double magDipTh;
153 double magNewTime;
154 double magNewFirstTime;
155 double magNewMinGyr;
156 double magMinUndisturbedTime;
157 double magMaxRejectionTime;
158 double magRejectionFactor;
159
162 VQFAlgorithmSettings();
163
168 VQFAlgorithmSettings(std::wstring const& argString);
169
170#ifdef WITH_BOOST_PROGRAM_OPTIONS
175 static const po::options_description GetOptionDescription();
176#endif
177
182 std::wstring const ToString() const;
183};
184
185
186
191 struct INERTIA_API BiasEstimationSettings
192{
193 bool enableBiasEstimation;
194 double biasAlpha;
195 double gyroThreshold;
196 double gyroDeltaThreshold;
197 double accelThreshold;
198
199 bool useFixedBias;
200 double gxFixedBias;
201 double gyFixedBias;
202 double gzFixedBias;
203
206 BiasEstimationSettings();
207
212 BiasEstimationSettings(std::wstring const& argString);
213
214#ifdef WITH_BOOST_PROGRAM_OPTIONS
219 static const po::options_description GetOptionDescription();
220#endif
221
226 std::wstring const ToString() const;
227};
228
229
234 struct INERTIA_API OrientationSettings
235{
236 OrientationAlgorithm algorithm;
237 bool useCompass;
238 bool resetInRest;
239 double initialYaw;
240
241 MadgwickAlgorithmSettings madgwickSettings;
242 ValentiAlgorithmSettings valentiSettings;
243 KalmanAlgorithmSettings kalmanSettings;
244 VQFAlgorithmSettings vqfSettings;
245 BiasEstimationSettings biasSettings;
246
249 OrientationSettings();
250
255 OrientationSettings(std::wstring const& argString);
256
257#ifdef WITH_BOOST_PROGRAM_OPTIONS
262 static const po::options_description GetOptionDescription();
263#endif
264
269 std::wstring const ToString() const;
270};
271
272}
inertia
Definition FlashCommands.h:6
inertia::OrientationAlgorithm
OrientationAlgorithm
Definition OrientationSettings.h:8
inertia::ORIENTATION_KALMAN
@ ORIENTATION_KALMAN
Extended Kalman Orientation Algorithm.
Definition OrientationSettings.h:11
inertia::ORIENTATION_MADGWICK
@ ORIENTATION_MADGWICK
Madgwick Orientation Algorithm.
Definition OrientationSettings.h:9
inertia::ORIENTATION_VQF
@ ORIENTATION_VQF
Versatile Quaternion-based Filter Algorithm.
Definition OrientationSettings.h:12
inertia::ORIENTATION_VALENTI
@ ORIENTATION_VALENTI
Valenti Orientation Algorithm.
Definition OrientationSettings.h:10
inertia::BiasEstimationSettings
Bias Estimation Algorithm Settings.
Definition OrientationSettings.h:192
inertia::BiasEstimationSettings::ToString
std::wstring const ToString() const
inertia::BiasEstimationSettings::BiasEstimationSettings
BiasEstimationSettings(std::wstring const &argString)
inertia::BiasEstimationSettings::gyroThreshold
double gyroThreshold
Gyroscope absolute threshold (from bias), default is 0.015.
Definition OrientationSettings.h:195
inertia::BiasEstimationSettings::BiasEstimationSettings
BiasEstimationSettings()
inertia::BiasEstimationSettings::gyFixedBias
double gyFixedBias
The fixed gyroscope Y-axis bias.
Definition OrientationSettings.h:201
inertia::BiasEstimationSettings::gzFixedBias
double gzFixedBias
The fixed gyroscope Z-axis bias.
Definition OrientationSettings.h:202
inertia::BiasEstimationSettings::biasAlpha
double biasAlpha
Set how fast bias is updated (0 <= value <= 1), default is 0.01.
Definition OrientationSettings.h:194
inertia::BiasEstimationSettings::gyroDeltaThreshold
double gyroDeltaThreshold
Gyroscope relative threshold (from previous value), default is 0.015.
Definition OrientationSettings.h:196
inertia::BiasEstimationSettings::gxFixedBias
double gxFixedBias
The fixed gyroscope X-axis bias.
Definition OrientationSettings.h:200
inertia::BiasEstimationSettings::enableBiasEstimation
bool enableBiasEstimation
Enable gyroscope bias estimation, default is true.
Definition OrientationSettings.h:193
inertia::BiasEstimationSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::BiasEstimationSettings::accelThreshold
double accelThreshold
Accelerometer absolute threshold (from zero), default is 0.015.
Definition OrientationSettings.h:197
inertia::BiasEstimationSettings::useFixedBias
bool useFixedBias
Use a fixed gyroscope bias, enableBiasEstimation should be enabled.
Definition OrientationSettings.h:199
inertia::KalmanAlgorithmSettings
Extended Kalman Orientation Algorithm Settings.
Definition OrientationSettings.h:91
inertia::KalmanAlgorithmSettings::compNoise
double compNoise
Compass noise, default 0.0205.
Definition OrientationSettings.h:93
inertia::KalmanAlgorithmSettings::gyroBiasNoise
double gyroBiasNoise
Gyroscope bias noise, default 0.0038.
Definition OrientationSettings.h:95
inertia::KalmanAlgorithmSettings::ToString
std::wstring const ToString() const
inertia::KalmanAlgorithmSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::KalmanAlgorithmSettings::gyroNoise
double gyroNoise
Gyroscope noise, default 0.0038.
Definition OrientationSettings.h:94
inertia::KalmanAlgorithmSettings::accNoise
double accNoise
Accelerometer noise, default 0.07.
Definition OrientationSettings.h:92
inertia::KalmanAlgorithmSettings::adjustToSamplingRate
bool adjustToSamplingRate
Adjust the noise level to the sampling rate (defaults are for 200Hz), default true.
Definition OrientationSettings.h:96
inertia::KalmanAlgorithmSettings::accMagnitudeThreshold
double accMagnitudeThreshold
Ignore accelerometer above this magnitude threshold, default 20.
Definition OrientationSettings.h:97
inertia::KalmanAlgorithmSettings::KalmanAlgorithmSettings
KalmanAlgorithmSettings(std::wstring const &argString)
inertia::KalmanAlgorithmSettings::KalmanAlgorithmSettings
KalmanAlgorithmSettings()
inertia::MadgwickAlgorithmSettings
Madgwick Orientation Algorithm Settings.
Definition OrientationSettings.h:21
inertia::MadgwickAlgorithmSettings::MadgwickAlgorithmSettings
MadgwickAlgorithmSettings(std::wstring const &argString)
inertia::MadgwickAlgorithmSettings::gainBeta
double gainBeta
Adjust the influence of the gyroscope (higher) versus accelerometer (lower) (0 <= value <= 1),...
Definition OrientationSettings.h:22
inertia::MadgwickAlgorithmSettings::ToString
std::wstring const ToString() const
inertia::MadgwickAlgorithmSettings::MadgwickAlgorithmSettings
MadgwickAlgorithmSettings()
inertia::MadgwickAlgorithmSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::OrientationSettings::biasSettings
BiasEstimationSettings biasSettings
Specific settings of the Bias Estimation Algorithm.
Definition OrientationSettings.h:245
inertia::OrientationSettings::useCompass
bool useCompass
Use data from the compass for orientation calculation.
Definition OrientationSettings.h:237
inertia::OrientationSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::OrientationSettings::initialYaw
double initialYaw
The initial yaw angle, irrelevant when compass is used.
Definition OrientationSettings.h:239
inertia::OrientationSettings::valentiSettings
ValentiAlgorithmSettings valentiSettings
Specific settings of the Valenti Orientation Algorithm.
Definition OrientationSettings.h:242
inertia::OrientationSettings::kalmanSettings
KalmanAlgorithmSettings kalmanSettings
Specific settings of the Extended Kalman Orientation Algorithm.
Definition OrientationSettings.h:243
inertia::OrientationSettings::ToString
std::wstring const ToString() const
inertia::OrientationSettings::vqfSettings
VQFAlgorithmSettings vqfSettings
Specific settings of the Versatile Quaternion-based Filter Algorithm.
Definition OrientationSettings.h:244
inertia::OrientationSettings::madgwickSettings
MadgwickAlgorithmSettings madgwickSettings
Specific settings of the Madgwick Orientation Algorithm.
Definition OrientationSettings.h:241
inertia::OrientationSettings::OrientationSettings
OrientationSettings()
inertia::OrientationSettings::resetInRest
bool resetInRest
Reset the orientation when the node stops rotating.
Definition OrientationSettings.h:238
inertia::OrientationSettings::OrientationSettings
OrientationSettings(std::wstring const &argString)
inertia::OrientationSettings::algorithm
OrientationAlgorithm algorithm
Orientation algorithm to use.
Definition OrientationSettings.h:236
inertia::VQFAlgorithmSettings
Versatile Quaternion-based Filter Algorithm Settings.
Definition OrientationSettings.h:130
inertia::VQFAlgorithmSettings::tauMag
double tauMag
Time constant for magnetometer update in seconds, default 9.0.
Definition OrientationSettings.h:132
inertia::VQFAlgorithmSettings::restThGyr
double restThGyr
Angular velocity threshold for rest detection (in °/s), default 2.0.
Definition OrientationSettings.h:146
inertia::VQFAlgorithmSettings::biasVerticalForgettingFactor
double biasVerticalForgettingFactor
Forgetting factor for unobservable bias in vertical direction during motion, default 0....
Definition OrientationSettings.h:141
inertia::VQFAlgorithmSettings::restBiasEstEnabled
bool restBiasEstEnabled
Enables rest detection and gyroscope bias estimation during rest phases, default true.
Definition OrientationSettings.h:134
inertia::VQFAlgorithmSettings::magRejectionFactor
double magRejectionFactor
Factor by which to slow the heading correction during long disturbed phases, default 2.
Definition OrientationSettings.h:158
inertia::VQFAlgorithmSettings::biasForgettingTime
double biasForgettingTime
Time in which the bias estimation uncertainty increases from 0 °/s to 0.1 °/s (in seconds),...
Definition OrientationSettings.h:138
inertia::VQFAlgorithmSettings::magRefTau
double magRefTau
Time constant for the adjustment of the magnetic field reference (in seconds), default 20.
Definition OrientationSettings.h:150
inertia::VQFAlgorithmSettings::magCurrentTau
double magCurrentTau
Time constant for current norm/dip value in magnetic disturbance detection (in seconds),...
Definition OrientationSettings.h:149
inertia::VQFAlgorithmSettings::ToString
std::wstring const ToString() const
inertia::VQFAlgorithmSettings::VQFAlgorithmSettings
VQFAlgorithmSettings(std::wstring const &argString)
inertia::VQFAlgorithmSettings::biasSigmaRest
double biasSigmaRest
Standard deviation of the converged bias estimation uncertainty during rest (in degrees per second),...
Definition OrientationSettings.h:142
inertia::VQFAlgorithmSettings::magNormTh
double magNormTh
Relative threshold for the magnetic field strength for magnetic disturbance detection,...
Definition OrientationSettings.h:151
inertia::VQFAlgorithmSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::VQFAlgorithmSettings::magNewFirstTime
double magNewFirstTime
Duration after which to accept a homogeneous magnetic field for the first time (in seconds),...
Definition OrientationSettings.h:154
inertia::VQFAlgorithmSettings::biasSigmaMotion
double biasSigmaMotion
Standard deviation of the converged bias estimation uncertainty during motion (in degrees per second)...
Definition OrientationSettings.h:140
inertia::VQFAlgorithmSettings::magNewTime
double magNewTime
Duration after which to accept a different homogeneous magnetic field (in seconds),...
Definition OrientationSettings.h:153
inertia::VQFAlgorithmSettings::magNewMinGyr
double magNewMinGyr
Minimum angular velocity needed in order to count time for new magnetic field acceptance (in °/s),...
Definition OrientationSettings.h:155
inertia::VQFAlgorithmSettings::restThAcc
double restThAcc
Acceleration threshold for rest detection (in m/s²), default 0.5.
Definition OrientationSettings.h:147
inertia::VQFAlgorithmSettings::VQFAlgorithmSettings
VQFAlgorithmSettings()
inertia::VQFAlgorithmSettings::magMinUndisturbedTime
double magMinUndisturbedTime
Minimum duration within thresholds after which to regard the field as undisturbed again (in seconds),...
Definition OrientationSettings.h:156
inertia::VQFAlgorithmSettings::tauAcc
double tauAcc
Time constant for accelerometer low-pass filtering in seconds, default 3.0.
Definition OrientationSettings.h:131
inertia::VQFAlgorithmSettings::biasSigmaInit
double biasSigmaInit
Standard deviation of the initial bias estimation uncertainty (in degrees per second),...
Definition OrientationSettings.h:137
inertia::VQFAlgorithmSettings::motionBiasEstEnabled
bool motionBiasEstEnabled
Enables gyroscope bias estimation during motion phases, default true.
Definition OrientationSettings.h:133
inertia::VQFAlgorithmSettings::biasClip
double biasClip
Maximum expected gyroscope bias (in degrees per second), default 2.0.
Definition OrientationSettings.h:139
inertia::VQFAlgorithmSettings::restMinTh
double restMinTh
Time threshold for rest detection (in seconds), default 1.5.
Definition OrientationSettings.h:144
inertia::VQFAlgorithmSettings::magDipTh
double magDipTh
Threshold for the magnetic field dip angle for magnetic disturbance detection (in degrees),...
Definition OrientationSettings.h:152
inertia::VQFAlgorithmSettings::restFilterTau
double restFilterTau
Time constant for the low-pass filter used in rest detection (in seconds), default 0....
Definition OrientationSettings.h:145
inertia::VQFAlgorithmSettings::magMaxRejectionTime
double magMaxRejectionTime
Maximum duration of full magnetic disturbance rejection (in seconds), default 60.
Definition OrientationSettings.h:157
inertia::VQFAlgorithmSettings::magDistRejectionEnabled
bool magDistRejectionEnabled
Enables magnetic disturbance detection and magnetic disturbance rejection, default true.
Definition OrientationSettings.h:135
inertia::ValentiAlgorithmSettings
Valenti Orientation Algorithm Settings.
Definition OrientationSettings.h:55
inertia::ValentiAlgorithmSettings::enableAdaptiveGain
bool enableAdaptiveGain
Enable automatic accelerometer gain adjustment, default is true.
Definition OrientationSettings.h:58
inertia::ValentiAlgorithmSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::ValentiAlgorithmSettings::ValentiAlgorithmSettings
ValentiAlgorithmSettings()
inertia::ValentiAlgorithmSettings::compassGain
double compassGain
Influence of compass (0 <= value <= 1), default is 0.001.
Definition OrientationSettings.h:57
inertia::ValentiAlgorithmSettings::ToString
std::wstring const ToString() const
inertia::ValentiAlgorithmSettings::ValentiAlgorithmSettings
ValentiAlgorithmSettings(std::wstring const &argString)
inertia::ValentiAlgorithmSettings::accelGain
double accelGain
Influence of accelerometer (0 <= value <= 1), default is 0.0005.
Definition OrientationSettings.h:56