Ocean
Loading...
Searching...
No Matches
OrientationTracker3DOF.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_ORIENTATION_TRACKER_3DOF_H
9#define META_OCEAN_DEVICES_ORIENTATION_TRACKER_3DOF_H
10
13
15
17
18namespace Ocean
19{
20
21namespace Devices
22{
23
24// Forward declaration.
26
27/**
28 * Definition of a 3DOF orientation tracker reference object.
29 * @see OrientationTracker3DOF.
30 * @ingroup devices
31 */
33
34/**
35 * This class is the base class for all 3DOF orientation tracker objects.
36 * @ingroup devices
37 */
38class OCEAN_DEVICES_EXPORT OrientationTracker3DOF : virtual public Tracker
39{
40 public:
41
42 /**
43 * Definition of a sample holding 3DOF orientation measurements.
44 */
45 class OCEAN_DEVICES_EXPORT OrientationTracker3DOFSample : virtual public TrackerSample
46 {
47 public:
48
49 /**
50 * Definition of a vector holding orientation values.
51 */
53
54 public:
55
56 /**
57 * Creates a new 3DOF orientation sample.
58 * @param timestamp Sample timestamp
59 * @param referenceSystem Tracking reference system used by the underlying tracker
60 * @param objectIds Measurement unit object ids each id corresponds to a different orientation measurement
61 * @param orientations Sample orientation measurements
62 * @param metadata Optional metadata of the new sample
63 */
65
66 /**
67 * Creates a new 3DOF orientation sample.
68 * @param timestamp Sample timestamp
69 * @param referenceSystem Tracking reference system used by the underlying tracker
70 * @param objectIds Measurement unit object ids each id corresponds to a different orientation measurement
71 * @param orientations Sample orientation measurements
72 * @param metadata Optional metadata of the new sample
73 */
75
76 /**
77 * Returns the 3DOF orientation measurement values.
78 * Each 3DOF measurement corresponds to a different object id.
79 * @return Orientation measurement values as quaternion
80 */
81 inline const Orientations& orientations() const;
82
83 protected:
84
85 /// Orientation measurement values stored as unit quaternion.
87 };
88
89 /**
90 * Definition of a smart object reference for 3DOF orientation tracker samples.
91 */
93
94 public:
95
96 /**
97 * Return the device type of this tracker.
98 * @return Device type
99 */
101
102 protected:
103
104 /**
105 * Creates a new 3DOF orientation tracker object.
106 * @param name The name of the orientation tracker, must be valid
107 */
108 explicit OrientationTracker3DOF(const std::string& name);
109
110 /**
111 * Destructs a 3DOF orientation tracker.
112 */
114
115 /**
116 * Interpolates between two 3DOF orientation tracker samples.
117 * @see Measurement::interpolateSamples().
118 */
119 SampleRef interpolateSamples(const SampleRef& lowerSample, const SampleRef& upperSample, const double interpolationFactor, const Timestamp& interpolatedTimestamp) const override;
120};
121
126
131
132}
133
134}
135
136#endif // META_OCEAN_DEVICES_ORIENTATION_TRACKER_3DOF_H
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
@ DEVICE_TRACKER
Tracker device.
Definition devices/Device.h:46
const std::string & name() const
Returns the name of this device.
Definition devices/Device.h:340
const ObjectIds & objectIds() const
Returns the sample object ids specifying possible different measurement units.
Definition Measurement.h:519
const Metadata & metadata() const
Returns the metadata of this sample.
Definition Measurement.h:524
const Timestamp & timestamp() const
Returns the sample timestamp.
Definition Measurement.h:509
ObjectRef< Sample > SampleRef
Definition of an object reference for samples.
Definition Measurement.h:144
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition Measurement.h:62
StackHeapVector< ObjectId, 1 > ObjectIds
Definition of a vector holding object ids.
Definition Measurement.h:52
OrientationTracker3DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Orientations &orientations, const Metadata &metadata=Metadata())
Creates a new 3DOF orientation sample.
const Orientations & orientations() const
Returns the 3DOF orientation measurement values.
Definition OrientationTracker3DOF.h:127
OrientationTracker3DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, ObjectIds &&objectIds, Orientations &&orientations, Metadata &&metadata=Metadata())
Creates a new 3DOF orientation sample.
StackHeapVector< Quaternion, 1 > Orientations
Definition of a vector holding orientation values.
Definition OrientationTracker3DOF.h:52
Orientations orientations_
Orientation measurement values stored as unit quaternion.
Definition OrientationTracker3DOF.h:86
This class is the base class for all 3DOF orientation tracker objects.
Definition OrientationTracker3DOF.h:39
OrientationTracker3DOF(const std::string &name)
Creates a new 3DOF orientation tracker object.
static DeviceType deviceTypeOrientationTracker3DOF()
Return the device type of this tracker.
Definition OrientationTracker3DOF.h:122
SmartObjectRef< OrientationTracker3DOFSample, Sample > OrientationTracker3DOFSampleRef
Definition of a smart object reference for 3DOF orientation tracker samples.
Definition OrientationTracker3DOF.h:92
~OrientationTracker3DOF() override
Destructs a 3DOF orientation tracker.
SampleRef interpolateSamples(const SampleRef &lowerSample, const SampleRef &upperSample, const double interpolationFactor, const Timestamp &interpolatedTimestamp) const override
Interpolates between two 3DOF orientation tracker samples.
ReferenceSystem referenceSystem() const
Returns the reference system of the tracker.
Definition devices/Tracker.h:330
TrackerSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Metadata &metadata)
Creates a new tracker sample.
@ TRACKER_ORIENTATION_3DOF
3DOF orientation tracker.
Definition devices/Tracker.h:50
Tracker(const std::string &name, const DeviceType type)
Creates a new tracker object.
ReferenceSystem
Definition of different tracking reference system.
Definition devices/Tracker.h:74
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition SmartObjectRef.h:90
Vector like data structure combining stack and heap memory.
Definition StackHeapVector.h:27
This class implements a timestamp.
Definition Timestamp.h:64
SmartObjectRef< OrientationTracker3DOF, Device > OrientationTracker3DOFRef
Definition of a 3DOF orientation tracker reference object.
Definition OrientationTracker3DOF.h:32
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15