Ocean
Loading...
Searching...
No Matches
Ocean::Devices::ARKit::AKFaceTracker6DOF Class Reference

This class implements the 6DOF face tracker providing only the head pose. More...

#include <AKFaceTracker6DOF.h>

Inheritance diagram for Ocean::Devices::ARKit::AKFaceTracker6DOF:

Public Member Functions

bool start () override
 Starts the device.
 
bool pause () override
 Pauses the device.
 
bool stop () override
 Stops the device.
 
void setInput (Media::FrameMediumRefs &&frameMediums) override
 Sets the multi-view visual input of this tracker.
 
bool isObjectTracked (const ObjectId &objectId) const override
 Returns whether a specific object is currently actively tracked by this tracker.
 
 API_AVAILABLE (ios(13.0)) void onNewSample(const HomogenousMatrix4 &world_T_camera
 Event function for a new 6DOF pose.
 
- Public Member Functions inherited from Ocean::Devices::ARKit::AKDevice
const std::string & library () const override
 Returns the name of the owner library.
 
TrackerCapabilities trackerCapabilities () const
 Returns the capabilities of the tracker necessary for this device.
 
virtual void onAddedAnchors (const ARAnchors &anchors)
 Event function for added anchors.
 
virtual void onUpdateAnchors (const ARAnchors &anchors)
 Event function for updated anchors.
 
virtual void onRemovedAnchors (const ARAnchors &anchors)
 Event function for removed anchors.
 
bool setParameter (const std::string &parameter, const Value &value) override
 Sets a parameter for this tracker.
 
bool parameter (const std::string &parameter, Value &value) override
 Returns a parameter of this device.
 
- Public Member Functions inherited from Ocean::Devices::Device
const std::string & name () const
 Returns the name of this device.
 
virtual bool isStarted () const
 Returns whether this device is active.
 
bool isValid () const
 Returns whether this device is valid.
 
bool isExclusive () const
 Returns whether this device can be use exclusively.
 
DeviceType type () const
 Returns the major and minor type of this device.
 
- Public Member Functions inherited from Ocean::Devices::Tracker
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.
 
virtual HomogenousMatrixD4 reference () const
 Returns the reference coordinate system of this tracker.
 
- Public Member Functions inherited from Ocean::Devices::Measurement
size_t sampleCapacity () const
 Returns the capacity of the internal sample container.
 
bool setSampleCapacity (const size_t capacity)
 Sets the capacity of the internal sample container.
 
virtual SampleRef sample () const
 Returns the most recent sample.
 
virtual SampleRef sample (const Timestamp timestamp) const
 Returns the sample with a specific timestamp.
 
virtual SampleRef sample (const Timestamp &timestamp, const InterpolationStrategy interpolationStrategy) const
 Returns the sample best matching with a specified timestamp.
 
SampleEventSubscription subscribeSampleEvent (SampleCallback &&callback)
 Subscribes a callback event function for new measurement sample events.
 
ObjectId objectId (const std::string &description) const
 Returns the object id for an object description.
 
Strings objectDescriptions () const
 Returns descriptions of all objects currently available.
 
std::string objectDescription (const ObjectId objectId) const
 Returns the description of one object of this measurement.
 
- Public Member Functions inherited from Ocean::Devices::VisualTracker
Media::FrameMediumRefs input () const
 Returns the medium objects of this tracker used as visual input.
 
void setInput (const Media::FrameMediumRef &frameMedium)
 Sets the mono visual input of this tracker.
 

Static Public Member Functions

static std::string deviceNameAKFaceTracker6DOF ()
 Returns the name of this tracker.
 
static DeviceType deviceTypeAKFaceTracker6DOF ()
 Returns the device type of this tracker.
 
- Static Public Member Functions inherited from Ocean::Devices::ARKit::AKDevice
static std::string translateTrackingState (const ARTrackingState &state)
 Translates the value of an ARTrackingState to a readable string.
 
- Static Public Member Functions inherited from Ocean::Devices::Device
static std::string translateMajorType (const MajorType majorType)
 Translates the major devices type to a readable string.
 
static MajorType translateMajorType (const std::string &majorType)
 Translates the major devices type from a readable string to a value.
 
- Static Public Member Functions inherited from Ocean::Devices::Tracker6DOF
static DeviceType deviceTypeTracker6DOF ()
 Definition of this device type.
 
- Static Public Member Functions inherited from Ocean::Devices::OrientationTracker3DOF
static DeviceType deviceTypeOrientationTracker3DOF ()
 Return the device type of this tracker.
 
- Static Public Member Functions inherited from Ocean::Devices::Tracker
static std::string translateTrackerType (const TrackerType trackerType)
 Translates the tracker type to a readable string.
 
static TrackerType translateTrackerType (const std::string &trackerType)
 Translates the tracker type from a readable string to a value.
 
static constexpr Frequency unknownFrequency ()
 Definition of a constant as unknown frequency.
 
- Static Public Member Functions inherited from Ocean::Devices::Measurement
static constexpr ObjectId invalidObjectId ()
 Returns an invalid object id.
 
- Static Public Member Functions inherited from Ocean::Devices::PositionTracker3DOF
static DeviceType deviceTypePositionTracker3DOF ()
 Returns the device type of this tracker.
 

Data Fields

const Timestamptimestamp
 
const Timestamp ARFrame * arFrame
 

Protected Member Functions

 AKFaceTracker6DOF ()
 Creates a new 6DOF face tracker.
 
 ~AKFaceTracker6DOF () override
 Destructs this 6DOF tracker.
 
- Protected Member Functions inherited from Ocean::Devices::ARKit::AKDevice
 AKDevice (const TrackerCapabilities trackerCapabilities, const std::string &name, const DeviceType type)
 Translates the value of an ARGeoTrackingState to a readable string.
 
- Protected Member Functions inherited from Ocean::Devices::Device
 Device (const Device &device)=delete
 Disabled copy constructor.
 
 Device (const std::string &name, const DeviceType type)
 Creates a new device by is name.
 
virtual ~Device ()
 Destructs a device.
 
Deviceoperator= (const Device &device)=delete
 Disabled copy operator.
 
- Protected Member Functions inherited from Ocean::Devices::Tracker6DOF
 Tracker6DOF (const std::string &name)
 Creates a new 6DOF tracker object.
 
 ~Tracker6DOF () override
 Destructs a 6DOF tracker object.
 
- Protected Member Functions inherited from Ocean::Devices::OrientationTracker3DOF
 OrientationTracker3DOF (const std::string &name)
 Creates a new 3DOF orientation tracker object.
 
 ~OrientationTracker3DOF () override
 Destructs a 3DOF orientation tracker.
 
- Protected Member Functions inherited from Ocean::Devices::Tracker
 Tracker (const std::string &name, const DeviceType type)
 Creates a new tracker object.
 
 ~Tracker () override
 Destructs a tracker object.
 
void postFoundTrackerObjects (const ObjectIdSet &objectIds, const Timestamp &timestamp)
 Posts a new found tracker objects event.
 
void postLostTrackerObjects (const ObjectIdSet &objectIds, const Timestamp &timestamp)
 Posts a new lost tracker objects event.
 
void unsubscribeTrackerObjectEvent (const SubscriptionId subscriptionId)
 Unsubscribes a tracker object event callback function.
 
- Protected Member Functions inherited from Ocean::Devices::Measurement
 Measurement (const std::string &name, const DeviceType type)
 Creates a new measurement object.
 
 ~Measurement () override
 Destructs a measurement object.
 
void postNewSample (const SampleRef &newSample)
 Posts a new measurement sample.
 
ObjectId addUniqueObjectId (const std::string &description)
 Creates a unique object id for a new object (e.g., a tracking object like an image, a marker, or a location).
 
void unsubscribeSampleEvent (const SubscriptionId subscriptionId)
 Unsubscribes a sample event callback function.
 
- Protected Member Functions inherited from Ocean::Devices::PositionTracker3DOF
 PositionTracker3DOF (const std::string &name)
 Creates a new 3DOF position tracker object.
 
 ~PositionTracker3DOF () override
 Destructs a 3DOF position tracker object.
 
- Protected Member Functions inherited from Ocean::Devices::VisualTracker
 VisualTracker (const std::string &name, const DeviceType type)
 Creates a new visual tracker object.
 
 ~VisualTracker () override
 Destructs a visual tracker object.
 

Protected Attributes

ObjectId faceObjectId_ = invalidObjectId()
 The unique id for the face object.
 
bool isStarted_ = false
 True, if the tracker has been started.
 
bool faceIsTracked_ = false
 True, if the face object is currently tracked.
 
- Protected Attributes inherited from Ocean::Devices::ARKit::AKDevice
TrackerCapabilities trackerCapabilities_ = TC_INVALID
 The capabilities of the tracker for this device.
 
ParameterMap parameterMap_
 The map with optional parameters.
 
- Protected Attributes inherited from Ocean::Devices::Device
std::string deviceName
 Name of this device.
 
DeviceType deviceType
 Major and minor type of this device.
 
bool deviceIsValid
 Flag determining whether this device is valid.
 
Lock deviceLock
 Device lock.
 
- Protected Attributes inherited from Ocean::Devices::Tracker
TrackerObjectSubscriptionMap trackerObjectSubscriptionMap_
 Map holding all tracker object event subscriptions.
 
SubscriptionId nextTrackerObjectSubscriptionId_ = SubscriptionId(invalidSubscriptionId() + 1u)
 The subscription id of the next event subscription.
 
- Protected Attributes inherited from Ocean::Devices::Measurement
Lock samplesLock_
 Sample lock.
 
Lock subscriptionLock_
 Subscription lock.
 
- Protected Attributes inherited from Ocean::Devices::VisualTracker
Media::FrameMediumRefs frameMediums_
 Visual input media objects.
 

Friends

class AKFactory
 

Additional Inherited Members

- Public Types inherited from Ocean::Devices::ARKit::AKDevice
enum  TrackerCapabilities : uint32_t {
  TC_INVALID = 0u , TC_SLAM = 1u << 0u , TC_GEO_ANCHORS = 1u << 1u , TC_PLANE_DETECTION = 1u << 2u ,
  TC_MESH_RECONSTRUCTION = 1u << 3u , TC_DEPTH = 1u << 4u , TC_FACE = 1u << 5u
}
 Definition of individual capabilities. More...
 
using ARAnchors = std::vector< ARAnchor * >
 Definition of a vector holding ARAnchors.
 
using DeviceMap = std::unordered_map< AKDevice *, unsigned int >
 Definition of an unordered map mapping devices to usage counters.
 
- Public Types inherited from Ocean::Devices::Device
enum  MajorType : uint32_t { DEVICE_INVALID = 0u , DEVICE_MEASUREMENT = (1u << 0u) , DEVICE_SENSOR = (1u << 1u) | DEVICE_MEASUREMENT , DEVICE_TRACKER = (1u << 2u) | DEVICE_MEASUREMENT }
 Definition of all major device types. More...
 
enum  MinorType : uint32_t { MINOR_INVALID = 0u }
 Base definition of a minor type. More...
 
- Public Types inherited from Ocean::Devices::Tracker6DOF
typedef SmartObjectRef< Tracker6DOFSample, SampleTracker6DOFSampleRef
 Definition of a smart object reference for 6DOF tracker samples.
 
- Public Types inherited from Ocean::Devices::OrientationTracker3DOF
typedef SmartObjectRef< OrientationTracker3DOFSample, SampleOrientationTracker3DOFSampleRef
 Definition of a smart object reference for 3DOF orientation tracker samples.
 
- Public Types inherited from Ocean::Devices::Tracker
enum  TrackerType : uint32_t {
  TRACKER_INVALID = MINOR_INVALID , TRACKER_ORIENTATION_3DOF = (1u << 0u) , TRACKER_POSITION_3DOF = (1u << 1u) , TRACKER_6DOF = TRACKER_ORIENTATION_3DOF | TRACKER_POSITION_3DOF ,
  SCENE_TRACKER_6DOF = (1u << 2u) | TRACKER_6DOF , TRACKER_GPS = (1u << 3u) , TRACKER_MAGNETIC = (1u << 4u) , TRACKER_VISUAL = (1u << 5u) ,
  TRACKER_OBJECT = (1u << 6u)
}
 Definition of different minor device types. More...
 
enum  ReferenceSystem { RS_OBJECT_IN_DEVICE , RS_DEVICE_IN_OBJECT }
 Definition of different tracking reference system. More...
 
typedef float Frequency
 Definition of a tracker frequency in Hz.
 
typedef SmartObjectRef< TrackerSample, SampleTrackerSampleRef
 Definition of a smart object reference for tracker samples.
 
typedef Callback< void, const Tracker *, const bool, const ObjectIdSet &, const Timestamp & > TrackerObjectCallback
 Definition of a callback function to subscribe for lost and found tracker events.
 
- Public Types inherited from Ocean::Devices::Measurement
enum  InterpolationStrategy { IS_INVALID , IS_TIMESTAMP_NEAREST , IS_TIMESTAMP_INTERPOLATE }
 Definition of individual interpolation strategies for samples. More...
 
typedef unsigned int ObjectId
 Definition of an object id.
 
typedef std::vector< ObjectIdObjectIds
 Definition of a vector holding object ids.
 
typedef std::unordered_set< ObjectIdObjectIdSet
 Definition of an unordered set holding object ids.
 
typedef std::unordered_map< std::string, ValueMetadata
 Definition of an unordered map mapping keys to values.
 
typedef ObjectRef< SampleSampleRef
 Definition of an object reference for samples.
 
typedef Callback< void, const Measurement *, const SampleRef & > SampleCallback
 Definition of a callback function to subscribe for new measurement sample events.
 
- Public Types inherited from Ocean::Devices::PositionTracker3DOF
typedef SmartObjectRef< PositionTracker3DOFSample, SamplePositionTracker3DOFSampleRef
 Definition of a smart object reference for 3DOF position tracker samples.
 
- Protected Types inherited from Ocean::Devices::ARKit::AKDevice
using ParameterMap = std::unordered_map< std::string, Value >
 Definition of an unordered map mapping names to values.
 
- Protected Types inherited from Ocean::Devices::Device
typedef unsigned int SubscriptionId
 Definition of a subscription id for event callbacks.
 
- Protected Types inherited from Ocean::Devices::Tracker
typedef std::unordered_map< SubscriptionId, TrackerObjectCallbackTrackerObjectSubscriptionMap
 Definition of a map mapping subscription ids to tracker object event callback functions.
 
- Protected Types inherited from Ocean::Devices::Measurement
typedef std::map< Timestamp, SampleRefSampleMap
 Definition of a map holding the most recent samples.
 
typedef std::unordered_map< std::string, ObjectIdObjectDescriptionToIdMap
 Definition of an unordered map mapping descriptions to unique object ids.
 
typedef std::unordered_map< ObjectId, std::string > ObjectIdToDescriptionMap
 Definition of an unordered map mapping unique object ids to descriptions.
 
typedef std::unordered_map< SubscriptionId, SampleCallbackSampleSubscriptionMap
 Definition of a map mapping subscription ids to event sample callback functions.
 
- Static Protected Member Functions inherited from Ocean::Devices::Device
static constexpr SubscriptionId invalidSubscriptionId ()
 Returns an invalid subscription id.
 
- Static Protected Member Functions inherited from Ocean::Devices::Tracker
static ObjectIdSet determineFoundObjects (const ObjectIdSet &previousObjects, const ObjectIdSet &currentObjects)
 Determines the ids which were not tracked in the previous iteration but tracked in the current iteration.
 
static ObjectIdSet determineLostObjects (const ObjectIdSet &previousObjects, const ObjectIdSet &currentObjects)
 Determines the ids which were tracked in the previous iteration but not tracked in the current iteration.
 

Detailed Description

This class implements the 6DOF face tracker providing only the head pose.

ARKit's face tracker can combine SLAM/World tracker. Face tracking is always executed on the user-facing camera while the back-facing camera is used for SLAM/World tracking.
Therefore, the input medium should always be the back-facing camera instead of the user-facing camera.

Constructor & Destructor Documentation

◆ AKFaceTracker6DOF()

Ocean::Devices::ARKit::AKFaceTracker6DOF::AKFaceTracker6DOF ( )
explicitprotected

Creates a new 6DOF face tracker.

◆ ~AKFaceTracker6DOF()

Ocean::Devices::ARKit::AKFaceTracker6DOF::~AKFaceTracker6DOF ( )
overrideprotected

Destructs this 6DOF tracker.

Member Function Documentation

◆ API_AVAILABLE()

Ocean::Devices::ARKit::AKFaceTracker6DOF::API_AVAILABLE ( ios(13.0)  ) const &

Event function for a new 6DOF pose.

Parameters
world_T_cameraThe transformation between camera and world, invalid if unknown/lost
timestampThe timestamp of the new transformation
arFrameThe current ARFRame object containing additional data for the sample, must be valid

◆ deviceNameAKFaceTracker6DOF()

std::string Ocean::Devices::ARKit::AKFaceTracker6DOF::deviceNameAKFaceTracker6DOF ( )
inlinestatic

Returns the name of this tracker.

Returns
The trackers's name

◆ deviceTypeAKFaceTracker6DOF()

AKFaceTracker6DOF::DeviceType Ocean::Devices::ARKit::AKFaceTracker6DOF::deviceTypeAKFaceTracker6DOF ( )
inlinestatic

Returns the device type of this tracker.

Returns
The tracker's device type

◆ isObjectTracked()

bool Ocean::Devices::ARKit::AKFaceTracker6DOF::isObjectTracked ( const ObjectId objectId) const
overridevirtual

Returns whether a specific object is currently actively tracked by this tracker.

See also
Tracker::isObjectTracked().

Reimplemented from Ocean::Devices::Tracker.

◆ pause()

bool Ocean::Devices::ARKit::AKFaceTracker6DOF::pause ( )
overridevirtual

Pauses the device.

See also
Device::pause().

Reimplemented from Ocean::Devices::Device.

◆ setInput()

void Ocean::Devices::ARKit::AKFaceTracker6DOF::setInput ( Media::FrameMediumRefs &&  frameMediums)
overridevirtual

Sets the multi-view visual input of this tracker.

See also
VisualTracker::setInput().

Reimplemented from Ocean::Devices::VisualTracker.

◆ start()

bool Ocean::Devices::ARKit::AKFaceTracker6DOF::start ( )
overridevirtual

Starts the device.

See also
Device::start().

Reimplemented from Ocean::Devices::Device.

◆ stop()

bool Ocean::Devices::ARKit::AKFaceTracker6DOF::stop ( )
overridevirtual

Stops the device.

See also
Device::stop().

Reimplemented from Ocean::Devices::Device.

Friends And Related Symbol Documentation

◆ AKFactory

friend class AKFactory
friend

Field Documentation

◆ arFrame

const Timestamp ARFrame* Ocean::Devices::ARKit::AKFaceTracker6DOF::arFrame

◆ faceIsTracked_

bool Ocean::Devices::ARKit::AKFaceTracker6DOF::faceIsTracked_ = false
protected

True, if the face object is currently tracked.

◆ faceObjectId_

ObjectId Ocean::Devices::ARKit::AKFaceTracker6DOF::faceObjectId_ = invalidObjectId()
protected

The unique id for the face object.

◆ isStarted_

bool Ocean::Devices::ARKit::AKFaceTracker6DOF::isStarted_ = false
protected

True, if the tracker has been started.

◆ timestamp

const Timestamp& Ocean::Devices::ARKit::AKFaceTracker6DOF::timestamp

The documentation for this class was generated from the following file: