8 #ifndef META_OCEAN_DEVICES_TRACKER_H
9 #define META_OCEAN_DEVICES_TRACKER_H
48 TRACKER_INVALID = MINOR_INVALID,
50 TRACKER_ORIENTATION_3DOF = (1u << 0u),
52 TRACKER_POSITION_3DOF = (1u << 1u),
54 TRACKER_6DOF = TRACKER_ORIENTATION_3DOF | TRACKER_POSITION_3DOF,
56 SCENE_TRACKER_6DOF = (1u << 2u) | TRACKER_6DOF,
58 TRACKER_GPS = (1u << 3u),
60 TRACKER_MAGNETIC = (1u << 4u),
62 TRACKER_VISUAL = (1u << 5u),
64 TRACKER_OBJECT = (1u << 6u)
165 inline void makeWeak();
176 explicit inline operator bool()
const;
267 static constexpr
Frequency unknownFrequency();
335 *
this = std::move(trackerObjectEventSubscription);
349 inline Tracker::TrackerObjectEventSubscription::operator bool()
const
351 return weakTracker_ !=
nullptr;
This class implements a container for callback functions.
Definition: Callback.h:3456
Definition of a class holding the major and minor device type.
Definition: devices/Device.h:62
unsigned int SubscriptionId
Definition of a subscription id for event callbacks.
Definition: devices/Device.h:151
Definition of a sample holding a measurement.
Definition: Measurement.h:67
This class implements the base class for all devices providing measurement samples.
Definition: Measurement.h:40
unsigned int ObjectId
Definition of an object id.
Definition: Measurement.h:46
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition: Measurement.h:61
std::unordered_set< ObjectId > ObjectIdSet
Definition of an unordered set holding object ids.
Definition: Measurement.h:56
std::vector< ObjectId > ObjectIds
Definition of a vector holding object ids.
Definition: Measurement.h:51
This class manages the lifetime of an event subscription for tracker object events.
Definition: devices/Tracker.h:141
TrackerObjectEventSubscription & operator=(const TrackerObjectEventSubscription &trackerObjectEventSubscription)=delete
Disabled assign operator.
TrackerObjectEventSubscription & operator=(TrackerObjectEventSubscription &&trackerObjectEventSubscription)
Replaces the current event subscription with a new event subscription.
~TrackerObjectEventSubscription()
Destructs the subscription object and unsubscribes the object event.
Definition: devices/Tracker.h:338
void release()
Explicitly releases the subscription.
TrackerObjectEventSubscription()=default
Default constructor for a not active subscription.
void makeWeak()
Makes this subscription object weak so that is does not hold a reference to the actual measurement ob...
Definition: devices/Tracker.h:343
TrackerRef tracker_
The tracker to which the event subscription belongs.
Definition: devices/Tracker.h:204
TrackerObjectEventSubscription(const Tracker &tracker, const SubscriptionId subscriptionId)
Creates an active subscription object.
Definition of a sample holding one measurement values of a tracker.
Definition: devices/Tracker.h:88
TrackerSample(const Timestamp ×tamp, const ReferenceSystem referenceSystem, ObjectIds &&objectIds, Metadata &&metadata)
Creates a new tracker sample.
ReferenceSystem referenceSystem() const
Returns the reference system of the tracker.
Definition: devices/Tracker.h:328
TrackerSample(const Timestamp ×tamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Metadata &metadata)
Creates a new tracker sample.
ReferenceSystem referenceSystem_
Tracking reference system.
Definition: devices/Tracker.h:120
This class implements the base class for all tracker devices.
Definition: devices/Tracker.h:39
TrackerType
Definition of different minor device types.
Definition: devices/Tracker.h:46
~Tracker() override
Destructs a tracker object.
Callback< void, const Tracker *, const bool, const ObjectIdSet &, const Timestamp & > TrackerObjectCallback
Definition of a callback function to subscribe for lost and found tracker events.
Definition: devices/Tracker.h:135
Tracker(const std::string &name, const DeviceType type)
Creates a new tracker object.
TrackerObjectSubscriptionMap trackerObjectSubscriptionMap_
Map holding all tracker object event subscriptions.
Definition: devices/Tracker.h:322
void unsubscribeTrackerObjectEvent(const SubscriptionId subscriptionId)
Unsubscribes a tracker object event callback function.
virtual bool isObjectTracked(const ObjectId &objectId) const
Returns whether a specific object is currently actively tracked by this tracker.
virtual HomogenousMatrixD4 reference() const
Returns the reference coordinate system of this tracker.
ReferenceSystem
Definition of different tracking reference system.
Definition: devices/Tracker.h:72
@ RS_OBJECT_IN_DEVICE
Returning tracking values are given in the coordinate system of the device.
Definition: devices/Tracker.h:74
static ObjectIdSet determineLostObjects(const ObjectIdSet &previousObjects, const ObjectIdSet ¤tObjects)
Determines the ids which were tracked in the previous iteration but not tracked in the current iterat...
static std::string translateTrackerType(const TrackerType trackerType)
Translates the tracker type to a readable string.
std::unordered_map< SubscriptionId, TrackerObjectCallback > TrackerObjectSubscriptionMap
Definition of a map mapping subscription ids to tracker object event callback functions.
Definition: devices/Tracker.h:218
void postFoundTrackerObjects(const ObjectIdSet &objectIds, const Timestamp ×tamp)
Posts a new found tracker objects event.
static TrackerType translateTrackerType(const std::string &trackerType)
Translates the tracker type from a readable string to a value.
void postLostTrackerObjects(const ObjectIdSet &objectIds, const Timestamp ×tamp)
Posts a new lost tracker objects event.
virtual Frequency frequency() const
Returns the frequency of this tracker.
TrackerObjectEventSubscription subscribeTrackerObjectEvent(TrackerObjectCallback &&callback)
Subscribes a callback event function for tracker object (found or lost) events.
static constexpr Frequency unknownFrequency()
Definition of a constant as unknown frequency.
Definition: devices/Tracker.h:354
static ObjectIdSet determineFoundObjects(const ObjectIdSet &previousObjects, const ObjectIdSet ¤tObjects)
Determines the ids which were not tracked in the previous iteration but tracked in the current iterat...
SmartObjectRef< TrackerSample, Sample > TrackerSampleRef
Definition of a smart object reference for tracker samples.
Definition: devices/Tracker.h:126
float Frequency
Definition of a tracker frequency in Hz.
Definition: devices/Tracker.h:82
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< Tracker > TrackerRef
Definition of a smart object reference for a tracker.
Definition: devices/Tracker.h:25
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15