Ocean
Loading...
Searching...
No Matches
AKDepthTracker6DOF.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_ARKIT_AK_DEPTH_TRACKER_6_DOF_H
9#define META_OCEAN_DEVICES_ARKIT_AK_DEPTH_TRACKER_6_DOF_H
10
13
16
17namespace Ocean
18{
19
20namespace Devices
21{
22
23namespace ARKit
24{
25
26/**
27 * This class implements the 6DOF tracker also delivering depth images.
28 * @ingroup devicesarkit
29 */
30class OCEAN_DEVICES_ARKIT_EXPORT AKDepthTracker6DOF :
31 virtual public AKDevice,
32 virtual public SceneTracker6DOF,
33 virtual public VisualTracker
34{
35 friend class AKFactory;
36
37 public:
38
39 /**
40 * Starts the device.
41 * @see Device::start().
42 */
43 bool start() override;
44
45 /**
46 * Pauses the device.
47 * @see Device::pause().
48 */
49 bool pause() override;
50
51 /**
52 * Stops the device.
53 * @see Device::stop().
54 */
55 bool stop() override;
56
57 /**
58 * Sets the multi-view visual input of this tracker.
59 * @see VisualTracker::setInput().
60 */
61 void setInput(Media::FrameMediumRefs&& frameMediums) override;
62
63 /**
64 * Returns whether a specific object is currently actively tracked by this tracker.
65 * @see Tracker::isObjectTracked().
66 */
67 bool isObjectTracked(const ObjectId& objectId) const override;
68
69 /**
70 * Event function for a new 6DOF pose.
71 * @param world_T_camera The transformation between camera and world, invalid if unknown/lost
72 * @param timestamp The timestamp of the new transformation
73 * @param camera The camera profile defining the projection of the depth information, can have a different resolution, must be valid
74 * @param device_T_depth The transformation between depth image and device, must be valid
75 * @param arFrame The current ARFRame object containing additional data for the sample, must be valid
76 */
77 API_AVAILABLE(ios(14.0))
78 void onNewSample(const HomogenousMatrix4& world_T_camera, const Timestamp& timestamp, const SharedAnyCamera& camera, const HomogenousMatrix4& device_T_depth, ARFrame* arFrame);
79
80 /**
81 * Returns the name of this tracker.
82 * @return The trackers's name
83 */
84 static inline std::string deviceNameAKDepthTracker6DOF();
85
86 /**
87 * Returns the device type of this tracker.
88 * @return The tracker's device type
89 */
91
92 protected:
93
94 /**
95 * Creates a new 6DOF depth tracker.
96 */
98
99 /**
100 * Destructs this 6DOF tracker.
101 */
103
104 protected:
105
106 /// The unique id for the world object.
108
109 /// True, if the tracker has been started.
110 bool isStarted_ = false;
111
112 /// True, if the world object is currently tracked.
113 bool worldIsTracked_ = false;
114};
115
117{
118 return std::string("ARKit 6DOF Depth Tracker");
119}
120
125
126}
127
128}
129
130}
131
132#endif // META_OCEAN_DEVICES_ARKIT_AK_DEPTH_TRACKER_6_DOF_H
static DeviceType deviceTypeAKDepthTracker6DOF()
Returns the device type of this tracker.
Definition AKDepthTracker6DOF.h:121
const Timestamp const SharedAnyCamera const HomogenousMatrix4 & device_T_depth
Definition AKDepthTracker6DOF.h:78
API_AVAILABLE(ios(14.0)) void onNewSample(const HomogenousMatrix4 &world_T_camera
Event function for a new 6DOF pose.
bool worldIsTracked_
True, if the world object is currently tracked.
Definition AKDepthTracker6DOF.h:113
const Timestamp const SharedAnyCamera const HomogenousMatrix4 ARFrame * arFrame
Definition AKDepthTracker6DOF.h:78
void setInput(Media::FrameMediumRefs &&frameMediums) override
Sets the multi-view visual input of this tracker.
AKDepthTracker6DOF()
Creates a new 6DOF depth tracker.
bool stop() override
Stops the device.
static std::string deviceNameAKDepthTracker6DOF()
Returns the name of this tracker.
Definition AKDepthTracker6DOF.h:116
const Timestamp const SharedAnyCamera & camera
Definition AKDepthTracker6DOF.h:78
bool start() override
Starts the device.
bool pause() override
Pauses the device.
ObjectId worldObjectId_
The unique id for the world object.
Definition AKDepthTracker6DOF.h:107
const Timestamp & timestamp
Definition AKDepthTracker6DOF.h:78
bool isStarted_
True, if the tracker has been started.
Definition AKDepthTracker6DOF.h:110
bool isObjectTracked(const ObjectId &objectId) const override
Returns whether a specific object is currently actively tracked by this tracker.
friend class AKFactory
Definition AKDepthTracker6DOF.h:35
AKDevice(const TrackerCapabilities trackerCapabilities, const std::string &name, const DeviceType type)
Translates the value of an ARGeoTrackingState to a readable string.
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
ObjectId objectId(const std::string &description) const
Returns the object id for an object description.
static constexpr ObjectId invalidObjectId()
Returns an invalid object id.
Definition Measurement.h:631
uint32_t ObjectId
Definition of an object id.
Definition Measurement.h:47
SceneTracker6DOF(const std::string &name)
Creates a new 6-DOF scene tracker object.
static DeviceType deviceTypeTracker6DOF()
Definition of this device type.
Definition Tracker6DOF.h:106
@ TRACKER_VISUAL
Tracker using a visual input for their measurements.
Definition devices/Tracker.h:64
@ SCENE_TRACKER_6DOF
6DOF scene tracker.
Definition devices/Tracker.h:56
VisualTracker(const std::string &name, const DeviceType type)
Creates a new visual tracker object.
This class implements a timestamp.
Definition Timestamp.h:64
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition HomogenousMatrix4.h:44
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition AnyCamera.h:61
std::vector< FrameMediumRef > FrameMediumRefs
Definition of a vector holding frame medium reference objects.
Definition FrameMedium.h:46
Namespace of the Devices ARKit library.
Definition AKDepthTracker6DOF.h:24
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15