InertiaSDK

Loading...
Searching...
No Matches
Sample.h
1#pragma once
2#include "dll/LogColumns.h"
3#include "data/GPSSample.h"
4#include "data/config/ConfigChannel.h"
5
6 namespace inertia
7{
8 enum StatusMeasurementID : unsigned;
9
10
15 struct INERTIA_API StatusValue
16{
17 uint8_t version;
18 double value;
19 uint32_t rawData;
20
22 StatusValue()
23 : version(0)
24 , value(0)
25 , rawData(0)
26 {}
27
33 StatusValue(uint8_t const& _version, double const& _value, uint32_t const& _rawData)
34 : version(_version)
35 , value(_value)
36 , rawData(_rawData)
37 {}
38};
39
44 struct INERTIA_API AxisData
45{
46 ConfigType configType;
47 uint8_t sensorID;
48 std::vector<double> values;
49
51 AxisData()
52 : configType(CONFIG_IGNORE)
53 , sensorID((uint8_t)-1)
54 {}
55
61 AxisData(ConfigType const& _configType, uint8_t const& _sensorID, std::vector<double> const& _values)
62 : configType(_configType)
63 , sensorID(_sensorID)
64 , values(_values)
65 {}
66};
67
72 struct INERTIA_API Sample
73{
74 bool hasTimestamp;
75 double timestamp;
76
77 unsigned lostSamples;
78
79 bool hasAccel;
80 double ax;
81 double ay;
82 double az;
83
84 bool hasCompass;
85 double cx;
86 double cy;
87 double cz;
88
89 bool hasGyro;
90 double gx;
91 double gy;
92 double gz;
93
94 bool hasAccelHighG;
95 double axhg;
96 double ayhg;
97 double azhg;
98
99 bool hasPressure;
100 double pressure;
101
102 bool hasTemp;
103 double temp;
104
105 bool hasRSSI;
106 double rssi;
107
108 bool hasRTC;
109 unsigned rtc;
110
111 bool hasOrientation;
112 Quaternion orientation;
113
114 bool hasEulerAngles;
115 double roll;
116 double pitch;
117 double yaw;
118
119 unsigned sampleNumber;
120 unsigned sn;
121 unsigned index;
122 unsigned slot;
123
124 std::vector<double> ima;
125
127 std::map<unsigned, double> adc;
128
130 std::map<unsigned, double> ioCmd;
131
133 std::map<unsigned, std::vector<double> > custom;
134
136 std::shared_ptr<GPSsample> gps;
137
139 std::map<StatusMeasurementID, StatusValue> status;
140
142 std::vector<AxisData> axisData;
143
145 Sample();
146
154 static const Sample Average(std::vector<Sample> const& samples, const unsigned start, const unsigned end);
155};
156
157}
inertia
Definition FlashCommands.h:6
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::CONFIG_IGNORE
@ CONFIG_IGNORE
Ignore Configuration.
Definition ConfigChannel.h:33
inertia::AxisData::AxisData
AxisData()
Definition Sample.h:51
inertia::AxisData::sensorID
uint8_t sensorID
sensorID of data
Definition Sample.h:47
inertia::AxisData::values
std::vector< double > values
the data values
Definition Sample.h:48
inertia::AxisData::AxisData
AxisData(ConfigType const &_configType, uint8_t const &_sensorID, std::vector< double > const &_values)
Definition Sample.h:61
inertia::AxisData::configType
ConfigType configType
configuration type of data
Definition Sample.h:46
inertia::Quaternion
Quaternion.
Definition Quaternion.h:12
inertia::Sample::ima
std::vector< double > ima
IMA (Integral measurement of Accelerometer) values.
Definition Sample.h:124
inertia::Sample::hasTemp
bool hasTemp
The sample has a temperature value.
Definition Sample.h:102
inertia::Sample::pitch
double pitch
Pitch angle (degrees) around Y-axis.
Definition Sample.h:116
inertia::Sample::Average
static const Sample Average(std::vector< Sample > const &samples, const unsigned start, const unsigned end)
inertia::Sample::rssi
double rssi
Radio signal strength (dBm).
Definition Sample.h:106
inertia::Sample::status
std::map< StatusMeasurementID, StatusValue > status
Map containing status values.
Definition Sample.h:139
inertia::Sample::hasTimestamp
bool hasTimestamp
The sample has a valid timestamp.
Definition Sample.h:74
inertia::Sample::hasAccelHighG
bool hasAccelHighG
The sample has high-g accelerometer values.
Definition Sample.h:94
inertia::Sample::gps
std::shared_ptr< GPSsample > gps
Pointer to GPSsample, initialized when there is GPS data.
Definition Sample.h:136
inertia::Sample::yaw
double yaw
Yaw angle (degrees) around Z-axis.
Definition Sample.h:117
inertia::Sample::Sample
Sample()
inertia::Sample::ax
double ax
Accelerometer X (m/s2).
Definition Sample.h:80
inertia::Sample::sn
unsigned sn
Frame number of the sample.
Definition Sample.h:120
inertia::Sample::hasRTC
bool hasRTC
The sample has a RTC value.
Definition Sample.h:108
inertia::Sample::gy
double gy
Gyroscope Y (deg/s).
Definition Sample.h:91
inertia::Sample::pressure
double pressure
Barometric pressure (hPa).
Definition Sample.h:100
inertia::Sample::temp
double temp
Temperature (deg Celsius) inside device.
Definition Sample.h:103
inertia::Sample::azhg
double azhg
High-g accelerometer Z (m/s2).
Definition Sample.h:97
inertia::Sample::gz
double gz
Gyroscope Z (deg/s).
Definition Sample.h:92
inertia::Sample::slot
unsigned slot
Radio slot position.
Definition Sample.h:122
inertia::Sample::cz
double cz
Compass Z (gauss).
Definition Sample.h:87
inertia::Sample::sampleNumber
unsigned sampleNumber
Sample number.
Definition Sample.h:119
inertia::Sample::axhg
double axhg
High-g accelerometer X (m/s2).
Definition Sample.h:95
inertia::Sample::hasCompass
bool hasCompass
The sample has compass values.
Definition Sample.h:84
inertia::Sample::ay
double ay
Accelerometer Y (m/s2).
Definition Sample.h:81
inertia::Sample::timestamp
double timestamp
Synchronized timestamp (seconds) relative to start time of gateway (when sampling synchronous).
Definition Sample.h:75
inertia::Sample::custom
std::map< unsigned, std::vector< double > > custom
Map containing data of custom sampling channels.
Definition Sample.h:133
inertia::Sample::lostSamples
unsigned lostSamples
Lost samples since previous sample.
Definition Sample.h:77
inertia::Sample::gx
double gx
Gyroscope X (deg/s).
Definition Sample.h:90
inertia::Sample::roll
double roll
Roll angle (degrees) around X-axis.
Definition Sample.h:115
inertia::Sample::adc
std::map< unsigned, double > adc
Map containing ADC values per analog input.
Definition Sample.h:127
inertia::Sample::hasGyro
bool hasGyro
The sample has gyroscope values.
Definition Sample.h:89
inertia::Sample::hasOrientation
bool hasOrientation
The sample has an orientation.
Definition Sample.h:111
inertia::Sample::hasPressure
bool hasPressure
The sample has a pressure value.
Definition Sample.h:99
inertia::Sample::cy
double cy
Compass Y (gauss).
Definition Sample.h:86
inertia::Sample::az
double az
Accelerometer Z (m/s2).
Definition Sample.h:82
inertia::Sample::orientation
Quaternion orientation
Orientation represented in a quaternion.
Definition Sample.h:112
inertia::Sample::index
unsigned index
Index within the frame.
Definition Sample.h:121
inertia::Sample::axisData
std::vector< AxisData > axisData
Vector with data per sensorID.
Definition Sample.h:142
inertia::Sample::hasEulerAngles
bool hasEulerAngles
The sample has Euler angles (converted from orientation quaternion).
Definition Sample.h:114
inertia::Sample::cx
double cx
Compass X (gauss).
Definition Sample.h:85
inertia::Sample::ioCmd
std::map< unsigned, double > ioCmd
Map containing I/O command response values (from Advanced Inertia Gateway), per I/O-port number.
Definition Sample.h:130
inertia::Sample::hasRSSI
bool hasRSSI
The sample has a RSSI value.
Definition Sample.h:105
inertia::Sample::ayhg
double ayhg
High-g accelerometer Y (m/s2).
Definition Sample.h:96
inertia::Sample::rtc
unsigned rtc
Real time clock (seconds).
Definition Sample.h:109
inertia::Sample::hasAccel
bool hasAccel
The sample has accelerometer values.
Definition Sample.h:79
inertia::StatusValue::version
uint8_t version
version
Definition Sample.h:17
inertia::StatusValue::rawData
uint32_t rawData
raw data
Definition Sample.h:19
inertia::StatusValue::StatusValue
StatusValue()
Definition Sample.h:22
inertia::StatusValue::StatusValue
StatusValue(uint8_t const &_version, double const &_value, uint32_t const &_rawData)
Definition Sample.h:33
inertia::StatusValue::value
double value
converted value
Definition Sample.h:18