Ocean
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 
11 #include "ocean/devices/Devices.h"
15 
16 namespace Ocean
17 {
18 
19 namespace Devices
20 {
21 
22 // Forward declaration.
23 class 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  */
36 class 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  */
60  Tracker6DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, const ObjectIds& objectIds, const Orientations& orientations, const Positions& positions, const Metadata& metadata = Metadata());
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  */
71  Tracker6DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, ObjectIds&& objectIds, Orientations&& orientations, Positions&& positions, Metadata&& metadata = Metadata());
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 
101 {
103 }
104 
105 }
106 
107 }
108 
109 #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
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition: Measurement.h:61
std::vector< ObjectId > ObjectIds
Definition of a vector holding object ids.
Definition: Measurement.h:51
Definition of a sample holding 3DOF orientation measurements.
Definition: OrientationTracker3DOF.h:45
std::vector< Quaternion > Orientations
Definition of a vector holding orientation values.
Definition: OrientationTracker3DOF.h:51
This class is the base class for all 3DOF orientation tracker objects.
Definition: OrientationTracker3DOF.h:38
Definition of a sample holding 3DOF position measurements.
Definition: PositionTracker3DOF.h:44
std::vector< Vector3 > Positions
Definition of a vector holding position values.
Definition: PositionTracker3DOF.h:50
This class is the base class for all 3DOF position trackers.
Definition: PositionTracker3DOF.h:37
Definition of a sample holding one single 6DOF tracker measurement.
Definition: Tracker6DOF.h:48
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
static DeviceType deviceTypeTracker6DOF()
Definition of this device type.
Definition: Tracker6DOF.h:100
@ TRACKER_6DOF
6DOF orientation and position tracker.
Definition: devices/Tracker.h:54
ReferenceSystem
Definition of different tracking reference system.
Definition: devices/Tracker.h:72
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:36
SmartDeviceRef< Tracker6DOF > Tracker6DOFRef
Definition of a smart object reference for a 6DOF tracker.
Definition: Tracker6DOF.h:23
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15