Ocean
Loading...
Searching...
No Matches
Tracker6DOF.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_TRACKER_6DOF_H
9#define META_OCEAN_DEVICES_TRACKER_6DOF_H
10
15
16namespace Ocean
17{
18
19namespace Devices
20{
21
22// Forward declaration.
23class Tracker6DOF;
24
25/**
26 * Definition of a smart object reference for a 6DOF tracker.
27 * @see Tracker6DOF.
28 * @ingroup devices
29 */
31
32/**
33 * This class implements the base for all 6DOF trackers.
34 * @ingroup devices
35 */
36class OCEAN_DEVICES_EXPORT Tracker6DOF :
37 virtual public OrientationTracker3DOF,
38 virtual public PositionTracker3DOF
39{
40 public:
41
42 /**
43 * Definition of a sample holding one single 6DOF tracker measurement.
44 */
45 class OCEAN_DEVICES_EXPORT Tracker6DOFSample :
48 {
49 public:
50
51 /**
52 * Creates a new 6DOF tracker sample.
53 * @param timestamp Sample timestamp
54 * @param referenceSystem Tracking reference system used by the underlying tracker
55 * @param objectIds Measurement unit object ids each id corresponds to a different orientation and position measurement
56 * @param orientations Sample orientation measurements
57 * @param positions Sample position measurements in meter
58 * @param metadata Optional metadata of the new sample
59 */
61
62 /**
63 * Creates a new 6DOF tracker sample.
64 * @param timestamp Sample timestamp
65 * @param referenceSystem Tracking reference system used by the underlying tracker
66 * @param objectIds Measurement unit object ids each id corresponds to a different orientation and position measurement
67 * @param orientations Sample orientation measurements
68 * @param positions Sample position measurements in meter
69 * @param metadata Optional metadata of the new sample
70 */
72 };
73
74 /**
75 * Definition of a smart object reference for 6DOF tracker samples.
76 */
78
79 public:
80
81 /**
82 * Definition of this device type.
83 */
84 static inline DeviceType deviceTypeTracker6DOF();
85
86 protected:
87
88 /**
89 * Creates a new 6DOF tracker object.
90 * @param name The name of the 6DOF tracker, must be valid
91 */
92 explicit Tracker6DOF(const std::string& name);
93
94 /**
95 * Destructs a 6DOF tracker object.
96 */
97 ~Tracker6DOF() override;
98
99 /**
100 * Interpolates between two 6DOF tracker samples.
101 * @see Measurement::interpolateSamples().
102 */
103 SampleRef interpolateSamples(const SampleRef& lowerSample, const SampleRef& upperSample, const double interpolationFactor, const Timestamp& interpolatedTimestamp) const override;
104};
105
110
111}
112
113}
114
115#endif // META_OCEAN_DEVICES_TRACKER_6DOF_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
Definition of a sample holding 3DOF orientation measurements.
Definition OrientationTracker3DOF.h:46
const Orientations & orientations() const
Returns the 3DOF orientation measurement values.
Definition OrientationTracker3DOF.h:127
StackHeapVector< Quaternion, 1 > Orientations
Definition of a vector holding orientation values.
Definition OrientationTracker3DOF.h:52
OrientationTracker3DOF(const std::string &name)
Creates a new 3DOF orientation tracker object.
Definition of a sample holding 3DOF position measurements.
Definition PositionTracker3DOF.h:46
StackHeapVector< Vector3, 1 > Positions
Definition of a vector holding position values.
Definition PositionTracker3DOF.h:52
const Positions & positions() const
Returns all 3DOF position measurement values.
Definition PositionTracker3DOF.h:127
PositionTracker3DOF(const std::string &name)
Creates a new 3DOF position tracker object.
This class implements a smart device reference.
Definition DeviceRef.h:36
Tracker6DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Orientations &orientations, const Positions &positions, const Metadata &metadata=Metadata())
Creates a new 6DOF tracker sample.
Tracker6DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, ObjectIds &&objectIds, Orientations &&orientations, Positions &&positions, Metadata &&metadata=Metadata())
Creates a new 6DOF tracker sample.
This class implements the base for all 6DOF trackers.
Definition Tracker6DOF.h:39
~Tracker6DOF() override
Destructs a 6DOF tracker object.
Tracker6DOF(const std::string &name)
Creates a new 6DOF tracker object.
SmartObjectRef< Tracker6DOFSample, Sample > Tracker6DOFSampleRef
Definition of a smart object reference for 6DOF tracker samples.
Definition Tracker6DOF.h:77
SampleRef interpolateSamples(const SampleRef &lowerSample, const SampleRef &upperSample, const double interpolationFactor, const Timestamp &interpolatedTimestamp) const override
Interpolates between two 6DOF tracker samples.
static DeviceType deviceTypeTracker6DOF()
Definition of this device type.
Definition Tracker6DOF.h:106
ReferenceSystem referenceSystem() const
Returns the reference system of the tracker.
Definition devices/Tracker.h:330
@ TRACKER_6DOF
6DOF orientation and position tracker.
Definition devices/Tracker.h:54
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
This class implements a timestamp.
Definition Timestamp.h:64
SmartDeviceRef< Tracker6DOF > Tracker6DOFRef
Definition of a smart object reference for a 6DOF tracker.
Definition Tracker6DOF.h:30
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15