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 /**
171 * Factory function for creating a DataSampleOrientationTracker3DOF.
172 * This function can be used with InputDataSerializer::registerFactoryFunction().
173 * @param sampleType The sample type (unused, but required by the factory function signature)
174 * @return A new DataSampleOrientationTracker3DOF instance
175 */
176 static IO::Serialization::UniqueDataSample createSample(const std::string& sampleType);
177
178 protected:
179
180 /// The orientation measurements as quaternions.
182 };
183
184 /**
185 * This class implements a data sample for 3DOF acceleration sensor measurements.
186 */
189 public SampleMeasurement
190 {
191 public:
192
193 /**
194 * Creates a new 3DOF acceleration sensor data sample.
195 */
197
198 /**
199 * Creates a new 3DOF acceleration sensor data sample from a sensor sample.
200 * @param sample The acceleration sensor 3DOF sample to serialize
201 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
202 */
204
205 /**
206 * Reads the sample from an input bitstream.
207 * @param inputBitstream The input bitstream from which the sample will be read
208 * @return True, if succeeded
209 * @see writeSample().
210 */
211 bool readSample(IO::InputBitstream& inputBitstream) override;
212
213 /**
214 * Writes the sample to an output bitstream.
215 * @param outputBitstream The output bitstream to which the sample will be written
216 * @return True, if succeeded
217 * @see readSample().
218 */
219 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
220
221 /**
222 * Returns the type of the sample.
223 * @return The sample type
224 * @see sampleType().
225 */
226 inline const std::string& type() const override;
227
228 /**
229 * Returns the acceleration measurements.
230 * @return The acceleration measurements, each in [m / s^2]
231 */
232 inline const VectorsF3& measurements() const;
233
234 /**
235 * Returns the object ids.
236 * @return The object ids, each id corresponds to a different acceleration measurement
237 */
238 inline const Indices32& objectIds() const;
239
240 /**
241 * Returns the static sample type.
242 * @return The sample type
243 */
244 static inline const std::string& sampleType();
245
246 /**
247 * Factory function for creating a DataSampleAccelerationSensor3DOF.
248 * This function can be used with InputDataSerializer::registerFactoryFunction().
249 * @param sampleType The sample type (unused, but required by the factory function signature)
250 * @return A new DataSampleAccelerationSensor3DOF instance
251 */
252 static IO::Serialization::UniqueDataSample createSample(const std::string& sampleType);
253
254 protected:
255
256 /// The acceleration measurements, each in [m / s^2].
258 };
259
260 /**
261 * This class implements a data sample for 3DOF gyro sensor measurements.
262 */
265 public SampleMeasurement
266 {
267 public:
268
269 /**
270 * Creates a new 3DOF gyro sensor data sample.
271 */
273
274 /**
275 * Creates a new 3DOF gyro sensor data sample from a sensor sample.
276 * @param sample The gyro sensor 3DOF sample to serialize
277 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
278 */
279 DataSampleGyroSensor3DOF(const GyroSensor3DOF::Gyro3DOFSample& sample, const Timestamp sampleCreationTimestamp = Timestamp(true));
280
281 /**
282 * Reads the sample from an input bitstream.
283 * @param inputBitstream The input bitstream from which the sample will be read
284 * @return True, if succeeded
285 * @see writeSample().
286 */
287 bool readSample(IO::InputBitstream& inputBitstream) override;
288
289 /**
290 * Writes the sample to an output bitstream.
291 * @param outputBitstream The output bitstream to which the sample will be written
292 * @return True, if succeeded
293 * @see readSample().
294 */
295 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
296
297 /**
298 * Returns the type of the sample.
299 * @return The sample type
300 * @see sampleType().
301 */
302 inline const std::string& type() const override;
303
304 /**
305 * Returns the gyro measurements.
306 * @return The gyro measurements
307 */
308 inline const VectorsF3& measurements() const;
309
310 /**
311 * Returns the object ids.
312 * @return The object ids, each id corresponds to a different gyro measurement
313 */
314 inline const Indices32& objectIds() const;
315
316 /**
317 * Returns the static sample type.
318 * @return The sample type
319 */
320 static inline const std::string& sampleType();
321
322 /**
323 * Factory function for creating a DataSampleGyroSensor3DOF.
324 * This function can be used with InputDataSerializer::registerFactoryFunction().
325 * @param sampleType The sample type (unused, but required by the factory function signature)
326 * @return A new DataSampleGyroSensor3DOF instance
327 */
328 static IO::Serialization::UniqueDataSample createSample(const std::string& sampleType);
329
330 protected:
331
332 /// The gyro measurements.
334 };
335
336 /**
337 * This class implements a data sample for 3DOF gravity tracker measurements.
338 */
341 public SampleTracker
342 {
343 public:
344
345 /**
346 * Creates a new 3DOF gravity tracker data sample.
347 */
349
350 /**
351 * Creates a new 3DOF gravity tracker data sample from a tracker sample.
352 * @param sample The gravity tracker 3DOF sample to serialize
353 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
354 */
356
357 /**
358 * Reads the sample from an input bitstream.
359 * @param inputBitstream The input bitstream from which the sample will be read
360 * @return True, if succeeded
361 * @see writeSample().
362 */
363 bool readSample(IO::InputBitstream& inputBitstream) override;
364
365 /**
366 * Writes the sample to an output bitstream.
367 * @param outputBitstream The output bitstream to which the sample will be written
368 * @return True, if succeeded
369 * @see readSample().
370 */
371 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
372
373 /**
374 * Returns the type of the sample.
375 * @return The sample type
376 * @see sampleType().
377 */
378 inline const std::string& type() const override;
379
380 /**
381 * Returns the gravity measurements.
382 * @return The gravity measurements
383 */
384 inline const VectorsF3& gravities() const;
385
386 /**
387 * Returns the object ids.
388 * @return The object ids, each id corresponds to a different gravity measurement
389 */
390 inline const Indices32& objectIds() const;
391
392 /**
393 * Returns the reference system.
394 * @return The reference system used by the tracker, -1 if not defined
395 */
396 inline int8_t referenceSystem() const;
397
398 /**
399 * Returns the static sample type.
400 * @return The sample type
401 */
402 static inline const std::string& sampleType();
403
404 /**
405 * Factory function for creating a DataSampleGravityTracker3DOF.
406 * This function can be used with InputDataSerializer::registerFactoryFunction().
407 * @param sampleType The sample type (unused, but required by the factory function signature)
408 * @return A new DataSampleGravityTracker3DOF instance
409 */
410 static IO::Serialization::UniqueDataSample createSample(const std::string& sampleType);
411
412 protected:
413
414 /// The gravity measurements.
416 };
417
418 /**
419 * This class implements a data sample for 3DOF position tracker measurements.
420 */
423 public SampleTracker
424 {
425 public:
426
427 /**
428 * Creates a new 3DOF position tracker data sample.
429 */
431
432 /**
433 * Creates a new 3DOF position tracker data sample from a tracker sample.
434 * @param sample The position tracker 3DOF sample to serialize
435 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
436 */
438
439 /**
440 * Reads the sample from an input bitstream.
441 * @param inputBitstream The input bitstream from which the sample will be read
442 * @return True, if succeeded
443 * @see writeSample().
444 */
445 bool readSample(IO::InputBitstream& inputBitstream) override;
446
447 /**
448 * Writes the sample to an output bitstream.
449 * @param outputBitstream The output bitstream to which the sample will be written
450 * @return True, if succeeded
451 * @see readSample().
452 */
453 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
454
455 /**
456 * Returns the type of the sample.
457 * @return The sample type
458 * @see sampleType().
459 */
460 inline const std::string& type() const override;
461
462 /**
463 * Returns the position measurements.
464 * @return The position measurements in meter
465 */
466 inline const VectorsF3& positions() const;
467
468 /**
469 * Returns the object ids.
470 * @return The object ids, each id corresponds to a different position measurement
471 */
472 inline const Indices32& objectIds() const;
473
474 /**
475 * Returns the reference system.
476 * @return The reference system used by the tracker, -1 if not defined
477 */
478 inline int8_t referenceSystem() const;
479
480 /**
481 * Returns the static sample type.
482 * @return The sample type
483 */
484 static inline const std::string& sampleType();
485
486 /**
487 * Factory function for creating a DataSamplePositionTracker3DOF.
488 * This function can be used with InputDataSerializer::registerFactoryFunction().
489 * @param sampleType The sample type (unused, but required by the factory function signature)
490 * @return A new DataSamplePositionTracker3DOF instance
491 */
492 static IO::Serialization::UniqueDataSample createSample(const std::string& sampleType);
493
494 protected:
495
496 /// The position measurements in meter.
498 };
499
500 /**
501 * This class implements a data sample for 6DOF tracker measurements.
502 */
505 public SampleTracker
506 {
507 public:
508
509 /**
510 * Creates a new 6DOF tracker data sample.
511 */
513
514 /**
515 * Creates a new 6DOF tracker data sample from a tracker sample.
516 * @param sample The tracker 6DOF sample to serialize
517 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
518 */
519 DataSampleTracker6DOF(const Tracker6DOF::Tracker6DOFSample& sample, const Timestamp sampleCreationTimestamp = Timestamp(true));
520
521 /**
522 * Reads the sample from an input bitstream.
523 * @param inputBitstream The input bitstream from which the sample will be read
524 * @return True, if succeeded
525 * @see writeSample().
526 */
527 bool readSample(IO::InputBitstream& inputBitstream) override;
528
529 /**
530 * Writes the sample to an output bitstream.
531 * @param outputBitstream The output bitstream to which the sample will be written
532 * @return True, if succeeded
533 * @see readSample().
534 */
535 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
536
537 /**
538 * Returns the type of the sample.
539 * @return The sample type
540 * @see sampleType().
541 */
542 inline const std::string& type() const override;
543
544 /**
545 * Returns the orientation measurements.
546 * @return The orientation measurements as quaternions
547 */
548 inline const QuaternionsF& orientations() const;
549
550 /**
551 * Returns the position measurements.
552 * @return The position measurements in meter
553 */
554 inline const VectorsF3& positions() const;
555
556 /**
557 * Returns the object ids.
558 * @return The object ids, each id corresponds to a different 6DOF measurement
559 */
560 inline const Indices32& objectIds() const;
561
562 /**
563 * Returns the reference system.
564 * @return The reference system used by the tracker, -1 if not defined
565 */
566 inline int8_t referenceSystem() const;
567
568 /**
569 * Returns the static sample type.
570 * @return The sample type
571 */
572 static inline const std::string& sampleType();
573
574 /**
575 * Factory function for creating a DataSampleTracker6DOF.
576 * This function can be used with InputDataSerializer::registerFactoryFunction().
577 * @param sampleType The sample type (unused, but required by the factory function signature)
578 * @return A new DataSampleTracker6DOF instance
579 */
580 static IO::Serialization::UniqueDataSample createSample(const std::string& sampleType);
581
582 protected:
583
584 /// The orientation measurements as quaternions.
586
587 /// The position measurements in meter.
589 };
590
591 /**
592 * This class implements a data sample for GPS tracker measurements.
593 */
596 public SampleTracker
597 {
598 public:
599
600 /**
601 * This class implements a GPS location.
602 */
604 {
605 public:
606
607 /**
608 * Creates a new GPS location with default values.
609 */
610 Location() = default;
611
612 /**
613 * Creates a new GPS location from a GPS tracker location.
614 * @param location The GPS tracker location
615 */
617
618 /**
619 * Reads a GPS location from an input bitstream.
620 * @param inputBitstream The input bitstream from which the location will be read
621 * @return True, if succeeded
622 */
623 bool read(IO::InputBitstream& inputBitstream);
624
625 /**
626 * Writes a GPS location to an output bitstream.
627 * @param outputBitstream The output bitstream to which the location will be written
628 * @return True, if succeeded
629 */
630 bool write(IO::OutputBitstream& outputBitstream) const;
631
632 public:
633
634 /// The latitude in degrees, range [-90, 90], NumericD::minValue() if unknown.
635 double latitude_ = NumericD::minValue();
636
637 /// The longitude in degrees, range [-180, 180], NumericD::minValue() if unknown.
638 double longitude_ = NumericD::minValue();
639
640 /// The altitude in meters, NumericF::minValue() if unknown.
641 float altitude_ = NumericF::minValue();
642
643 /// The direction (heading) in degrees, range [0, 360), -1 if unknown.
644 float direction_ = -1.0f;
645
646 /// The speed in meters per second, -1 if unknown.
647 float speed_ = -1.0f;
648
649 /// The horizontal accuracy in meters, -1 if unknown.
650 float accuracy_ = -1.0f;
651
652 /// The altitude accuracy in meters, -1 if unknown.
653 float altitudeAccuracy_ = -1.0f;
654
655 /// The direction accuracy in degrees, -1 if unknown.
656 float directionAccuracy_ = -1.0f;
657
658 /// The speed accuracy in meters per second, -1 if unknown.
659 float speedAccuracy_ = -1.0f;
660 };
661
662 /**
663 * Definition of a vector holding GPS locations.
664 */
665 using Locations = std::vector<Location>;
666
667 public:
668
669 /**
670 * Creates a new GPS tracker data sample.
671 */
673
674 /**
675 * Creates a new GPS tracker data sample from a tracker sample.
676 * @param sample The GPS tracker sample to serialize
677 * @param sampleCreationTimestamp The timestamp when the sample was created, used to determine playback timestamp
678 */
679 DataSampleGPSTracker(const GPSTracker::GPSTrackerSample& sample, const Timestamp sampleCreationTimestamp = Timestamp(true));
680
681 /**
682 * Reads the sample from an input bitstream.
683 * @param inputBitstream The input bitstream from which the sample will be read
684 * @return True, if succeeded
685 * @see writeSample().
686 */
687 bool readSample(IO::InputBitstream& inputBitstream) override;
688
689 /**
690 * Writes the sample to an output bitstream.
691 * @param outputBitstream The output bitstream to which the sample will be written
692 * @return True, if succeeded
693 * @see readSample().
694 */
695 bool writeSample(IO::OutputBitstream& outputBitstream) const override;
696
697 /**
698 * Returns the type of the sample.
699 * @return The sample type
700 * @see sampleType().
701 */
702 inline const std::string& type() const override;
703
704 /**
705 * Returns the GPS locations.
706 * @return The GPS locations
707 */
708 inline const Locations& locations() const;
709
710 /**
711 * Returns the object ids.
712 * @return The object ids, each id corresponds to a different GPS location
713 */
714 inline const Indices32& objectIds() const;
715
716 /**
717 * Returns the reference system.
718 * @return The reference system used by the tracker, -1 if not defined
719 */
720 inline int8_t referenceSystem() const;
721
722 /**
723 * Returns the static sample type.
724 * @return The sample type
725 */
726 static inline const std::string& sampleType();
727
728 /**
729 * Factory function for creating a DataSampleGPSTracker.
730 * This function can be used with InputDataSerializer::registerFactoryFunction().
731 * @param sampleType The sample type (unused, but required by the factory function signature)
732 * @return A new DataSampleGPSTracker instance
733 */
734 static IO::Serialization::UniqueDataSample createSample(const std::string& sampleType);
735
736 protected:
737
738 /// The GPS locations.
740 };
741};
742
744{
745 return sampleType();
746}
747
749{
750 return orientations_;
751}
752
754{
755 return objectIds_;
756}
757
759{
760 return referenceSystem_;
761}
762
764{
765 static const std::string typeName = "ocean/devices/datasampleorientationtracker3dof";
766 return typeName;
767}
768
770{
771 return sampleType();
772}
773
775{
776 return measurements_;
777}
778
780{
781 return objectIds_;
782}
783
785{
786 static const std::string typeName = "ocean/devices/datasampleaccelerationsensor3dof";
787 return typeName;
788}
789
791{
792 return sampleType();
793}
794
796{
797 return measurements_;
798}
799
801{
802 return objectIds_;
803}
804
806{
807 static const std::string typeName = "ocean/devices/datasamplegyrosensor3dof";
808 return typeName;
809}
810
812{
813 return sampleType();
814}
815
817{
818 return gravities_;
819}
820
822{
823 return objectIds_;
824}
825
827{
828 return referenceSystem_;
829}
830
832{
833 static const std::string typeName = "ocean/devices/datasamplegravitytracker3dof";
834 return typeName;
835}
836
838{
839 return sampleType();
840}
841
843{
844 return positions_;
845}
846
848{
849 return objectIds_;
850}
851
853{
854 return referenceSystem_;
855}
856
858{
859 static const std::string typeName = "ocean/devices/datasamplepositiontracker3dof";
860 return typeName;
861}
862
863inline const std::string& DeviceSerializer::DataSampleTracker6DOF::type() const
864{
865 return sampleType();
866}
867
869{
870 return orientations_;
871}
872
874{
875 return positions_;
876}
877
879{
880 return objectIds_;
881}
882
884{
885 return referenceSystem_;
886}
887
889{
890 static const std::string typeName = "ocean/devices/datasampletracker6dof";
891 return typeName;
892}
893
894inline const std::string& DeviceSerializer::DataSampleGPSTracker::type() const
895{
896 return sampleType();
897}
898
903
905{
906 return objectIds_;
907}
908
910{
911 return referenceSystem_;
912}
913
915{
916 static const std::string typeName = "ocean/devices/datasamplegpstracker";
917 return typeName;
918}
919
920
921
922}
923
924}
925
926}
927
928#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:190
VectorsF3 measurements_
The acceleration measurements, each in [m / s^2].
Definition DeviceSerializer.h:257
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:779
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:774
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:769
static IO::Serialization::UniqueDataSample createSample(const std::string &sampleType)
Factory function for creating a DataSampleAccelerationSensor3DOF.
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:784
This class implements a GPS location.
Definition DeviceSerializer.h:604
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:597
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:665
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:914
Locations locations_
The GPS locations.
Definition DeviceSerializer.h:739
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:894
const Locations & locations() const
Returns the GPS locations.
Definition DeviceSerializer.h:899
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:909
DataSampleGPSTracker()=default
Creates a new GPS tracker data sample.
static IO::Serialization::UniqueDataSample createSample(const std::string &sampleType)
Factory function for creating a DataSampleGPSTracker.
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:904
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:342
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:811
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:831
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:826
VectorsF3 gravities_
The gravity measurements.
Definition DeviceSerializer.h:415
static IO::Serialization::UniqueDataSample createSample(const std::string &sampleType)
Factory function for creating a DataSampleGravityTracker3DOF.
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:821
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:816
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:266
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:795
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:800
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:790
VectorsF3 measurements_
The gyro measurements.
Definition DeviceSerializer.h:333
static IO::Serialization::UniqueDataSample createSample(const std::string &sampleType)
Factory function for creating a DataSampleGyroSensor3DOF.
DataSampleGyroSensor3DOF()=default
Creates a new 3DOF gyro sensor data sample.
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:805
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 IO::Serialization::UniqueDataSample createSample(const std::string &sampleType)
Factory function for creating a DataSampleOrientationTracker3DOF.
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:763
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:753
QuaternionsF orientations_
The orientation measurements as quaternions.
Definition DeviceSerializer.h:181
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:743
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:758
const QuaternionsF & orientations() const
Returns the orientation measurements.
Definition DeviceSerializer.h:748
This class implements a data sample for 3DOF position tracker measurements.
Definition DeviceSerializer.h:424
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:852
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:857
DataSamplePositionTracker3DOF()=default
Creates a new 3DOF position tracker data sample.
static IO::Serialization::UniqueDataSample createSample(const std::string &sampleType)
Factory function for creating a DataSamplePositionTracker3DOF.
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:847
VectorsF3 positions_
The position measurements in meter.
Definition DeviceSerializer.h:497
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:837
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:842
This class implements a data sample for 6DOF tracker measurements.
Definition DeviceSerializer.h:506
static IO::Serialization::UniqueDataSample createSample(const std::string &sampleType)
Factory function for creating a DataSampleTracker6DOF.
bool readSample(IO::InputBitstream &inputBitstream) override
Reads the sample from an input bitstream.
int8_t referenceSystem() const
Returns the reference system.
Definition DeviceSerializer.h:883
const std::string & type() const override
Returns the type of the sample.
Definition DeviceSerializer.h:863
VectorsF3 positions_
The position measurements in meter.
Definition DeviceSerializer.h:588
const Indices32 & objectIds() const
Returns the object ids.
Definition DeviceSerializer.h:878
DataSampleTracker6DOF()=default
Creates a new 6DOF tracker data sample.
const QuaternionsF & orientations() const
Returns the orientation measurements.
Definition DeviceSerializer.h:868
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:873
bool writeSample(IO::OutputBitstream &outputBitstream) const override
Writes the sample to an output bitstream.
QuaternionsF orientations_
The orientation measurements as quaternions.
Definition DeviceSerializer.h:585
static const std::string & sampleType()
Returns the static sample type.
Definition DeviceSerializer.h:888
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:64
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition Base.h:96
std::unique_ptr< DataSample > UniqueDataSample
Definition of a unique pointer holding a DataSample.
Definition DataSample.h:39
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