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.
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 */
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 */
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 */
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
const std::string & name() const
Returns the name of this device.
Definition devices/Device.h:340
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.
StackHeapVector< Vector3, 1 > Gravities
Definition of a vector holding gravity values.
Definition GravityTracker3DOF.h:54
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.
SmartObjectRef< GravityTracker3DOFSample, Sample > GravityTracker3DOFSampleRef
Definition of a smart object reference for 3DOF gravity tracker samples.
Definition GravityTracker3DOF.h:94
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
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
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
ReferenceSystem referenceSystem() const
Returns the reference system of the tracker.
Definition devices/Tracker.h:330
@ TRACKER_GRAVITY_3DOF
3DOF gravity tracker.
Definition devices/Tracker.h:58
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
SmartDeviceRef< GravityTracker3DOF > GravityTracker3DOFRef
Definition of a smart object reference for a 3DOF gravity tracker.
Definition GravityTracker3DOF.h:33
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15