8#ifndef META_OCEAN_DEVICES_TRACKER_H
9#define META_OCEAN_DEVICES_TRACKER_H
178 explicit inline operator bool()
const;
337 *
this = std::move(trackerObjectEventSubscription);
351inline Tracker::TrackerObjectEventSubscription::operator bool()
const
This class implements a container for callback functions.
Definition Callback.h:3454
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
DeviceType type() const
Returns the major and minor type of this device.
Definition devices/Device.h:345
@ MINOR_INVALID
Invalid minor type.
Definition devices/Device.h:55
static constexpr SubscriptionId invalidSubscriptionId()
Returns an invalid subscription id.
Definition devices/Device.h:355
const std::string & name() const
Returns the name of this device.
Definition devices/Device.h:340
Definition of a sample holding a measurement.
Definition Measurement.h:68
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
ObjectId objectId(const std::string &description) const
Returns the object id for an object description.
std::unordered_set< ObjectId > ObjectIdSet
Definition of an unordered set holding object ids.
Definition Measurement.h:57
uint32_t ObjectId
Definition of an object id.
Definition Measurement.h:47
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition Measurement.h:62
Measurement(const std::string &name, const DeviceType type)
Creates a new measurement object.
StackHeapVector< ObjectId, 1 > ObjectIds
Definition of a vector holding object ids.
Definition Measurement.h:52
This class implements a smart device reference.
Definition DeviceRef.h:36
This class manages the lifetime of an event subscription for tracker object events.
Definition devices/Tracker.h:143
friend class Tracker
Definition devices/Tracker.h:144
SubscriptionId subscriptionId_
The subscription id.
Definition devices/Tracker.h:212
TrackerObjectEventSubscription & operator=(const TrackerObjectEventSubscription &trackerObjectEventSubscription)=delete
Disabled assign operator.
Tracker * weakTracker_
The pointer to the tracker object to which the event subscription belongs.
Definition devices/Tracker.h:209
~TrackerObjectEventSubscription()
Destructs the subscription object and unsubscribes the object event.
Definition devices/Tracker.h:340
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:345
TrackerRef tracker_
The tracker to which the event subscription belongs.
Definition devices/Tracker.h:206
TrackerObjectEventSubscription & operator=(TrackerObjectEventSubscription &&trackerObjectEventSubscription)
Replaces the current event subscription with a new event subscription.
TrackerObjectEventSubscription(const Tracker &tracker, const SubscriptionId subscriptionId)
Creates an active subscription object.
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:330
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:122
This class implements the base class for all tracker devices.
Definition devices/Tracker.h:39
std::unordered_map< SubscriptionId, TrackerObjectCallback > TrackerObjectSubscriptionMap
Definition of a map mapping subscription ids to tracker object event callback functions.
Definition devices/Tracker.h:220
float Frequency
Definition of a tracker frequency in Hz.
Definition devices/Tracker.h:84
TrackerType
Definition of different minor device types.
Definition devices/Tracker.h:46
@ TRACKER_INVALID
Invalid tracker.
Definition devices/Tracker.h:48
@ TRACKER_GPS
GPS tracker.
Definition devices/Tracker.h:60
@ TRACKER_6DOF
6DOF orientation and position tracker.
Definition devices/Tracker.h:54
@ TRACKER_GRAVITY_3DOF
3DOF gravity tracker.
Definition devices/Tracker.h:58
@ TRACKER_VISUAL
Tracker using a visual input for their measurements.
Definition devices/Tracker.h:64
@ TRACKER_MAGNETIC
Tracker using a magnetic measurements.
Definition devices/Tracker.h:62
@ SCENE_TRACKER_6DOF
6DOF scene tracker.
Definition devices/Tracker.h:56
@ TRACKER_OBJECT
Tracker allowing to register tracking objects at runtime.
Definition devices/Tracker.h:66
@ TRACKER_POSITION_3DOF
3DOF position tracker.
Definition devices/Tracker.h:52
@ TRACKER_ORIENTATION_3DOF
3DOF orientation tracker.
Definition devices/Tracker.h:50
~Tracker() override
Destructs a tracker object.
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:324
SmartObjectRef< TrackerSample, Sample > TrackerSampleRef
Definition of a smart object reference for tracker samples.
Definition devices/Tracker.h:128
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:137
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:74
@ RS_DEVICE_IN_OBJECT
Returning tracking values are given in the coordinate system of the object.
Definition devices/Tracker.h:78
@ RS_OBJECT_IN_DEVICE
Returning tracking values are given in the coordinate system of the device.
Definition devices/Tracker.h:76
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.
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:356
SubscriptionId nextTrackerObjectSubscriptionId_
The subscription id of the next event subscription.
Definition devices/Tracker.h:327
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...
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< Tracker > TrackerRef
Definition of a smart object reference for a tracker.
Definition devices/Tracker.h:32
HomogenousMatrixT4< double > HomogenousMatrixD4
Instantiation of the HomogenousMatrixT4 template class using a double precision float data type.
Definition HomogenousMatrix4.h:51
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15