Ocean
Loading...
Searching...
No Matches
GravityTracker3DOF.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_GRAVITY_TRACKER_3DOF_H
9#define META_OCEAN_DEVICES_GRAVITY_TRACKER_3DOF_H
10
14
16
17#include "ocean/math/Vector3.h"
18
19namespace Ocean
20{
21
22namespace Devices
23{
24
25// Forward declaration.
26class GravityTracker3DOF;
27
28/**
29 * Definition of a smart object reference for a 3DOF gravity tracker.
30 * @see GravityTracker3DOF.
31 * @ingroup devices
32 */
34
35/**
36 * This class is the base class for all 3DOF gravity trackers.
37 * A gravity tracker provides the gravity direction (normalized gravity vector) in the device's coordinate system.
38 * @ingroup devices
39 */
40class OCEAN_DEVICES_EXPORT GravityTracker3DOF : virtual public Tracker
41{
42 public:
43
44 /**
45 * Definition of a sample holding 3DOF gravity measurements.
46 */
47 class OCEAN_DEVICES_EXPORT GravityTracker3DOFSample : virtual public Tracker::TrackerSample
48 {
49 public:
50
51 /**
52 * Definition of a vector holding gravity values.
53 */
55
56 public:
57
58 /**
59 * Creates a new 3DOF gravity sample.
60 * @param timestamp Sample timestamp
61 * @param referenceSystem Tracking reference system used by the underlying tracker
62 * @param objectIds Measurement unit object ids each id corresponds to a different gravity measurement
63 * @param gravities Sample gravity measurements (normalized gravity vectors)
64 * @param metadata Optional metadata of the new sample
65 */
66 GravityTracker3DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, const ObjectIds& objectIds, const Gravities& gravities, const Metadata& metadata = Metadata());
67
68 /**
69 * Creates a new 3DOF gravity sample.
70 * @param timestamp Sample timestamp
71 * @param referenceSystem Tracking reference system used by the underlying tracker
72 * @param objectIds Measurement unit object ids each id corresponds to a different gravity measurement
73 * @param gravities Sample gravity measurements (normalized gravity vectors)
74 * @param metadata Optional metadata of the new sample
75 */
76 GravityTracker3DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, ObjectIds&& objectIds, Gravities&& gravities, Metadata&& metadata = Metadata());
77
78 /**
79 * Returns all 3DOF gravity measurement values.
80 * Each 3DOF measurement corresponds to a different object id.
81 * @return Gravity measurement values (normalized gravity vectors)
82 */
83 inline const Gravities& gravities() const;
84
85 protected:
86
87 /// Gravity measurement values stored as normalized vectors.
89 };
90
91 /**
92 * Definition of a smart object reference for 3DOF gravity tracker samples.
93 */
95
96 public:
97
98 /**
99 * Returns the device type of this tracker.
100 * @return Device type
101 */
102 static inline DeviceType deviceTypeGravityTracker3DOF();
103
104 protected:
105
106 /**
107 * Creates a new 3DOF gravity tracker object.
108 * @param name The name of the gravity tracker, must be valid
109 */
110 explicit GravityTracker3DOF(const std::string& name);
111
112 /**
113 * Destructs a 3DOF gravity tracker object.
114 */
116
117 /**
118 * Interpolates between two 3DOF gravity tracker samples.
119 * @see Measurement::interpolateSamples().
120 */
121 SampleRef interpolateSamples(const SampleRef& lowerSample, const SampleRef& upperSample, const double interpolationFactor, const Timestamp& interpolatedTimestamp) const override;
122};
123
128
133
134}
135
136}
137
138#endif // META_OCEAN_DEVICES_GRAVITY_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
Definition of a sample holding 3DOF gravity measurements.
Definition GravityTracker3DOF.h:48
GravityTracker3DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Gravities &gravities, const Metadata &metadata=Metadata())
Creates a new 3DOF gravity sample.
const Gravities & gravities() const
Returns all 3DOF gravity measurement values.
Definition GravityTracker3DOF.h:129
GravityTracker3DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, ObjectIds &&objectIds, Gravities &&gravities, Metadata &&metadata=Metadata())
Creates a new 3DOF gravity sample.
Gravities gravities_
Gravity measurement values stored as normalized vectors.
Definition GravityTracker3DOF.h:88
This class is the base class for all 3DOF gravity trackers.
Definition GravityTracker3DOF.h:41
~GravityTracker3DOF() override
Destructs a 3DOF gravity tracker object.
SampleRef interpolateSamples(const SampleRef &lowerSample, const SampleRef &upperSample, const double interpolationFactor, const Timestamp &interpolatedTimestamp) const override
Interpolates between two 3DOF gravity tracker samples.
GravityTracker3DOF(const std::string &name)
Creates a new 3DOF gravity tracker object.
static DeviceType deviceTypeGravityTracker3DOF()
Returns the device type of this tracker.
Definition GravityTracker3DOF.h:124
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition Measurement.h:62
This class implements a smart device reference.
Definition DeviceRef.h:36
Definition of a sample holding one measurement values of a tracker.
Definition devices/Tracker.h:90
This class implements the base class for all tracker devices.
Definition devices/Tracker.h:39
@ TRACKER_GRAVITY_3DOF
3DOF gravity tracker.
Definition devices/Tracker.h:66
ReferenceSystem
Definition of different tracking reference system.
Definition devices/Tracker.h:74
This template class implements a object reference with an internal reference counter.
Definition base/ObjectRef.h:58
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition SmartObjectRef.h:90
This class implements a timestamp.
Definition Timestamp.h:63
The namespace covering the entire Ocean framework.
Definition Accessor.h:15