Ocean
Loading...
Searching...
No Matches
RMVTracker6DOF.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_RMV_TRACKER_6DOF_H
9#define META_OCEAN_DEVICES_RMV_TRACKER_6DOF_H
10
13
14#include "ocean/base/Thread.h"
15
19
21
23
24namespace Ocean
25{
26
27namespace Devices
28{
29
30namespace RMV
31{
32
33/**
34 * This class implements an RMV feature based tracker.
35 * @ingroup devicesrmv
36 */
37class OCEAN_DEVICES_RMV_EXPORT RMVTracker6DOF :
38 virtual public RMVDevice,
39 virtual public Tracker6DOF,
40 virtual public ObjectTracker,
41 virtual public VisualTracker,
42 protected Thread
43{
44 friend class RMVFactory;
45
46 public:
47
48 /**
49 * Adds a new tracking pattern.
50 * For this RMV feature based tracker the pattern must be the url of an image.
51 * @see ObjectTracker::registerObject().
52 */
53 ObjectId registerObject(const std::string& name, const Vector3& dimension) override;
54
55 /**
56 * Returns whether this device is active.
57 * @see Devices::isStarted().
58 */
59 bool isStarted() const override;
60
61 /**
62 * Starts the device.
63 * @see Device::start().
64 */
65 bool start() override;
66
67 /**
68 * Stops the device.
69 * @see Device::stop().
70 */
71 bool stop() override;
72
73 /**
74 * Returns whether a specific object is currently actively tracked by this tracker.
75 * @see Tracker::isObjectTracked().
76 */
77 bool isObjectTracked(const ObjectId& objectId) const override;
78
79 /**
80 * Returns the name of this tracker.
81 * @return Tracker name
82 */
83 static inline std::string deviceNameRMVTracker6DOF();
84
85 /**
86 * Returns the device type of this tracker.
87 * @return Device type
88 */
89 static inline DeviceType deviceTypeRMVTracker6DOF();
90
91 private:
92
93 /**
94 * Creates a new RMV feature based 6DOF tracker object.
95 */
97
98 /**
99 * Destructs an RMV feature based 6DOF tracker object.
100 */
101 ~RMVTracker6DOF() override;
102
103 /**
104 * Thread function.
105 * @see Thread::threadRun().
106 */
107 void threadRun() override;
108
109 private:
110
111 /// Frame timestamp.
113
114 /// Internal 6DOF tracker object.
116
117 /// Random generator.
119
120 /// The unique object id of this tracker.
121 ObjectId uniqueObjectId_ = invalidObjectId();
122};
123
125{
126 return std::string("RMV Feature Based 6DOF Tracker");
127}
128
133
134}
135
136}
137
138}
139
140#endif // META_OCEAN_DEVICES_RMV_TRACKER_6DOF_H
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
unsigned int ObjectId
Definition of an object id.
Definition Measurement.h:46
This class is the base class for all tracker allowing to track an object or location.
Definition ObjectTracker.h:38
This class implements a device for the RMV library.
Definition RMVDevice.h:29
This class implements a device factory for the RMV feature based tracking system.
Definition RMVFactory.h:29
This class implements an RMV feature based tracker.
Definition RMVTracker6DOF.h:43
static std::string deviceNameRMVTracker6DOF()
Returns the name of this tracker.
Definition RMVTracker6DOF.h:124
Tracking::RMV::RMVFeatureTracker6DOF featureTracker_
Internal 6DOF tracker object.
Definition RMVTracker6DOF.h:115
RMVTracker6DOF()
Creates a new RMV feature based 6DOF tracker object.
void threadRun() override
Thread function.
RandomGenerator randomGenerator_
Random generator.
Definition RMVTracker6DOF.h:118
~RMVTracker6DOF() override
Destructs an RMV feature based 6DOF tracker object.
bool start() override
Starts the device.
bool isStarted() const override
Returns whether this device is active.
Timestamp frameTimestamp_
Frame timestamp.
Definition RMVTracker6DOF.h:112
bool stop() override
Stops the device.
bool isObjectTracked(const ObjectId &objectId) const override
Returns whether a specific object is currently actively tracked by this tracker.
ObjectId registerObject(const std::string &name, const Vector3 &dimension) override
Adds a new tracking pattern.
static DeviceType deviceTypeRMVTracker6DOF()
Returns the device type of this tracker.
Definition RMVTracker6DOF.h:129
This class implements the base for all 6DOF trackers.
Definition Tracker6DOF.h:39
static DeviceType deviceTypeTracker6DOF()
Definition of this device type.
Definition Tracker6DOF.h:100
@ TRACKER_VISUAL
Tracker using a visual input for their measurements.
Definition devices/Tracker.h:62
@ TRACKER_OBJECT
Tracker allowing to register tracking objects at runtime.
Definition devices/Tracker.h:64
This class is the base class for all tracker using visual input to create the tracking results.
Definition devices/VisualTracker.h:41
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class implements a thread.
Definition Thread.h:115
This class implements a timestamp.
Definition Timestamp.h:36
This class implements a RMV feature tracker.
Definition RMVFeatureTracker6DOF.h:43
The namespace covering the entire Ocean framework.
Definition Accessor.h:15