MIP_SDK  v3.0.0-208-gdb90bae
MicroStrain Communications Library for embedded systems
data_sensor.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
7 
8 namespace mip::metadata
9 {
10 
11 
12 template<>
13 struct MetadataFor<data_sensor::RawAccel>
14 {
16 
17  static constexpr inline ParameterInfo parameters[] = {
18  {
19  /* .name = */ "raw_accel",
20  /* .docs = */ "Native sensor counts",
22  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::raw_accel>,
23  /* .attributes = */ {true, false, false, false, false},
24  /* .count = */ 1,
25  /* .condition = */ {},
26  },
27  };
28 
29  static constexpr inline FieldInfo value = {
30  {
31  /* .name = */ "data_sensor::RawAccel",
32  /* .title = */ "raw_accel",
33  /* .docs = */ "Three element vector representing the sensed acceleration.\nThis quantity is temperature compensated and expressed in the sensor body frame.",
34  /* .parameters = */ parameters,
35  },
36  /* .descriptor = */ type::DESCRIPTOR,
37  /* .functions = */ NO_FUNCTIONS,
38  /* .response = */ nullptr,
39  };
40 };
41 
42 template<>
43 struct MetadataFor<data_sensor::RawGyro>
44 {
46 
47  static constexpr inline ParameterInfo parameters[] = {
48  {
49  /* .name = */ "raw_gyro",
50  /* .docs = */ "Native sensor counts",
52  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::raw_gyro>,
53  /* .attributes = */ {true, false, false, false, false},
54  /* .count = */ 1,
55  /* .condition = */ {},
56  },
57  };
58 
59  static constexpr inline FieldInfo value = {
60  {
61  /* .name = */ "data_sensor::RawGyro",
62  /* .title = */ "raw_gyro",
63  /* .docs = */ "Three element vector representing the sensed angular rate.\nThis quantity is temperature compensated and expressed in the sensor body frame.",
64  /* .parameters = */ parameters,
65  },
66  /* .descriptor = */ type::DESCRIPTOR,
67  /* .functions = */ NO_FUNCTIONS,
68  /* .response = */ nullptr,
69  };
70 };
71 
72 template<>
73 struct MetadataFor<data_sensor::RawMag>
74 {
76 
77  static constexpr inline ParameterInfo parameters[] = {
78  {
79  /* .name = */ "raw_mag",
80  /* .docs = */ "Native sensor counts",
82  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::raw_mag>,
83  /* .attributes = */ {true, false, false, false, false},
84  /* .count = */ 1,
85  /* .condition = */ {},
86  },
87  };
88 
89  static constexpr inline FieldInfo value = {
90  {
91  /* .name = */ "data_sensor::RawMag",
92  /* .title = */ "raw_mag",
93  /* .docs = */ "Three element vector representing the sensed magnetic field.\nThis quantity is temperature compensated and expressed in the vehicle frame.",
94  /* .parameters = */ parameters,
95  },
96  /* .descriptor = */ type::DESCRIPTOR,
97  /* .functions = */ NO_FUNCTIONS,
98  /* .response = */ nullptr,
99  };
100 };
101 
102 template<>
103 struct MetadataFor<data_sensor::RawPressure>
104 {
106 
107  static constexpr inline ParameterInfo parameters[] = {
108  {
109  /* .name = */ "raw_pressure",
110  /* .docs = */ "Native sensor counts",
111  /* .type = */ {Type::FLOAT, nullptr},
112  /* .accessor = */ nullptr, //utils::access<type, float, &type::raw_pressure>,
113  /* .attributes = */ {true, false, false, false, false},
114  /* .count = */ 1,
115  /* .condition = */ {},
116  },
117  };
118 
119  static constexpr inline FieldInfo value = {
120  {
121  /* .name = */ "data_sensor::RawPressure",
122  /* .title = */ "raw_pressure",
123  /* .docs = */ "Scalar value representing the sensed ambient pressure.\nThis quantity is temperature compensated.",
124  /* .parameters = */ parameters,
125  },
126  /* .descriptor = */ type::DESCRIPTOR,
127  /* .functions = */ NO_FUNCTIONS,
128  /* .response = */ nullptr,
129  };
130 };
131 
132 template<>
133 struct MetadataFor<data_sensor::ScaledAccel>
134 {
136 
137  static constexpr inline ParameterInfo parameters[] = {
138  {
139  /* .name = */ "scaled_accel",
140  /* .docs = */ "(x, y, z)[g]",
141  /* .type = */ {Type::STRUCT, &MetadataFor<Vector3f>::value},
142  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::scaled_accel>,
143  /* .attributes = */ {true, false, false, false, false},
144  /* .count = */ 1,
145  /* .condition = */ {},
146  },
147  };
148 
149  static constexpr inline FieldInfo value = {
150  {
151  /* .name = */ "data_sensor::ScaledAccel",
152  /* .title = */ "scaled_accel",
153  /* .docs = */ "3-element vector representing the sensed acceleration.\nThis quantity is temperature compensated and expressed in the vehicle frame.",
154  /* .parameters = */ parameters,
155  },
156  /* .descriptor = */ type::DESCRIPTOR,
157  /* .functions = */ NO_FUNCTIONS,
158  /* .response = */ nullptr,
159  };
160 };
161 
162 template<>
163 struct MetadataFor<data_sensor::ScaledGyro>
164 {
166 
167  static constexpr inline ParameterInfo parameters[] = {
168  {
169  /* .name = */ "scaled_gyro",
170  /* .docs = */ "(x, y, z) [radians/second]",
171  /* .type = */ {Type::STRUCT, &MetadataFor<Vector3f>::value},
172  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::scaled_gyro>,
173  /* .attributes = */ {true, false, false, false, false},
174  /* .count = */ 1,
175  /* .condition = */ {},
176  },
177  };
178 
179  static constexpr inline FieldInfo value = {
180  {
181  /* .name = */ "data_sensor::ScaledGyro",
182  /* .title = */ "scaled_gyro",
183  /* .docs = */ "3-element vector representing the sensed angular rate.\nThis quantity is temperature compensated and expressed in the vehicle frame.",
184  /* .parameters = */ parameters,
185  },
186  /* .descriptor = */ type::DESCRIPTOR,
187  /* .functions = */ NO_FUNCTIONS,
188  /* .response = */ nullptr,
189  };
190 };
191 
192 template<>
193 struct MetadataFor<data_sensor::ScaledMag>
194 {
196 
197  static constexpr inline ParameterInfo parameters[] = {
198  {
199  /* .name = */ "scaled_mag",
200  /* .docs = */ "(x, y, z) [Gauss]",
201  /* .type = */ {Type::STRUCT, &MetadataFor<Vector3f>::value},
202  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::scaled_mag>,
203  /* .attributes = */ {true, false, false, false, false},
204  /* .count = */ 1,
205  /* .condition = */ {},
206  },
207  };
208 
209  static constexpr inline FieldInfo value = {
210  {
211  /* .name = */ "data_sensor::ScaledMag",
212  /* .title = */ "scaled_mag",
213  /* .docs = */ "3-element vector representing the sensed magnetic field.\nThis quantity is temperature compensated and expressed in the vehicle frame.",
214  /* .parameters = */ parameters,
215  },
216  /* .descriptor = */ type::DESCRIPTOR,
217  /* .functions = */ NO_FUNCTIONS,
218  /* .response = */ nullptr,
219  };
220 };
221 
222 template<>
223 struct MetadataFor<data_sensor::ScaledPressure>
224 {
226 
227  static constexpr inline ParameterInfo parameters[] = {
228  {
229  /* .name = */ "scaled_pressure",
230  /* .docs = */ "[mBar]",
231  /* .type = */ {Type::FLOAT, nullptr},
232  /* .accessor = */ nullptr, //utils::access<type, float, &type::scaled_pressure>,
233  /* .attributes = */ {true, false, false, false, false},
234  /* .count = */ 1,
235  /* .condition = */ {},
236  },
237  };
238 
239  static constexpr inline FieldInfo value = {
240  {
241  /* .name = */ "data_sensor::ScaledPressure",
242  /* .title = */ "scaled_pressure",
243  /* .docs = */ "Scalar value representing the sensed ambient pressure.",
244  /* .parameters = */ parameters,
245  },
246  /* .descriptor = */ type::DESCRIPTOR,
247  /* .functions = */ NO_FUNCTIONS,
248  /* .response = */ nullptr,
249  };
250 };
251 
252 template<>
253 struct MetadataFor<data_sensor::DeltaTheta>
254 {
256 
257  static constexpr inline ParameterInfo parameters[] = {
258  {
259  /* .name = */ "delta_theta",
260  /* .docs = */ "(x, y, z) [radians]",
261  /* .type = */ {Type::STRUCT, &MetadataFor<Vector3f>::value},
262  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::delta_theta>,
263  /* .attributes = */ {true, false, false, false, false},
264  /* .count = */ 1,
265  /* .condition = */ {},
266  },
267  };
268 
269  static constexpr inline FieldInfo value = {
270  {
271  /* .name = */ "data_sensor::DeltaTheta",
272  /* .title = */ "delta_theta",
273  /* .docs = */ "3-element vector representing the time integral of angular rate.\nThis quantity is the integral of sensed angular rate over the period set by the IMU message format. It is expressed in the vehicle frame.",
274  /* .parameters = */ parameters,
275  },
276  /* .descriptor = */ type::DESCRIPTOR,
277  /* .functions = */ NO_FUNCTIONS,
278  /* .response = */ nullptr,
279  };
280 };
281 
282 template<>
283 struct MetadataFor<data_sensor::DeltaVelocity>
284 {
286 
287  static constexpr inline ParameterInfo parameters[] = {
288  {
289  /* .name = */ "delta_velocity",
290  /* .docs = */ "(x, y, z) [g*sec]",
291  /* .type = */ {Type::STRUCT, &MetadataFor<Vector3f>::value},
292  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::delta_velocity>,
293  /* .attributes = */ {true, false, false, false, false},
294  /* .count = */ 1,
295  /* .condition = */ {},
296  },
297  };
298 
299  static constexpr inline FieldInfo value = {
300  {
301  /* .name = */ "data_sensor::DeltaVelocity",
302  /* .title = */ "delta_velocity",
303  /* .docs = */ "3-element vector representing the time integral of acceleration.\nThis quantity is the integral of sensed acceleration over the period set by the IMU message format. It is expressed in the vehicle frame.",
304  /* .parameters = */ parameters,
305  },
306  /* .descriptor = */ type::DESCRIPTOR,
307  /* .functions = */ NO_FUNCTIONS,
308  /* .response = */ nullptr,
309  };
310 };
311 
312 template<>
313 struct MetadataFor<data_sensor::CompOrientationMatrix>
314 {
316 
317  static constexpr inline ParameterInfo parameters[] = {
318  {
319  /* .name = */ "m",
320  /* .docs = */ "Matrix elements in row-major order.",
321  /* .type = */ {Type::STRUCT, &MetadataFor<Matrix3f>::value},
322  /* .accessor = */ nullptr, //utils::access<type, Matrix3f, &type::m>,
323  /* .attributes = */ {true, false, false, false, false},
324  /* .count = */ 1,
325  /* .condition = */ {},
326  },
327  };
328 
329  static constexpr inline FieldInfo value = {
330  {
331  /* .name = */ "data_sensor::CompOrientationMatrix",
332  /* .title = */ "Complementary Filter Orientation Matrix",
333  /* .docs = */ "3x3 Direction Cosine Matrix EQSTART M_{ned}^{veh} EQEND describing the orientation of the device with respect to the NED local-level frame.\nThis matrix satisfies the following relationship:\n\nEQSTART v^{veh} = M_{ned}^{veh} v^{ned} EQEND<br/>\n\nWhere:<br/>\n\nEQSTART v^{ned} EQEND is a 3-element vector expressed in the NED frame. <br/>\nEQSTART v^{veh} EQEND is the same 3-element vector expressed in the vehicle frame. <br/>\n<br/>\nThe matrix elements are stored is row-major order: EQSTART M = \\begin{bmatrix} M_{11}, M_{12}, M_{13}, M_{21}, M_{22}, M_{23}, M_{31}, M_{32}, M_{33} \\end{bmatrix} EQEND",
334  /* .parameters = */ parameters,
335  },
336  /* .descriptor = */ type::DESCRIPTOR,
337  /* .functions = */ NO_FUNCTIONS,
338  /* .response = */ nullptr,
339  };
340 };
341 
342 template<>
343 struct MetadataFor<data_sensor::CompQuaternion>
344 {
346 
347  static constexpr inline ParameterInfo parameters[] = {
348  {
349  /* .name = */ "q",
350  /* .docs = */ "Quaternion elements EQSTART q = (q_w, q_x, q_y, q_z) EQEND",
351  /* .type = */ {Type::STRUCT, &MetadataFor<Quatf>::value},
352  /* .accessor = */ nullptr, //utils::access<type, Quatf, &type::q>,
353  /* .attributes = */ {true, false, false, false, false},
354  /* .count = */ 1,
355  /* .condition = */ {},
356  },
357  };
358 
359  static constexpr inline FieldInfo value = {
360  {
361  /* .name = */ "data_sensor::CompQuaternion",
362  /* .title = */ "Complementary Filter Quaternion",
363  /* .docs = */ "4x1 vector representation of the quaternion describing the orientation of the device with respect to the NED local-level frame.\nThis quaternion satisfies the following relationship:\n\nEQSTART p^{veh} = q^{-1} p^{ned} q EQEND<br/>\n\nWhere:<br/>\nEQSTART q = (q_w, q_x, q_y, q_z) EQEND is the quaternion describing the rotation. <br/>\nEQSTART p^ned = (0, v^{ned}_x, v^{ned}_y, v^{ned}_z) EQEND and EQSTART v^{ned} EQEND is a 3-element vector expressed in the NED frame.<br/>\nEQSTART p^veh = (0, v^{veh}_x, v^{veh}_y, v^{veh}_z) EQEND and EQSTART v^{veh} EQEND is a 3-element vector expressed in the vehicle frame.<br/>",
364  /* .parameters = */ parameters,
365  },
366  /* .descriptor = */ type::DESCRIPTOR,
367  /* .functions = */ NO_FUNCTIONS,
368  /* .response = */ nullptr,
369  };
370 };
371 
372 template<>
373 struct MetadataFor<data_sensor::CompEulerAngles>
374 {
376 
377  static constexpr inline ParameterInfo parameters[] = {
378  {
379  /* .name = */ "roll",
380  /* .docs = */ "[radians]",
381  /* .type = */ {Type::FLOAT, nullptr},
382  /* .accessor = */ nullptr, //utils::access<type, float, &type::roll>,
383  /* .attributes = */ {true, false, false, false, false},
384  /* .count = */ 1,
385  /* .condition = */ {},
386  },
387  {
388  /* .name = */ "pitch",
389  /* .docs = */ "[radians]",
390  /* .type = */ {Type::FLOAT, nullptr},
391  /* .accessor = */ nullptr, //utils::access<type, float, &type::pitch>,
392  /* .attributes = */ {true, false, false, false, false},
393  /* .count = */ 1,
394  /* .condition = */ {},
395  },
396  {
397  /* .name = */ "yaw",
398  /* .docs = */ "[radians]",
399  /* .type = */ {Type::FLOAT, nullptr},
400  /* .accessor = */ nullptr, //utils::access<type, float, &type::yaw>,
401  /* .attributes = */ {true, false, false, false, false},
402  /* .count = */ 1,
403  /* .condition = */ {},
404  },
405  };
406 
407  static constexpr inline FieldInfo value = {
408  {
409  /* .name = */ "data_sensor::CompEulerAngles",
410  /* .title = */ "Complementary Filter Euler Angles",
411  /* .docs = */ "Euler angles describing the orientation of the device with respect to the NED local-level frame.\nThe Euler angles are reported in 3-2-1 (Yaw-Pitch-Roll, AKA Aircraft) order.",
412  /* .parameters = */ parameters,
413  },
414  /* .descriptor = */ type::DESCRIPTOR,
415  /* .functions = */ NO_FUNCTIONS,
416  /* .response = */ nullptr,
417  };
418 };
419 
420 template<>
421 struct MetadataFor<data_sensor::CompOrientationUpdateMatrix>
422 {
424 
425  static constexpr inline ParameterInfo parameters[] = {
426  {
427  /* .name = */ "m",
428  /* .docs = */ "",
429  /* .type = */ {Type::STRUCT, &MetadataFor<Matrix3f>::value},
430  /* .accessor = */ nullptr, //utils::access<type, Matrix3f, &type::m>,
431  /* .attributes = */ {true, false, false, false, false},
432  /* .count = */ 1,
433  /* .condition = */ {},
434  },
435  };
436 
437  static constexpr inline FieldInfo value = {
438  {
439  /* .name = */ "data_sensor::CompOrientationUpdateMatrix",
440  /* .title = */ "Complementary Filter Orientation Update Matrix",
441  /* .docs = */ "DEPRECATED!",
442  /* .parameters = */ parameters,
443  },
444  /* .descriptor = */ type::DESCRIPTOR,
445  /* .functions = */ NO_FUNCTIONS,
446  /* .response = */ nullptr,
447  };
448 };
449 
450 template<>
451 struct MetadataFor<data_sensor::OrientationRawTemp>
452 {
454 
455  static constexpr inline ParameterInfo parameters[] = {
456  {
457  /* .name = */ "raw_temp",
458  /* .docs = */ "",
459  /* .type = */ {Type::U16, nullptr},
460  /* .accessor = */ nullptr, //utils::access<type, uint16_t, &type::raw_temp>,
461  /* .attributes = */ {true, false, false, false, false},
462  /* .count = */ 4,
463  /* .condition = */ {},
464  },
465  };
466 
467  static constexpr inline FieldInfo value = {
468  {
469  /* .name = */ "data_sensor::OrientationRawTemp",
470  /* .title = */ "orientation_raw_temp",
471  /* .docs = */ "DEPRECATED!",
472  /* .parameters = */ parameters,
473  },
474  /* .descriptor = */ type::DESCRIPTOR,
475  /* .functions = */ NO_FUNCTIONS,
476  /* .response = */ nullptr,
477  };
478 };
479 
480 template<>
481 struct MetadataFor<data_sensor::InternalTimestamp>
482 {
484 
485  static constexpr inline ParameterInfo parameters[] = {
486  {
487  /* .name = */ "counts",
488  /* .docs = */ "",
489  /* .type = */ {Type::U32, nullptr},
490  /* .accessor = */ nullptr, //utils::access<type, uint32_t, &type::counts>,
491  /* .attributes = */ {true, false, false, false, false},
492  /* .count = */ 1,
493  /* .condition = */ {},
494  },
495  };
496 
497  static constexpr inline FieldInfo value = {
498  {
499  /* .name = */ "data_sensor::InternalTimestamp",
500  /* .title = */ "internal_timestamp",
501  /* .docs = */ "DEPRECATED!",
502  /* .parameters = */ parameters,
503  },
504  /* .descriptor = */ type::DESCRIPTOR,
505  /* .functions = */ NO_FUNCTIONS,
506  /* .response = */ nullptr,
507  };
508 };
509 
510 template<>
511 struct MetadataFor<data_sensor::PpsTimestamp>
512 {
514 
515  static constexpr inline ParameterInfo parameters[] = {
516  {
517  /* .name = */ "seconds",
518  /* .docs = */ "",
519  /* .type = */ {Type::U32, nullptr},
520  /* .accessor = */ nullptr, //utils::access<type, uint32_t, &type::seconds>,
521  /* .attributes = */ {true, false, false, false, false},
522  /* .count = */ 1,
523  /* .condition = */ {},
524  },
525  {
526  /* .name = */ "useconds",
527  /* .docs = */ "",
528  /* .type = */ {Type::U32, nullptr},
529  /* .accessor = */ nullptr, //utils::access<type, uint32_t, &type::useconds>,
530  /* .attributes = */ {true, false, false, false, false},
531  /* .count = */ 1,
532  /* .condition = */ {},
533  },
534  };
535 
536  static constexpr inline FieldInfo value = {
537  {
538  /* .name = */ "data_sensor::PpsTimestamp",
539  /* .title = */ "PPS Timestamp",
540  /* .docs = */ "DEPRECATED!",
541  /* .parameters = */ parameters,
542  },
543  /* .descriptor = */ type::DESCRIPTOR,
544  /* .functions = */ NO_FUNCTIONS,
545  /* .response = */ nullptr,
546  };
547 };
548 
549 template<>
550 struct MetadataFor<data_sensor::GpsTimestamp::ValidFlags>
551 {
553 
554  static constexpr inline BitfieldInfo::Entry entries[] = {
555  { uint32_t(1), "pps_valid", "True when the PPS signal is present." },
556  { uint32_t(2), "time_refresh", "Toggles each time the time is updated via internal GPS or the GPS Time Update command (0x01, 0x72)." },
557  { uint32_t(4), "time_initialized", "True if the time has ever been set." },
558  { uint32_t(8), "tow_valid", "True if the time of week is valid." },
559  { uint32_t(16), "week_number_valid", "True if the week number is valid." },
560  };
561 
562  static constexpr inline BitfieldInfo value = {
563  /* .name = */ "ValidFlags",
564  /* .docs = */ "",
565  /* .type = */ Type::U16,
566  /* .entries = */ entries,
567  };
568 
569 };
570 
571 template<>
572 struct MetadataFor<data_sensor::GpsTimestamp>
573 {
575 
576  static constexpr inline ParameterInfo parameters[] = {
577  {
578  /* .name = */ "tow",
579  /* .docs = */ "GPS Time of Week [seconds]",
580  /* .type = */ {Type::DOUBLE, nullptr},
581  /* .accessor = */ nullptr, //utils::access<type, double, &type::tow>,
582  /* .attributes = */ {true, false, false, false, false},
583  /* .count = */ 1,
584  /* .condition = */ {},
585  },
586  {
587  /* .name = */ "week_number",
588  /* .docs = */ "GPS Week Number since 1980 [weeks]",
589  /* .type = */ {Type::U16, nullptr},
590  /* .accessor = */ nullptr, //utils::access<type, uint16_t, &type::week_number>,
591  /* .attributes = */ {true, false, false, false, false},
592  /* .count = */ 1,
593  /* .condition = */ {},
594  },
595  {
596  /* .name = */ "valid_flags",
597  /* .docs = */ "",
599  /* .accessor = */ nullptr, //utils::access<type, data_sensor::GpsTimestamp::ValidFlags, &type::valid_flags>,
600  /* .attributes = */ {true, false, false, false, false},
601  /* .count = */ 1,
602  /* .condition = */ {},
603  },
604  };
605 
606  static constexpr inline FieldInfo value = {
607  {
608  /* .name = */ "data_sensor::GpsTimestamp",
609  /* .title = */ "gps_timestamp",
610  /* .docs = */ "GPS timestamp of the SENSOR data\n\nShould the PPS become unavailable, the device will revert to its internal clock, which will cause the reported time to drift from true GPS time.\nUpon recovering from a PPS outage, the user should expect a jump in the reported GPS time due to the accumulation of internal clock error.\nIf synchronization to an external clock or onboard GNSS receiver (for products that have one) is disabled, this time is equivalent to internal system time.\n\nNote: this data field may be deprecated in the future. The more flexible shared data field (0x80, 0xD3) should be used instead.",
611  /* .parameters = */ parameters,
612  },
613  /* .descriptor = */ type::DESCRIPTOR,
614  /* .functions = */ NO_FUNCTIONS,
615  /* .response = */ nullptr,
616  };
617 };
618 
619 template<>
620 struct MetadataFor<data_sensor::TemperatureAbs>
621 {
623 
624  static constexpr inline ParameterInfo parameters[] = {
625  {
626  /* .name = */ "min_temp",
627  /* .docs = */ "[degC]",
628  /* .type = */ {Type::FLOAT, nullptr},
629  /* .accessor = */ nullptr, //utils::access<type, float, &type::min_temp>,
630  /* .attributes = */ {true, false, false, false, false},
631  /* .count = */ 1,
632  /* .condition = */ {},
633  },
634  {
635  /* .name = */ "max_temp",
636  /* .docs = */ "[degC]",
637  /* .type = */ {Type::FLOAT, nullptr},
638  /* .accessor = */ nullptr, //utils::access<type, float, &type::max_temp>,
639  /* .attributes = */ {true, false, false, false, false},
640  /* .count = */ 1,
641  /* .condition = */ {},
642  },
643  {
644  /* .name = */ "mean_temp",
645  /* .docs = */ "[degC]",
646  /* .type = */ {Type::FLOAT, nullptr},
647  /* .accessor = */ nullptr, //utils::access<type, float, &type::mean_temp>,
648  /* .attributes = */ {true, false, false, false, false},
649  /* .count = */ 1,
650  /* .condition = */ {},
651  },
652  };
653 
654  static constexpr inline FieldInfo value = {
655  {
656  /* .name = */ "data_sensor::TemperatureAbs",
657  /* .title = */ "Temperature Statistics",
658  /* .docs = */ "SENSOR reported temperature statistics\n\nTemperature may originate from the MEMS sensors, or be calculated in combination with board temperature sensors.\nAll quantities are calculated with respect to the last power on or reset, whichever is later.\n",
659  /* .parameters = */ parameters,
660  },
661  /* .descriptor = */ type::DESCRIPTOR,
662  /* .functions = */ NO_FUNCTIONS,
663  /* .response = */ nullptr,
664  };
665 };
666 
667 template<>
668 struct MetadataFor<data_sensor::UpVector>
669 {
671 
672  static constexpr inline ParameterInfo parameters[] = {
673  {
674  /* .name = */ "up",
675  /* .docs = */ "[Gs]",
676  /* .type = */ {Type::STRUCT, &MetadataFor<Vector3f>::value},
677  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::up>,
678  /* .attributes = */ {true, false, false, false, false},
679  /* .count = */ 1,
680  /* .condition = */ {},
681  },
682  };
683 
684  static constexpr inline FieldInfo value = {
685  {
686  /* .name = */ "data_sensor::UpVector",
687  /* .title = */ "up_vector",
688  /* .docs = */ "Gyro-stabilized 3-element vector representing the complementary filter's estimated vertical direction.\nThis quantity is expressed in the vehicle frame.\n\nThis quantity is sensitive to non-gravitational accelerations, which may cause notable deviations from the true vertical direction.\n\nFor legacy reasons, this vector is the inverse of the gravity vector.\n",
689  /* .parameters = */ parameters,
690  },
691  /* .descriptor = */ type::DESCRIPTOR,
692  /* .functions = */ NO_FUNCTIONS,
693  /* .response = */ nullptr,
694  };
695 };
696 
697 template<>
698 struct MetadataFor<data_sensor::NorthVector>
699 {
701 
702  static constexpr inline ParameterInfo parameters[] = {
703  {
704  /* .name = */ "north",
705  /* .docs = */ "[Gauss]",
706  /* .type = */ {Type::STRUCT, &MetadataFor<Vector3f>::value},
707  /* .accessor = */ nullptr, //utils::access<type, Vector3f, &type::north>,
708  /* .attributes = */ {true, false, false, false, false},
709  /* .count = */ 1,
710  /* .condition = */ {},
711  },
712  };
713 
714  static constexpr inline FieldInfo value = {
715  {
716  /* .name = */ "data_sensor::NorthVector",
717  /* .title = */ "north_vector",
718  /* .docs = */ "Gyro-stabilized 3-element vector representing the complementary filter's estimate of magnetic north.\nThis quantity is expressed in the vehicle frame.\n\nThis quantity is sensitive to local magnetic field perturbations, which may cause notable deviations from true magnetic north.",
719  /* .parameters = */ parameters,
720  },
721  /* .descriptor = */ type::DESCRIPTOR,
722  /* .functions = */ NO_FUNCTIONS,
723  /* .response = */ nullptr,
724  };
725 };
726 
727 template<>
728 struct MetadataFor<data_sensor::OverrangeStatus::Status>
729 {
731 
732  static constexpr inline BitfieldInfo::Entry entries[] = {
733  { uint32_t(1), "accel_x", "" },
734  { uint32_t(2), "accel_y", "" },
735  { uint32_t(4), "accel_z", "" },
736  { uint32_t(16), "gyro_x", "" },
737  { uint32_t(32), "gyro_y", "" },
738  { uint32_t(64), "gyro_z", "" },
739  { uint32_t(256), "mag_x", "" },
740  { uint32_t(512), "mag_y", "" },
741  { uint32_t(1024), "mag_z", "" },
742  { uint32_t(4096), "press", "" },
743  };
744 
745  static constexpr inline BitfieldInfo value = {
746  /* .name = */ "Status",
747  /* .docs = */ "",
748  /* .type = */ Type::U16,
749  /* .entries = */ entries,
750  };
751 
752 };
753 
754 template<>
755 struct MetadataFor<data_sensor::OverrangeStatus>
756 {
758 
759  static constexpr inline ParameterInfo parameters[] = {
760  {
761  /* .name = */ "status",
762  /* .docs = */ "",
764  /* .accessor = */ nullptr, //utils::access<type, data_sensor::OverrangeStatus::Status, &type::status>,
765  /* .attributes = */ {true, false, false, false, false},
766  /* .count = */ 1,
767  /* .condition = */ {},
768  },
769  };
770 
771  static constexpr inline FieldInfo value = {
772  {
773  /* .name = */ "data_sensor::OverrangeStatus",
774  /* .title = */ "overrange_status",
775  /* .docs = */ "",
776  /* .parameters = */ parameters,
777  },
778  /* .descriptor = */ type::DESCRIPTOR,
779  /* .functions = */ NO_FUNCTIONS,
780  /* .response = */ nullptr,
781  };
782 };
783 
784 template<>
785 struct MetadataFor<data_sensor::OdometerData>
786 {
788 
789  static constexpr inline ParameterInfo parameters[] = {
790  {
791  /* .name = */ "speed",
792  /* .docs = */ "Average speed over the time interval [m/s]. Can be negative for quadrature encoders.",
793  /* .type = */ {Type::FLOAT, nullptr},
794  /* .accessor = */ nullptr, //utils::access<type, float, &type::speed>,
795  /* .attributes = */ {true, false, false, false, false},
796  /* .count = */ 1,
797  /* .condition = */ {},
798  },
799  {
800  /* .name = */ "uncertainty",
801  /* .docs = */ "Uncertainty of velocity [m/s].",
802  /* .type = */ {Type::FLOAT, nullptr},
803  /* .accessor = */ nullptr, //utils::access<type, float, &type::uncertainty>,
804  /* .attributes = */ {true, false, false, false, false},
805  /* .count = */ 1,
806  /* .condition = */ {},
807  },
808  {
809  /* .name = */ "valid_flags",
810  /* .docs = */ "If odometer is configured, bit 0 will be set to 1.",
811  /* .type = */ {Type::U16, nullptr},
812  /* .accessor = */ nullptr, //utils::access<type, uint16_t, &type::valid_flags>,
813  /* .attributes = */ {true, false, false, false, false},
814  /* .count = */ 1,
815  /* .condition = */ {},
816  },
817  };
818 
819  static constexpr inline FieldInfo value = {
820  {
821  /* .name = */ "data_sensor::OdometerData",
822  /* .title = */ "odometer_data",
823  /* .docs = */ "",
824  /* .parameters = */ parameters,
825  },
826  /* .descriptor = */ type::DESCRIPTOR,
827  /* .functions = */ NO_FUNCTIONS,
828  /* .response = */ nullptr,
829  };
830 };
831 
832 
833 static constexpr inline const FieldInfo* DATA_SENSOR_FIELDS[] = {
857 };
858 
859 static constexpr DescriptorSetInfo DATA_SENSOR = {
860  /* .descriptor = */ mip::data_sensor::DESCRIPTOR_SET,
861  /* .name = */ "Sensor Data",
862  /* .fields = */ DATA_SENSOR_FIELDS,
863 };
864 
865 } // namespace mip::metadata
866 
mip::metadata::MetadataFor< data_sensor::RawGyro >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:59
mip::data_sensor::OrientationRawTemp
Definition: data_sensor.hpp:625
mip::data_sensor::OdometerData
Definition: data_sensor.hpp:1030
common.hpp
mip::metadata::BitfieldInfo
Definition: mip_structures.hpp:89
mip::metadata
Definition: common.hpp:8
mip::metadata::MetadataFor< data_sensor::ScaledAccel >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:149
mip::data_sensor::RawGyro
Definition: data_sensor.hpp:116
mip::metadata::MetadataFor< data_sensor::ScaledGyro >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:179
mip::metadata::MetadataFor< data_sensor::RawPressure >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:119
mip::data_sensor::ScaledAccel
Definition: data_sensor.hpp:230
mip::metadata::MetadataFor< data_sensor::CompQuaternion >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:359
mip::data_sensor::CompEulerAngles
Definition: data_sensor.hpp:549
mip::metadata::MetadataFor< data_sensor::TemperatureAbs >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:654
mip::data_sensor::ScaledGyro
Definition: data_sensor.hpp:268
mip::metadata::Type::U16
@ U16
mip::metadata::MetadataFor
Definition: mip_metadata.hpp:13
mip::data_sensor::InternalTimestamp
Definition: data_sensor.hpp:662
mip::metadata::MetadataFor< data_sensor::ScaledMag >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:209
mip::metadata::Type::STRUCT
@ STRUCT
mip::data_sensor::RawAccel
Definition: data_sensor.hpp:78
mip::metadata::MetadataFor< data_sensor::NorthVector >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:714
mip::data_sensor::OverrangeStatus::Status
Definition: data_sensor.hpp:945
mip::metadata::MetadataFor< data_sensor::CompEulerAngles >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:407
mip::data_sensor::PpsTimestamp
Definition: data_sensor.hpp:699
mip::data_sensor::ScaledPressure
Definition: data_sensor.hpp:343
mip::metadata::Type::DOUBLE
@ DOUBLE
mip::metadata::ParameterInfo
Definition: mip_structures.hpp:158
mip::metadata::EnumInfo::Entry
Definition: mip_structures.hpp:65
mip::data_sensor::OverrangeStatus
Definition: data_sensor.hpp:943
mip::data_sensor::GpsTimestamp::ValidFlags
Definition: data_sensor.hpp:745
mip_metadata.hpp
mip::data_sensor::CompOrientationMatrix
Definition: data_sensor.hpp:466
mip::data_sensor::RawMag
Definition: data_sensor.hpp:154
mip::data_sensor::DESCRIPTOR_SET
@ DESCRIPTOR_SET
Definition: data_sensor.hpp:31
mip::data_sensor::ScaledMag
Definition: data_sensor.hpp:306
mip::metadata::MetadataFor< data_sensor::InternalTimestamp >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:497
mip::metadata::Type::FLOAT
@ FLOAT
mip::data_sensor::UpVector
Definition: data_sensor.hpp:867
mip::metadata::MetadataFor< data_sensor::CompOrientationUpdateMatrix >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:437
mip::metadata::MetadataFor< data_sensor::RawMag >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:89
mip::data_sensor::CompOrientationUpdateMatrix
Definition: data_sensor.hpp:588
mip::data_sensor::RawPressure
Definition: data_sensor.hpp:192
mip::data_sensor::DeltaVelocity
Definition: data_sensor.hpp:419
mip::data_sensor::TemperatureAbs
Definition: data_sensor.hpp:822
mip::metadata::MetadataFor< data_sensor::OdometerData >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:819
mip::data_sensor::NorthVector
Definition: data_sensor.hpp:907
mip::metadata::MetadataFor< data_sensor::GpsTimestamp >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:606
mip::data_sensor::DeltaTheta
Definition: data_sensor.hpp:381
mip::metadata::FieldInfo
Definition: mip_structures.hpp:212
mip::metadata::MetadataFor< data_sensor::PpsTimestamp >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:536
mip::metadata::MetadataFor< data_sensor::DeltaTheta >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:269
mip::metadata::MetadataFor< data_sensor::CompOrientationMatrix >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:329
mip::metadata::MetadataFor< data_sensor::OverrangeStatus >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:771
mip::metadata::MetadataFor< data_sensor::RawAccel >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:29
mip::metadata::MetadataFor< data_sensor::DeltaVelocity >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:299
mip::data_sensor::GpsTimestamp
Definition: data_sensor.hpp:743
mip::metadata::Type::BITS
@ BITS
mip::metadata::MetadataFor< data_sensor::UpVector >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:684
data_sensor.hpp
mip::metadata::MetadataFor< data_sensor::ScaledPressure >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:239
mip::metadata::MetadataFor< data_sensor::OrientationRawTemp >::value
static constexpr FieldInfo value
Definition: data_sensor.hpp:467
mip::metadata::Type::U32
@ U32
mip::data_sensor::CompQuaternion
Definition: data_sensor.hpp:511