Ocean
Loading...
Searching...
No Matches
PositionTracker3DOF.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_POSITION_TRACKER_3DOF_H
9#define META_OCEAN_DEVICES_POSITION_TRACKER_3DOF_H
10
13
15
16#include "ocean/math/Vector3.h"
17
18namespace Ocean
19{
20
21namespace Devices
22{
23
24// Forward declaration.
25class PositionTracker3DOF;
26
27/**
28 * Definition of a smart object reference for a 3DOF position tracker.
29 * @see PositionTracker3DOF.
30 * @ingroup devices
31 */
33
34/**
35 * This class is the base class for all 3DOF position trackers.
36 * @ingroup devices
37 */
38class OCEAN_DEVICES_EXPORT PositionTracker3DOF : virtual public Tracker
39{
40 public:
41
42 /**
43 * Definition of a sample holding 3DOF position measurements.
44 */
45 class OCEAN_DEVICES_EXPORT PositionTracker3DOFSample : virtual public Tracker::TrackerSample
46 {
47 public:
48
49 /**
50 * Definition of a vector holding position values.
51 */
53
54 public:
55
56 /**
57 * Creates a new 3DOF position 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 position measurement
61 * @param positions Sample position measurements in meter
62 * @param metadata Optional metadata of the new sample
63 */
64 PositionTracker3DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, const ObjectIds& objectIds, const Positions& positions, const Metadata& metadata = Metadata());
65
66 /**
67 * Creates a new 3DOF position 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 position measurement
71 * @param positions Sample position measurements in meter
72 * @param metadata Optional metadata of the new sample
73 */
74 PositionTracker3DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, ObjectIds&& objectIds, Positions&& positions, Metadata&& metadata = Metadata());
75
76 /**
77 * Returns all 3DOF position measurement values.
78 * Each 3DOF measurement corresponds to a different object id.
79 * @return Position measurement value in meter
80 */
81 inline const Positions& positions() const;
82
83 protected:
84
85 /// position measurement values stored in meter.
87 };
88
89 /**
90 * Definition of a smart object reference for 3DOF position tracker samples.
91 */
93
94 public:
95
96 /**
97 * Returns the device type of this tracker.
98 * @return Device type
99 */
100 static inline DeviceType deviceTypePositionTracker3DOF();
101
102 protected:
103
104 /**
105 * Creates a new 3DOF position tracker object.
106 * @param name The name of the position tracker, must be valid
107 */
108 explicit PositionTracker3DOF(const std::string& name);
109
110 /**
111 * Destructs a 3DOF position tracker object.
112 */
114
115 /**
116 * Interpolates between two 3DOF position 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_POSITION_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
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition Measurement.h:62
Definition of a sample holding 3DOF position measurements.
Definition PositionTracker3DOF.h:46
Positions positions_
position measurement values stored in meter.
Definition PositionTracker3DOF.h:86
const Positions & positions() const
Returns all 3DOF position measurement values.
Definition PositionTracker3DOF.h:127
PositionTracker3DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, ObjectIds &&objectIds, Positions &&positions, Metadata &&metadata=Metadata())
Creates a new 3DOF position sample.
PositionTracker3DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Positions &positions, const Metadata &metadata=Metadata())
Creates a new 3DOF position sample.
This class is the base class for all 3DOF position trackers.
Definition PositionTracker3DOF.h:39
static DeviceType deviceTypePositionTracker3DOF()
Returns the device type of this tracker.
Definition PositionTracker3DOF.h:122
SampleRef interpolateSamples(const SampleRef &lowerSample, const SampleRef &upperSample, const double interpolationFactor, const Timestamp &interpolatedTimestamp) const override
Interpolates between two 3DOF position tracker samples.
PositionTracker3DOF(const std::string &name)
Creates a new 3DOF position tracker object.
~PositionTracker3DOF() override
Destructs a 3DOF position tracker object.
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_POSITION_3DOF
3DOF position tracker.
Definition devices/Tracker.h:52
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