Ocean
Loading...
Searching...
No Matches
DeviceSerializer.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_DEVICES_SERIALIZATION_DEVICE_SERIALIZER_H
9#define META_OCEAN_DEVICES_SERIALIZATION_DEVICE_SERIALIZER_H
10
12
20
21#include "ocean/io/Bitstream.h"
22
24
25namespace Ocean
26{
27
28namespace Devices
29{
30
31namespace Serialization
32{
33
34/**
35 * This class provides serialization capabilities for devices.
36 * The class contains data sample types for various device types including orientation trackers, acceleration sensors, gyro sensors, gravity trackers, position trackers, 6DOF trackers, and GPS trackers.
37 * @ingroup devicesserialization
38 */
39class OCEAN_DEVICES_EXPORT DeviceSerializer
40{
41 protected:
42
43 /// The maximal number of measurements that can be stored in a sample.
44 static constexpr size_t maximalMeasurements_ = 1000 * 1000;
45
46 /**
47 * This class is the base class for all sample measurements.
48 */
50 {
51 protected:
52
53 /**
54 * Reads measurement data from an input bitstream.
55 * @param inputBitstream The input bitstream from which the measurement will be read
56 * @return True, if succeeded
57 */
58 bool readMeasurement(IO::InputBitstream& inputBitstream);
59
60 /**
61 * Writes measurement data to an output bitstream.
62 * @param outputBitstream The output bitstream to which the measurement will be written
63 * @return True, if succeeded
64 */
65 bool writeMeasurement(IO::OutputBitstream& outputBitstream) const;
66
67 protected:
68
69 /// The object ids of the measurement units, each id corresponds to a different measurement.
71 };
72
73 /**
74 * This class is the base class for all sample tracker measurements.
75 */
77 {
78 protected:
79
80 /**
81 * Reads tracker data from an input bitstream.
82 * @param inputBitstream The input bitstream from which the tracker data will be read
83 * @return True, if succeeded
84 */
85 bool readTracker(IO::InputBitstream& inputBitstream);
86
87 /**
88 * Writes tracker data to an output bitstream.
89 * @param outputBitstream The output bitstream to which the tracker data will be written
90 * @return True, if succeeded
91 */
92 bool writeTracker(IO::OutputBitstream& outputBitstream) const;
93
94 protected:
95
96 /// The reference system used by the tracker, -1 if not defined.
97 int8_t referenceSystem_ = -1;
98 };
99
100 public:
101
102 /**
103 * This class implements a data sample for 3DOF orientation tracker measurements.
104 */
107 public SampleTracker
108 {
109 public:
110
111 /**
112 * Creates a new 3DOF orientation tracker data sample.
113 */
115
116 /**
117 * Creates a new 3DOF orientation tracker data sample from a tracker sample.
118 * @param sample The orientation tracker 3DOF sample to serialize
119 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
120 */
122
123 /**
124 * Reads the sample from an input bitstream.
125 * @param inputBitstream The input bitstream from which the sample will be read
126 * @return True, if succeeded
127 * @see writeSample().
128 */
129 bool readSample(IO::InputBitstream& inputBitstream) override;
130
131 /**
132 * Writes the sample to an output bitstream.
133 * @param outputBitstream The output bitstream to which the sample will be written
134 * @return True, if succeeded
135 * @see readSample().
136 */
137 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
138
139 /**
140 * Returns the type of the sample.
141 * @return The sample type
142 * @see sampleType().
143 */
144 inline const std::string& type() const override;
145
146 /**
147 * Returns the orientation measurements.
148 * @return The orientation measurements as quaternions
149 */
150 inline const QuaternionsF& orientations() const;
151
152 /**
153 * Returns the object ids.
154 * @return The object ids, each id corresponds to a different orientation measurement
155 */
156 inline const Indices32& objectIds() const;
157
158 /**
159 * Returns the reference system.
160 * @return The reference system used by the tracker, -1 if not defined
161 */
162 inline int8_t referenceSystem() const;
163
164 /**
165 * Returns the static sample type.
166 * @return The sample type
167 */
168 static inline const std::string& sampleType();
169
170 protected:
171
172 /// The orientation measurements as quaternions.
174 };
175
176 /**
177 * This class implements a data sample for 3DOF acceleration sensor measurements.
178 */
181 public SampleMeasurement
182 {
183 public:
184
185 /**
186 * Creates a new 3DOF acceleration sensor data sample.
187 */
189
190 /**
191 * Creates a new 3DOF acceleration sensor data sample from a sensor sample.
192 * @param sample The acceleration sensor 3DOF sample to serialize
193 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
194 */
196
197 /**
198 * Reads the sample from an input bitstream.
199 * @param inputBitstream The input bitstream from which the sample will be read
200 * @return True, if succeeded
201 * @see writeSample().
202 */
203 bool readSample(IO::InputBitstream& inputBitstream) override;
204
205 /**
206 * Writes the sample to an output bitstream.
207 * @param outputBitstream The output bitstream to which the sample will be written
208 * @return True, if succeeded
209 * @see readSample().
210 */
211 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
212
213 /**
214 * Returns the type of the sample.
215 * @return The sample type
216 * @see sampleType().
217 */
218 inline const std::string& type() const override;
219
220 /**
221 * Returns the acceleration measurements.
222 * @return The acceleration measurements, each in [m / s^2]
223 */
224 inline const VectorsF3& measurements() const;
225
226 /**
227 * Returns the object ids.
228 * @return The object ids, each id corresponds to a different acceleration measurement
229 */
230 inline const Indices32& objectIds() const;
231
232 /**
233 * Returns the static sample type.
234 * @return The sample type
235 */
236 static inline const std::string& sampleType();
237
238 protected:
239
240 /// The acceleration measurements, each in [m / s^2].
242 };
243
244 /**
245 * This class implements a data sample for 3DOF gyro sensor measurements.
246 */
249 public SampleMeasurement
250 {
251 public:
252
253 /**
254 * Creates a new 3DOF gyro sensor data sample.
255 */
257
258 /**
259 * Creates a new 3DOF gyro sensor data sample from a sensor sample.
260 * @param sample The gyro sensor 3DOF sample to serialize
261 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
262 */
263 DataSampleGyroSensor3DOF(const GyroSensor3DOF::Gyro3DOFSample& sample, const Timestamp sampleCreationTimestamp = Timestamp(true));
264
265 /**
266 * Reads the sample from an input bitstream.
267 * @param inputBitstream The input bitstream from which the sample will be read
268 * @return True, if succeeded
269 * @see writeSample().
270 */
271 bool readSample(IO::InputBitstream& inputBitstream) override;
272
273 /**
274 * Writes the sample to an output bitstream.
275 * @param outputBitstream The output bitstream to which the sample will be written
276 * @return True, if succeeded
277 * @see readSample().
278 */
279 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
280
281 /**
282 * Returns the type of the sample.
283 * @return The sample type
284 * @see sampleType().
285 */
286 inline const std::string& type() const override;
287
288 /**
289 * Returns the gyro measurements.
290 * @return The gyro measurements
291 */
292 inline const VectorsF3& measurements() const;
293
294 /**
295 * Returns the object ids.
296 * @return The object ids, each id corresponds to a different gyro measurement
297 */
298 inline const Indices32& objectIds() const;
299
300 /**
301 * Returns the static sample type.
302 * @return The sample type
303 */
304 static inline const std::string& sampleType();
305
306 protected:
307
308 /// The gyro measurements.
310 };
311
312 /**
313 * This class implements a data sample for 3DOF gravity tracker measurements.
314 */
317 public SampleTracker
318 {
319 public:
320
321 /**
322 * Creates a new 3DOF gravity tracker data sample.
323 */
325
326 /**
327 * Creates a new 3DOF gravity tracker data sample from a tracker sample.
328 * @param sample The gravity tracker 3DOF sample to serialize
329 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
330 */
332
333 /**
334 * Reads the sample from an input bitstream.
335 * @param inputBitstream The input bitstream from which the sample will be read
336 * @return True, if succeeded
337 * @see writeSample().
338 */
339 bool readSample(IO::InputBitstream& inputBitstream) override;
340
341 /**
342 * Writes the sample to an output bitstream.
343 * @param outputBitstream The output bitstream to which the sample will be written
344 * @return True, if succeeded
345 * @see readSample().
346 */
347 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
348
349 /**
350 * Returns the type of the sample.
351 * @return The sample type
352 * @see sampleType().
353 */
354 inline const std::string& type() const override;
355
356 /**
357 * Returns the gravity measurements.
358 * @return The gravity measurements
359 */
360 inline const VectorsF3& gravities() const;
361
362 /**
363 * Returns the object ids.
364 * @return The object ids, each id corresponds to a different gravity measurement
365 */
366 inline const Indices32& objectIds() const;
367
368 /**
369 * Returns the reference system.
370 * @return The reference system used by the tracker, -1 if not defined
371 */
372 inline int8_t referenceSystem() const;
373
374 /**
375 * Returns the static sample type.
376 * @return The sample type
377 */
378 static inline const std::string& sampleType();
379
380 protected:
381
382 /// The gravity measurements.
384 };
385
386 /**
387 * This class implements a data sample for 3DOF position tracker measurements.
388 */
391 public SampleTracker
392 {
393 public:
394
395 /**
396 * Creates a new 3DOF position tracker data sample.
397 */
399
400 /**
401 * Creates a new 3DOF position tracker data sample from a tracker sample.
402 * @param sample The position tracker 3DOF sample to serialize
403 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
404 */
406
407 /**
408 * Reads the sample from an input bitstream.
409 * @param inputBitstream The input bitstream from which the sample will be read
410 * @return True, if succeeded
411 * @see writeSample().
412 */
413 bool readSample(IO::InputBitstream& inputBitstream) override;
414
415 /**
416 * Writes the sample to an output bitstream.
417 * @param outputBitstream The output bitstream to which the sample will be written
418 * @return True, if succeeded
419 * @see readSample().
420 */
421 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
422
423 /**
424 * Returns the type of the sample.
425 * @return The sample type
426 * @see sampleType().
427 */
428 inline const std::string& type() const override;
429
430 /**
431 * Returns the position measurements.
432 * @return The position measurements in meter
433 */
434 inline const VectorsF3& positions() const;
435
436 /**
437 * Returns the object ids.
438 * @return The object ids, each id corresponds to a different position measurement
439 */
440 inline const Indices32& objectIds() const;
441
442 /**
443 * Returns the reference system.
444 * @return The reference system used by the tracker, -1 if not defined
445 */
446 inline int8_t referenceSystem() const;
447
448 /**
449 * Returns the static sample type.
450 * @return The sample type
451 */
452 static inline const std::string& sampleType();
453
454 protected:
455
456 /// The position measurements in meter.
458 };
459
460 /**
461 * This class implements a data sample for 6DOF tracker measurements.
462 */
465 public SampleTracker
466 {
467 public:
468
469 /**
470 * Creates a new 6DOF tracker data sample.
471 */
473
474 /**
475 * Creates a new 6DOF tracker data sample from a tracker sample.
476 * @param sample The tracker 6DOF sample to serialize
477 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
478 */
479 DataSampleTracker6DOF(const Tracker6DOF::Tracker6DOFSample& sample, const Timestamp sampleCreationTimestamp = Timestamp(true));
480
481 /**
482 * Reads the sample from an input bitstream.
483 * @param inputBitstream The input bitstream from which the sample will be read
484 * @return True, if succeeded
485 * @see writeSample().
486 */
487 bool readSample(IO::InputBitstream& inputBitstream) override;
488
489 /**
490 * Writes the sample to an output bitstream.
491 * @param outputBitstream The output bitstream to which the sample will be written
492 * @return True, if succeeded
493 * @see readSample().
494 */
495 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
496
497 /**
498 * Returns the type of the sample.
499 * @return The sample type
500 * @see sampleType().
501 */
502 inline const std::string& type() const override;
503
504 /**
505 * Returns the orientation measurements.
506 * @return The orientation measurements as quaternions
507 */
508 inline const QuaternionsF& orientations() const;
509
510 /**
511 * Returns the position measurements.
512 * @return The position measurements in meter
513 */
514 inline const VectorsF3& positions() const;
515
516 /**
517 * Returns the object ids.
518 * @return The object ids, each id corresponds to a different 6DOF measurement
519 */
520 inline const Indices32& objectIds() const;
521
522 /**
523 * Returns the reference system.
524 * @return The reference system used by the tracker, -1 if not defined
525 */
526 inline int8_t referenceSystem() const;
527
528 /**
529 * Returns the static sample type.
530 * @return The sample type
531 */
532 static inline const std::string& sampleType();
533
534 protected:
535
536 /// The orientation measurements as quaternions.
538
539 /// The position measurements in meter.
541 };
542
543 /**
544 * This class implements a data sample for GPS tracker measurements.
545 */
548 public SampleTracker
549 {
550 public:
551
552 /**
553 * This class implements a GPS location.
554 */
556 {
557 public:
558
559 /**
560 * Creates a new GPS location with default values.
561 */
562 Location() = default;
563
564 /**
565 * Creates a new GPS location from a GPS tracker location.
566 * @param location The GPS tracker location
567 */
569
570 /**
571 * Reads a GPS location from an input bitstream.
572 * @param inputBitstream The input bitstream from which the location will be read
573 * @return True, if succeeded
574 */
575 bool read(IO::InputBitstream& inputBitstream);
576
577 /**
578 * Writes a GPS location to an output bitstream.
579 * @param outputBitstream The output bitstream to which the location will be written
580 * @return True, if succeeded
581 */
582 bool write(IO::OutputBitstream& outputBitstream) const;
583
584 public:
585
586 /// The latitude in degrees, range [-90, 90], NumericD::minValue() if unknown.
587 double latitude_ = NumericD::minValue();
588
589 /// The longitude in degrees, range [-180, 180], NumericD::minValue() if unknown.
590 double longitude_ = NumericD::minValue();
591
592 /// The altitude in meters, NumericF::minValue() if unknown.
593 float altitude_ = NumericF::minValue();
594
595 /// The direction (heading) in degrees, range [0, 360), -1 if unknown.
596 float direction_ = -1.0f;
597
598 /// The speed in meters per second, -1 if unknown.
599 float speed_ = -1.0f;
600
601 /// The horizontal accuracy in meters, -1 if unknown.
602 float accuracy_ = -1.0f;
603
604 /// The altitude accuracy in meters, -1 if unknown.
605 float altitudeAccuracy_ = -1.0f;
606
607 /// The direction accuracy in degrees, -1 if unknown.
608 float directionAccuracy_ = -1.0f;
609
610 /// The speed accuracy in meters per second, -1 if unknown.
611 float speedAccuracy_ = -1.0f;
612 };
613
614 /**
615 * Definition of a vector holding GPS locations.
616 */
617 using Locations = std::vector<Location>;
618
619 public:
620
621 /**
622 * Creates a new GPS tracker data sample.
623 */
625
626 /**
627 * Creates a new GPS tracker data sample from a tracker sample.
628 * @param sample The GPS tracker sample to serialize
629 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
630 */
631 DataSampleGPSTracker(const GPSTracker::GPSTrackerSample& sample, const Timestamp sampleCreationTimestamp = Timestamp(true));
632
633 /**
634 * Reads the sample from an input bitstream.
635 * @param inputBitstream The input bitstream from which the sample will be read
636 * @return True, if succeeded
637 * @see writeSample().
638 */
639 bool readSample(IO::InputBitstream& inputBitstream) override;
640
641 /**
642 * Writes the sample to an output bitstream.
643 * @param outputBitstream The output bitstream to which the sample will be written
644 * @return True, if succeeded
645 * @see readSample().
646 */
647 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
648
649 /**
650 * Returns the type of the sample.
651 * @return The sample type
652 * @see sampleType().
653 */
654 inline const std::string& type() const override;
655
656 /**
657 * Returns the GPS locations.
658 * @return The GPS locations
659 */
660 inline const Locations& locations() const;
661
662 /**
663 * Returns the object ids.
664 * @return The object ids, each id corresponds to a different GPS location
665 */
666 inline const Indices32& objectIds() const;
667
668 /**
669 * Returns the reference system.
670 * @return The reference system used by the tracker, -1 if not defined
671 */
672 inline int8_t referenceSystem() const;
673
674 /**
675 * Returns the static sample type.
676 * @return The sample type
677 */
678 static inline const std::string& sampleType();
679
680 protected:
681
682 /// The GPS locations.
684 };
685};
686
688{
689 return sampleType();
690}
691
693{
694 return orientations_;
695}
696
698{
699 return objectIds_;
700}
701
703{
704 return referenceSystem_;
705}
706
708{
709 static const std::string typeName = "ocean/devices/datasampleorientationtracker3dof";
710 return typeName;
711}
712
714{
715 return sampleType();
716}
717
719{
720 return measurements_;
721}
722
724{
725 return objectIds_;
726}
727
729{
730 static const std::string typeName = "ocean/devices/datasampleaccelerationsensor3dof";
731 return typeName;
732}
733
735{
736 return sampleType();
737}
738
740{
741 return measurements_;
742}
743
745{
746 return objectIds_;
747}
748
750{
751 static const std::string typeName = "ocean/devices/datasamplegyrosensor3dof";
752 return typeName;
753}
754
756{
757 return sampleType();
758}
759
761{
762 return gravities_;
763}
764
766{
767 return objectIds_;
768}
769
771{
772 return referenceSystem_;
773}
774
776{
777 static const std::string typeName = "ocean/devices/datasamplegravitytracker3dof";
778 return typeName;
779}
780
782{
783 return sampleType();
784}
785
787{
788 return positions_;
789}
790
792{
793 return objectIds_;
794}
795
797{
798 return referenceSystem_;
799}
800
802{
803 static const std::string typeName = "ocean/devices/datasamplepositiontracker3dof";
804 return typeName;
805}
806
807inline const std::string& DeviceSerializer::DataSampleTracker6DOF::type() const
808{
809 return sampleType();
810}
811
813{
814 return orientations_;
815}
816
818{
819 return positions_;
820}
821
823{
824 return objectIds_;
825}
826
828{
829 return referenceSystem_;
830}
831
833{
834 static const std::string typeName = "ocean/devices/datasampletracker6dof";
835 return typeName;
836}
837
838inline const std::string& DeviceSerializer::DataSampleGPSTracker::type() const
839{
840 return sampleType();
841}
842
847
849{
850 return objectIds_;
851}
852
854{
855 return referenceSystem_;
856}
857
859{
860 static const std::string typeName = "ocean/devices/datasamplegpstracker";
861 return typeName;
862}
863
864
865
866}
867
868}
869
870}
871
872#endif // META_OCEAN_DEVICES_SERIALIZATION_DEVICE_SERIALIZER_H
Definition of a sample holding acceleration sensor 3DOF measurements.
Definition AccelerationSensor3DOF.h:49
Definition of a sample holding GPS measurements.
Definition GPSTracker.h:167
This class implements a container for a GPS location.
Definition GPSTracker.h:46
Definition of a sample holding 3DOF gravity measurements.
Definition GravityTracker3DOF.h:48
Definition of a sample holding gyro sensor 3DOF measurements.
Definition GyroSensor3DOF.h:49
Definition of a sample holding 3DOF orientation measurements.
Definition OrientationTracker3DOF.h:46
Definition of a sample holding 3DOF position measurements.
Definition PositionTracker3DOF.h:46
This class implements a data sample for 3DOF acceleration sensor measurements.
Definition DeviceSerializer.h:182
VectorsF3 measurements_
The acceleration measurements, each in [m / s^2].
Definition DeviceSerializer.h:241
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:723
DataSampleAccelerationSensor3DOF(const AccelerationSensor3DOF::Acceleration3DOFSample &sample, const Timestamp sampleCreationTimestamp=Timestamp(true))
Creates a new 3DOF acceleration sensor data sample from a sensor sample.
DataSampleAccelerationSensor3DOF()=default
Creates a new 3DOF acceleration sensor data sample.
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
const VectorsF3 & measurements() const
Returns the acceleration measurements.
Definition DeviceSerializer.h:718
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:713
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:728
This class implements a GPS location.
Definition DeviceSerializer.h:556
bool write(IO::OutputBitstream &outputBitstream) const
Writes a GPS location to an output bitstream.
Location(const GPSTracker::Location &location)
Creates a new GPS location from a GPS tracker location.
Location()=default
Creates a new GPS location with default values.
bool read(IO::InputBitstream &inputBitstream)
Reads a GPS location from an input bitstream.
This class implements a data sample for GPS tracker measurements.
Definition DeviceSerializer.h:549
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
std::vector< Location > Locations
Definition of a vector holding GPS locations.
Definition DeviceSerializer.h:617
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:858
Locations locations_
The GPS locations.
Definition DeviceSerializer.h:683
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:838
const Locations & locations() const
Returns the GPS locations.
Definition DeviceSerializer.h:843
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:853
DataSampleGPSTracker()=default
Creates a new GPS tracker data sample.
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:848
DataSampleGPSTracker(const GPSTracker::GPSTrackerSample &sample, const Timestamp sampleCreationTimestamp=Timestamp(true))
Creates a new GPS tracker data sample from a tracker sample.
This class implements a data sample for 3DOF gravity tracker measurements.
Definition DeviceSerializer.h:318
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:755
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:775
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:770
VectorsF3 gravities_
The gravity measurements.
Definition DeviceSerializer.h:383
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:765
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
const VectorsF3 & gravities() const
Returns the gravity measurements.
Definition DeviceSerializer.h:760
DataSampleGravityTracker3DOF()=default
Creates a new 3DOF gravity tracker data sample.
DataSampleGravityTracker3DOF(const GravityTracker3DOF::GravityTracker3DOFSample &sample, const Timestamp sampleCreationTimestamp=Timestamp(true))
Creates a new 3DOF gravity tracker data sample from a tracker sample.
This class implements a data sample for 3DOF gyro sensor measurements.
Definition DeviceSerializer.h:250
DataSampleGyroSensor3DOF(const GyroSensor3DOF::Gyro3DOFSample &sample, const Timestamp sampleCreationTimestamp=Timestamp(true))
Creates a new 3DOF gyro sensor data sample from a sensor sample.
const VectorsF3 & measurements() const
Returns the gyro measurements.
Definition DeviceSerializer.h:739
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:744
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:734
VectorsF3 measurements_
The gyro measurements.
Definition DeviceSerializer.h:309
DataSampleGyroSensor3DOF()=default
Creates a new 3DOF gyro sensor data sample.
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:749
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
This class implements a data sample for 3DOF orientation tracker measurements.
Definition DeviceSerializer.h:108
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:707
DataSampleOrientationTracker3DOF(const OrientationTracker3DOF::OrientationTracker3DOFSample &sample, const Timestamp sampleCreationTimestamp=Timestamp(true))
Creates a new 3DOF orientation tracker data sample from a tracker sample.
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:697
QuaternionsF orientations_
The orientation measurements as quaternions.
Definition DeviceSerializer.h:173
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
DataSampleOrientationTracker3DOF()=default
Creates a new 3DOF orientation tracker data sample.
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:687
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:702
const QuaternionsF & orientations() const
Returns the orientation measurements.
Definition DeviceSerializer.h:692
This class implements a data sample for 3DOF position tracker measurements.
Definition DeviceSerializer.h:392
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:796
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:801
DataSamplePositionTracker3DOF()=default
Creates a new 3DOF position tracker data sample.
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:791
VectorsF3 positions_
The position measurements in meter.
Definition DeviceSerializer.h:457
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:781
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
DataSamplePositionTracker3DOF(const PositionTracker3DOF::PositionTracker3DOFSample &sample, const Timestamp sampleCreationTimestamp=Timestamp(true))
Creates a new 3DOF position tracker data sample from a tracker sample.
const VectorsF3 & positions() const
Returns the position measurements.
Definition DeviceSerializer.h:786
This class implements a data sample for 6DOF tracker measurements.
Definition DeviceSerializer.h:466
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:827
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:807
VectorsF3 positions_
The position measurements in meter.
Definition DeviceSerializer.h:540
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:822
DataSampleTracker6DOF()=default
Creates a new 6DOF tracker data sample.
const QuaternionsF & orientations() const
Returns the orientation measurements.
Definition DeviceSerializer.h:812
DataSampleTracker6DOF(const Tracker6DOF::Tracker6DOFSample &sample, const Timestamp sampleCreationTimestamp=Timestamp(true))
Creates a new 6DOF tracker data sample from a tracker sample.
const VectorsF3 & positions() const
Returns the position measurements.
Definition DeviceSerializer.h:817
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
QuaternionsF orientations_
The orientation measurements as quaternions.
Definition DeviceSerializer.h:537
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:832
This class is the base class for all sample measurements.
Definition DeviceSerializer.h:50
bool writeMeasurement(IO::OutputBitstream &outputBitstream) const
Writes measurement data to an output bitstream.
bool readMeasurement(IO::InputBitstream &inputBitstream)
Reads measurement data from an input bitstream.
Indices32 objectIds_
The object ids of the measurement units, each id corresponds to a different measurement.
Definition DeviceSerializer.h:70
This class is the base class for all sample tracker measurements.
Definition DeviceSerializer.h:77
bool writeTracker(IO::OutputBitstream &outputBitstream) const
Writes tracker data to an output bitstream.
bool readTracker(IO::InputBitstream &inputBitstream)
Reads tracker data from an input bitstream.
This class provides serialization capabilities for devices.
Definition DeviceSerializer.h:40
Definition of a sample holding one single 6DOF tracker measurement.
Definition Tracker6DOF.h:48
This class implements an input bitstream.
Definition Bitstream.h:51
This class implements an output bitstream.
Definition Bitstream.h:215
This class implements a base class for data samples.
Definition DataSample.h:46
This class implements a timestamp.
Definition Timestamp.h:63
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition Base.h:96
std::vector< VectorF3 > VectorsF3
Definition of a vector holding VectorF3 objects.
Definition Vector3.h:79
std::vector< QuaternionF > QuaternionsF
Definition of a vector holding quaternion objects with single precision float data type.
Definition Quaternion.h:76
The namespace covering the entire Ocean framework.
Definition Accessor.h:15