Ocean
SceneTracker6DOF.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_SCENE_TRACKER_6DOF_H
9 #define META_OCEAN_DEVICES_SCENE_TRACKER_6DOF_H
10 
11 #include "ocean/devices/Devices.h"
13 
14 #include "ocean/base/Frame.h"
15 
16 #include "ocean/math/AnyCamera.h"
17 #include "ocean/math/Box3.h"
18 #include "ocean/math/Plane3.h"
19 
20 namespace Ocean
21 {
22 
23 namespace Devices
24 {
25 
26 // Forward declaration.
27 class SceneTracker6DOF;
28 
29 /**
30  * Definition of a smart object reference for a 6-DOF scene tracker.
31  * @see SceneTracker6DOF.
32  * @ingroup devices
33  */
35 
36 /**
37  * This class implements the base for all 6-DOF scene trackers.
38  * Scene trackers provides 6-DOF transformations in combination with scene elements like point clouds, meshes, planes, or other content from the environment.
39  * @ingroup devices
40  */
41 class OCEAN_DEVICES_EXPORT SceneTracker6DOF : virtual public Tracker6DOF
42 {
43  public:
44 
45  /**
46  * This class implements the base class of all scene elements.
47  */
49  {
50  public:
51 
52  /**
53  * Definition of individual types of scene elements.
54  */
55  enum SceneElementType : uint32_t
56  {
57  /// The scene element is invalid.
58  SET_INVALID = 0u,
59  /// The scene element contains 3D object points.
61  /// The scene element contains 2D/3D correspondences.
63  /// The scene element contains 3D planes.
65  /// The scene element contains 3D meshes.
67  /// The scene element contains depth information.
69  /// The scene element contains room objects.
70  SET_ROOM
71  };
72 
73  public:
74 
75  /**
76  * Destructs a scene element.
77  */
78  virtual ~SceneElement() = default;
79 
80  /**
81  * Returns the type of this scene element.
82  * @return The scene element type
83  */
84  inline SceneElementType sceneElementType() const;
85 
86  protected:
87 
88  /**
89  * Creates a default scene element with specified type.
90  * @param sceneElementType The type of the new scene element
91  */
92  explicit inline SceneElement(const SceneElementType sceneElementType);
93 
94  protected:
95 
96  /// The type of the scene element.
97  SceneElementType sceneElementType_ = SET_INVALID;
98  };
99 
100  /**
101  * Definition of a scene element holding 3D object points.
102  * Each 3D object point may be associated with a corresponding object point id.
103  */
105  {
106  public:
107 
108  /**
109  * Creates a new SceneElement object for 3D object points.
110  * @param objectPoints The 3D object points, at least one
111  * @param objectPointIds Optional ids of the object points, one for each 3D object point, empty if unknown
112  */
113  inline SceneElementObjectPoints(Vectors3&& objectPoints, Indices64&& objectPointIds = Indices64());
114 
115  /**
116  * Returns the 3D object points of this scene element.
117  * @return The scene element's object points
118  */
119  inline const Vectors3& objectPoints() const;
120 
121  /**
122  * Returns the unique ids of the object points if known.
123  * @return The object point ids, empty if unknown
124  */
125  inline const Indices64& objectPointIds() const;
126 
127  protected:
128 
129  /// The 3D object points of this scene element.
131 
132  /// The unique ids of this scene element.
134  };
135 
136  /**
137  * This class implements a scene element holding 2D/3D feature correspondences.
138  */
140  {
141  public:
142 
143  /**
144  * Creates a new scene element for 2D/3D correspondences.
145  * @param objectPoints The 3D object points of the correspondences, at least one
146  * @param imagePoints The 2D image points of the correspondences, one for each 3D object point
147  * @param objectPointIds The optional ids of the object points, one for each 3D obect point, or empty if unknown
148  */
149  inline SceneElementFeatureCorrespondences(Vectors3&& objectPoints, Vectors2&& imagePoints, Indices64&& objectPointIds = Indices64());
150 
151  /**
152  * Returns the 3D object points of this scene element.
153  * @return The scene element's 3D object points
154  */
155  inline const Vectors3& objectPoints() const;
156 
157  /**
158  * Returns the 2D image points of this scene element.
159  * @return The scene element's image points, one for each 3D object point
160  */
161  inline const Vectors2& imagePoints() const;
162 
163  /**
164  * Returns the unique object point ids.
165  * @return The object point ids, empty if unknown
166  */
167  inline const Indices64& objectPointIds() const;
168 
169  protected:
170 
171  /// The 3D object points of this scene element.
173 
174  /// The 2D image points of this scene element, one for each 3D object point.
176 
177  /// The unique ids of the 3D object points, if known.
179  };
180 
181  /**
182  * This class implements a scene element holding 3D planes.
183  */
185  {
186  public:
187 
188  /**
189  * This class stores the relevant information of a 3D plane.
190  * Most properties of the class (e.g., vertices, bounding box) are defined in relation to the plane's coordinate system.<br>
191  * The plane's normal is identical to the y-axis of the plane's coordinate system.
192  */
193  class Plane
194  {
195  public:
196 
197  /**
198  * Definition of individual plane types.
199  */
200  enum PlaneType : uint32_t
201  {
202  /// The plane type is unknown.
203  PT_UNKNOWN = 0u,
204  /// The plane is horizontal and perpendicular to gravity (e.g., a floor/ceiling plane).
206  /// The plane is vertical and parallel to gravity (e.g., a wall plane).
207  PT_VERTICAL
208  };
209 
210  public:
211 
212  /**
213  * Creates a new plane object.
214  * @param planeId The plane's unique id, must be valid
215  * @param planeType The type of the plane
216  * @param world_T_plane The transformation between plane and world, with y-axis identical to the plane's normal, must be valid
217  * @param boundingBox The bounding box of the plane, defined in the plane's coordinate system, must be valid
218  * @param boundaryVertices The vertices of the boundary of the plane, defined in the plane's coordinate system
219  */
220  inline Plane(const Index32 planeId, const PlaneType planeType, const HomogenousMatrix4& world_T_plane, const Box3& boundingBox, Vectors3&& boundaryVertices);
221 
222  /**
223  * Creates a new plane object.
224  * @param planeId The plane's unique id, must be valid
225  * @param planeType The type of the plane
226  * @param world_T_plane The transformation between plane and world, with y-axis identical to the plane's normal, must be valid
227  * @param boundingBox The bounding box of the plane, defined in the plane's coordinate system, must be valid
228  * @param vertices The plane's vertices, defined in the plane's coordinate system, at least 3
229  * @param textureCoordinates The vertices' texture coordinates, one for each vertex, empty if unknown
230  * @param triangleIndices The indices of the vertices representing the plane's surface triangles, three indices define one triangle, always a multiple of three
231  * @param boundaryVertices The vertices of the boundary of the plane, defined in the plane's coordinate system
232  */
233  inline Plane(const Index32 planeId, const PlaneType planeType, const HomogenousMatrix4& world_T_plane, const Box3& boundingBox, Vectors3&& vertices, Vectors2&& textureCoordinates, Indices32&& triangleIndices, Vectors3&& boundaryVertices);
234 
235  /**
236  * Returns the unique id of the plane.
237  * @return The plane's unique id
238  */
239  inline Index32 planeId() const;
240 
241  /**
242  * Returns the type of the plane.
243  * @return The plane's type
244  */
245  inline PlaneType planeType() const;
246 
247  /**
248  * Returns the transformation of the plane in relation to world.
249  * The plane's normal is identical to the y-axis of the plane's coordinate system.
250  * @return The transformation between plane and world
251  */
252  inline const HomogenousMatrix4& world_T_plane() const;
253 
254  /**
255  * Returns the 3D plane as defined in world.
256  * @return The plane object which can be used e.g. for advanced math calculations, defined in world
257  */
258  inline Plane3 worldPlane() const;
259 
260  /**
261  * Returns the plane's bounding box (the extent of the plane).
262  * @return The bounding box of the plane, defined in the plane's coordinate system
263  */
264  inline const Box3& boundingBox() const;
265 
266  /**
267  * Returns the vertices representing the plane.
268  * @return The plane's vertices, defined in the plane's coordinate system, empty if unknown
269  */
270  inline const Vectors3& vertices() const;
271 
272  /**
273  * Returns the texture coordinates of the vertices, if known.
274  * @return The vertices' texture coordinates, one for each vertex, empty if unknown
275  */
276  inline const Vectors2& textureCoordinates() const;
277 
278  /**
279  * Returns the indices of the vertices representing the plane's surface triangles, three indices define one triangle, always a multiple of three.
280  * @return The indices of the plane's triangles, empty if unknown
281  */
282  inline const Indices32& triangleIndices() const;
283 
284  /**
285  * Returns the vertices of the boundary of the plane.
286  * @return The plane's boundary vertices, defined in the plane's coordinate system
287  */
288  inline const Vectors3& boundaryVertices() const;
289 
290  protected:
291 
292  /// The unique id of this plane.
293  Index32 planeId_ = Index32(-1);
294 
295  /// The type of the plane.
296  PlaneType planeType_ = PT_UNKNOWN;
297 
298  /// The transformation between plane and world, with y-axis as the plane's normal.
299  HomogenousMatrix4 world_T_plane_ = HomogenousMatrix4(false);
300 
301  /// The bounding box of the plane, defined in the plane's origin.
303 
304  /// The vertices representing the plane, defined in the plane's coordinate system.
306 
307  /// The vertices' texture coordinates, one for each vertex, empty if unknown.
309 
310  /// The indices of the vertices representing the plane's surface triangles, three indices define one triangle, always a multiple of three.
312 
313  /// The vertices of the boundaries of the plane, defined in the plane's coordinate system.
315  };
316 
317  /**
318  * Definition of a vector holding planes.
319  */
320  typedef std::vector<Plane> Planes;
321 
322  public:
323 
324  /**
325  * Creates a new scene element object with several given planes.
326  * @param planes The planes of the new scene element, at least one
327  */
328  explicit inline SceneElementPlanes(Planes&& planes);
329 
330  /**
331  * Returns all planes of this scene element object, may be empty.
332  * @return The scene element's planes
333  */
334  inline const Planes& planes() const;
335 
336  protected:
337 
338  /// The planes stores in this scene element object.
340  };
341 
342  /**
343  * This class implements a scene element holding 3D meshes.
344  */
346  {
347  public:
348 
349  /**
350  * This class stores the relevant information of a 3D mesh.
351  * Most properties of the class (e.g., vertices, bounding box) are defined in relation to the mesh's coordinate system.<br>
352  */
353  class Mesh
354  {
355  public:
356 
357  /**
358  * Definition of individual mesh types.
359  */
360  enum MeshType : uint32_t
361  {
362  /// The mesh type is unknown.
363  MT_UNKNOWN = 0u,
364  /// The mesh is representing a ceiling.
366  /// The mesh is representing a door.
368  /// The mesh is representing a floor.
370  /// The mesh is representing a seat.
372  /// The mesh is representing a table.
374  /// The mesh is representing a wall.
376  /// The mesh is representing a window.
377  MT_WINDOW
378  };
379 
380  public:
381 
382  /**
383  * Creates a new mesh object.
384  * @param meshId The mesh's unique id, must be valid
385  * @param world_T_mesh The transformation between mesh and world, must be valid
386  * @param vertices The mesh's vertices, defined in the mesh's coordinate system, at least 3
387  * @param perVertexNormals The per-vertex normals of the mesh's faces, defined in the mesh's coordinate system, one for each vertex
388  * @param triangleIndices The indices of the vertices representing the mesh's surface triangles, three indices define one triangle, always a multiple of three
389  */
390  inline Mesh(const Index32 meshId, const HomogenousMatrix4& world_T_mesh, Vectors3&& vertices, Vectors3&& perVertexNormals, Indices32&& triangleIndices);
391 
392  /**
393  * Returns the unique id of the mesh.
394  * @return The mesh's unique id
395  */
396  inline Index32 meshId() const;
397 
398  /**
399  * Returns the transformation of the mesh in relation to world.
400  * @return The transformation between mesh and world
401  */
402  inline const HomogenousMatrix4& world_T_mesh() const;
403 
404  /**
405  * Returns the vertices representing the mesh.
406  * @return The mesh's vertices, defined in the mesh's coordinate system
407  */
408  inline const Vectors3& vertices() const;
409 
410  /**
411  * Returns the per-vertex normals of the mesh's faces.
412  * @return The mesh's normals, defined in the mesh's coordinate system, one for each vertex
413  */
414  inline const Vectors3& perVertexNormals() const;
415 
416  /**
417  * Returns the indices of the vertices representing the mesh's surface triangles, three indices define one triangle, always a multiple of three.
418  * @return The indices of the mesh's triangles, empty if unknown
419  */
420  inline const Indices32& triangleIndices() const;
421 
422  protected:
423 
424  /// The unique id of this mesh.
425  Index32 meshId_ = Index32(-1);
426 
427  /// The type of the mesh.
428  MeshType meshType_ = MT_UNKNOWN;
429 
430  /// The transformation between mesh and world.
431  HomogenousMatrix4 world_T_mesh_ = HomogenousMatrix4(false);
432 
433  /// The vertices representing the mesh, defined in the mesh's coordinate system.
435 
436  /// The per-vertex normals of the mesh, one for each vertex.
438 
439  /// The indices of the vertices representing the mesh's surface triangles, three indices define one triangle, always a multiple of three.
441  };
442 
443  /**
444  * Definition of a shared pointer for Mesh objects.
445  */
446  typedef std::shared_ptr<Mesh> SharedMesh;
447 
448  /**
449  * Definition of a vector holding meshes.
450  */
451  typedef std::vector<SharedMesh> SharedMeshes;
452 
453  public:
454 
455  /**
456  * Creates a new scene element object with several given meshes.
457  * @param meshes The meshes of the new scene element, at least one
458  */
459  explicit inline SceneElementMeshes(SharedMeshes meshes);
460 
461  /**
462  * Returns all meshes of this scene element object, may be empty.
463  * @return The scene element's meshes
464  */
465  inline const SharedMeshes& meshes() const;
466 
467  protected:
468 
469  /// The meshes stores in this scene element object.
471  };
472 
473  /**
474  * This class implements a scene element holding depth information.
475  */
477  {
478  public:
479 
480  /**
481  * Creates a new scene element object with depth information.
482  * @param camera The camera profile defining the projection of the depth image, must be valid
483  * @param device_T_depth The transformation between depth image and device, must be valid
484  * @param depth The depth image, must be valid
485  * @param confidence The confidence map, one entry for each pixel in the depth image, nullptr if unknown
486  */
487  inline SceneElementDepth(SharedAnyCamera camera, const HomogenousMatrix4& device_T_depth, std::shared_ptr<Frame> depth, std::shared_ptr<Frame> confidence = nullptr);
488 
489  /**
490  * Returns the camera profile of the depth image.
491  * @return The depth image's camera profile
492  */
493  inline SharedAnyCamera camera() const;
494 
495  /**
496  * Returns the transformation between depth image and the device.
497  * @return The scene element's transformation between depth image and device
498  */
499  inline const HomogenousMatrix4& device_T_depth() const;
500 
501  /**
502  * Returns the depth image.
503  * @param confidence Optional returning confidence map, will be invalid if unknown; nullptr if not of interest
504  * @return The scene element's depth image
505  */
506  inline std::shared_ptr<Frame> depth(std::shared_ptr<Frame>* confidence = nullptr) const;
507 
508  protected:
509 
510  /// The camera profile defining the projection of the depth image.
512 
513  /// The transformation between depth image and the device.
514  HomogenousMatrix4 device_T_depth_ = HomogenousMatrix4(false);
515 
516  /// The scene element's depth image.
517  std::shared_ptr<Frame> depth_;
518 
519  /// The scene element's confidence map, one entry for each pixel in the depth image, if known.
520  std::shared_ptr<Frame> confidence_;
521  };
522 
523  /**
524  * This class implements a scene element holding room objects.
525  */
527  {
528  public:
529 
530  /**
531  * This class implemenets the base class for all room objects.
532  */
533  class OCEAN_DEVICES_EXPORT RoomObject
534  {
535  public:
536 
537  /**
538  * Definition of individual room object types.
539  */
540  enum ObjectType : uint32_t
541  {
542  /// Undefined type.
543  OT_UNDEFINED = 0u,
544  /// The object is a planar room object.
546  /// The object is a volumetric room object.
547  OT_VOLUMETRIC
548  };
549 
550  protected:
551 
552  /**
553  * Creates a new room object.
554  * @param objectType The type of the object, must be valid
555  * @param identifier The unique identifier of the object
556  * @param confidence The confidence of the object, with range [0, 1], higher is better
557  * @param world_T_object The transformation between object and world, must be valid
558  * @param dimension The dimension of the object
559  */
560  inline RoomObject(const ObjectType objectType, std::string&& identifier, const float confidence, const HomogenousMatrix4& world_T_object, const Vector3& dimension);
561 
562  public:
563 
564  /**
565  * Returns the type of this object.
566  * @return The object's type
567  */
568  inline ObjectType objectType() const;
569 
570  /**
571  * Returns the unique identifier of this object.
572  * @return The object's identifier
573  */
574  inline const std::string& identifier() const;
575 
576  /**
577  * Returns the confidence of this object.
578  * @return The object's confidence, with range [0, 1], higher is better
579  */
580  inline float confidence() const;
581 
582  /**
583  * Returns the transformation between this object and world.
584  * @return The object's transformation
585  */
586  inline const HomogenousMatrix4& world_T_object() const;
587 
588  /**
589  * Sets or updates the transformation between this object and world.
590  * @param world_T_object The transformation to be set, must be valid
591  */
592  inline void setWorld_T_object(const HomogenousMatrix4& world_T_object);
593 
594  /**
595  * Returns the dimension of this object.
596  * @return The object's dimension
597  */
598  inline const Vector3& dimension() const;
599 
600  /**
601  * Translates the type of an object to a readable string.
602  * @param objectType The object type to translate
603  * @return The readable string
604  */
605  static std::string translateObjectType(const ObjectType objectType);
606 
607  /**
608  * Translates the readable string of an object type to an object type value.
609  * @param objectType The readable string to translate
610  * @return The object type value, OT_UNDEFINED if invalid
611  */
612  static ObjectType translateObjectType(const std::string& objectType);
613 
614  protected:
615 
616  /// The type of this object.
617  ObjectType objectType_ = OT_UNDEFINED;
618 
619  /// The unique identifier of this object.
620  std::string identifier_;
621 
622  /// The confidence of this object, with range [0, 1], higher is better.
623  float confidence_ = 0.0f;
624 
625  /// The transformation between this object and world.
626  HomogenousMatrix4 world_T_object_ = HomogenousMatrix4(false);
627 
628  /// The dimension of this object.
629  Vector3 dimension_ = Vector3(0, 0, 0);
630  };
631 
632  /**
633  * This class implements a room object which is planar/flat.
634  */
635  class OCEAN_DEVICES_EXPORT PlanarRoomObject : public RoomObject
636  {
637  public:
638 
639  /**
640  * Definition of individual types of planar objects.
641  */
642  enum PlanarType : uint32_t
643  {
644  /// The type is unknown.
645  PT_UNKNOWN = 0u,
646  /// The object is a planar wall.
648  /// The object is a door.
650  /// The object is a window.
652  /// The object is an opening.
654  /// The object is a floor.
656  /// The end type.
657  PT_END
658  };
659 
660  public:
661 
662  /**
663  * Creates a new room object.
664  * @param identifier The unique identifier of the object
665  * @param planarType The type of the planar object, must be valid
666  * @param confidence The confidence of the object, with range [0, 1], higher is better
667  * @param world_T_object The transformation between object and world, must be valid
668  * @param dimension The dimension of the object
669  */
670  inline PlanarRoomObject(std::string&& identifier, const PlanarType planarType, const float confidence, const HomogenousMatrix4& world_T_object, const Vector3& dimension);
671 
672  /**
673  * Returns the planar type of this object.
674  * @return The object's planar type
675  */
676  inline PlanarType planarType() const;
677 
678  /**
679  * Translates the planar type to a readable string.
680  * @param planarType The type to translate
681  * @return The translated type
682  */
683  static std::string translatePlanarType(const PlanarType planarType);
684 
685  /**
686  * Translates the readable stirng of a planar type to the corresponding value.
687  * @param planarType The type to translate
688  * @return The translated type
689  */
690  static PlanarType translatePlanarType(const std::string& planarType);
691 
692  protected:
693 
694  /// The planar type of this object.
695  PlanarType planarType_ = PT_UNKNOWN;
696  };
697 
698  /**
699  * This class implements a room object which is volumetric.
700  */
701  class OCEAN_DEVICES_EXPORT VolumetricRoomObject : public RoomObject
702  {
703  public:
704 
705  /**
706  * Definition of individual types of volumetric objects.
707  */
708  enum VolumetricType : uint32_t
709  {
710  /// The type is unknown.
711  VT_UNKNOWN = 0u,
712  /// The object is a storage.
714  /// The object is a refrigerator.
716  /// The object is a stove.
718  /// The object is a bed.
720  /// The object is a sink.
722  /// The object is a washer/driver.
724  /// The object is a toilet.
726  /// The object is a bathtub.
728  /// The object is an oven.
730  /// The object is a dishwasher.
732  /// The object is a table.
734  /// The object is a sofa.
736  /// The object is a char.
738  /// The object is a fire place.
740  /// The object is a television.
742  /// The object is stairs.
744  /// The end type.
745  VT_END
746  };
747 
748  protected:
749 
750  /**
751  * Definition of an unordered map mapping readable strings to volumetric types.
752  */
753  typedef std::unordered_map<std::string, VolumetricType> VolumetricTypeMap;
754 
755  public:
756 
757  /**
758  * Creates a new room object.
759  * @param identifier The unique identifier of the object
760  * @param volumetricType The type of the volumetric object, must be valid
761  * @param confidence The confidence of the object, with range [0, 1], higher is better
762  * @param world_T_object The transformation between object and world, must be valid
763  * @param dimension The dimension of the object
764  */
765  inline VolumetricRoomObject(std::string&& identifier, const VolumetricType volumetricType, float confidence, const HomogenousMatrix4& world_T_object, const Vector3& dimension);
766 
767  /**
768  * Returns the volumetric type of this object.
769  * @return The object's volumetric type
770  */
771  inline VolumetricType volumetricType() const;
772 
773  /**
774  * Translates the volumetric type to a readable string.
775  * @param volumetricType The volumetric type to translate
776  * @return The translated type
777  */
778  static std::string translateVolumetricType(const VolumetricType volumetricType);
779 
780  /**
781  * Translates the readable string of a volumetric type to the corresponding value.
782  * @param volumetricType The volumetric type to translate
783  * @return The translated type
784  */
785  static VolumetricType translateVolumetricType(const std::string& volumetricType);
786 
787  protected:
788 
789  /// The volumetric type of this object.
790  VolumetricType volumetricType_ = VT_UNKNOWN;
791  };
792 
793  /**
794  * Definition of a shared pointer holding a room object.
795  */
796  typedef std::shared_ptr<RoomObject> SharedRoomObject;
797 
798  /**
799  * Definition of a shared pointer holding a planar room object.
800  */
801  typedef std::shared_ptr<PlanarRoomObject> SharedPlanarRoomObject;
802 
803  /**
804  * Definition of a shared pointer holding a volumetric room object.
805  */
806  typedef std::shared_ptr<VolumetricRoomObject> SharedVolumetricRoomObject;
807 
808  /**
809  * Definition of a vector holding room objects.
810  */
811  typedef std::vector<SharedRoomObject> SharedRoomObjects;
812 
813  /**
814  * Definition of a vector holding planar room objects.
815  */
816  typedef std::vector<SharedPlanarRoomObject> SharedPlanarRoomObjects;
817 
818  /**
819  * Definition of a vector holding volumetric room objects.
820  */
821  typedef std::vector<SharedVolumetricRoomObject> SharedVolumetricRoomObjects;
822 
823  /**
824  * Definition of an unordered set holding object identifiers.
825  */
826  typedef std::unordered_set<std::string> RoomObjectIdentifierSet;
827 
828  /**
829  * Definitio of an unordered map mapping object identifiers to room objects.
830  */
831  typedef std::unordered_map<std::string, SharedRoomObject> RoomObjectMap;
832 
833  public:
834 
835  /**
836  * Creates a new scene element object with several given room objects.
837  * @param roomObjectMap The room objects of the new scene element, may be empty.
838  * @param addedRoomObjects The identifiers of all added room objects
839  * @param removedRoomObjects The identifiers of all removed room objects
840  * @param changedRoomObjects The identifiers of all changed room objects
841  * @param updatedRoomObjects The identifiers of all updated room objects
842  */
843  explicit inline SceneElementRoom(RoomObjectMap&& roomObjectMap, RoomObjectIdentifierSet&& addedRoomObjects, RoomObjectIdentifierSet&& removedRoomObjects, RoomObjectIdentifierSet&& changedRoomObjects, RoomObjectIdentifierSet&& updatedRoomObjects);
844 
845  /**
846  * Returns all room objects of this scene element object, may be empty.
847  * @return The scene element's room objects
848  */
849  inline const RoomObjectMap& roomObjectMap() const;
850 
851  /**
852  * Returns the identifiers of all room object which have been added.
853  * @return Added room objects
854  */
855  inline const RoomObjectIdentifierSet& addedRoomObjects() const;
856 
857  /**
858  * Returns the identifiers of all room object which have been removed.
859  * @return Removed room objects
860  */
861  inline const RoomObjectIdentifierSet& removedRoomObjects() const;
862 
863  /**
864  * Returns the identifiers of all room object which have been changed.
865  * @return Changed room objects
866  */
867  inline const RoomObjectIdentifierSet& changedRoomObjects() const;
868 
869  /**
870  * Returns the identifiers of all room object which have been updated.
871  * @return Updated room objects
872  */
873  inline const RoomObjectIdentifierSet& updatedRoomObjects() const;
874 
875  protected:
876 
877  /// The room objects in this scene element object.
879 
880  /// The identifiers of all added room objects.
882 
883  /// The identifiers of all removed room objects.
885 
886  /// The identifiers of all changed room objects.
888 
889  /// The identifiers of all changed room objects.
891  };
892 
893  /**
894  * Definition of a shared pointer holding a scene element.
895  */
896  typedef std::shared_ptr<SceneElement> SharedSceneElement;
897 
898  /**
899  * Definition of a vector holding scene elements.
900  */
901  typedef std::vector<SharedSceneElement> SharedSceneElements;
902 
903  /**
904  * Definition of a sample holding one single 6DOF tracker measurement.
905  */
906  class OCEAN_DEVICES_EXPORT SceneTracker6DOFSample : virtual public Tracker6DOFSample
907  {
908  public:
909 
910  /**
911  * Creates a new 6DOF tracker sample.
912  * @param timestamp Sample timestamp
913  * @param referenceSystem Tracking reference system used by the underlying tracker
914  * @param objectIds Measurement unit object ids each id corresponds to a different orientation and position measurement
915  * @param orientations Sample orientation measurements
916  * @param positions Sample position measurements in meter
917  * @param sceneElements The scene elements of the new sample
918  * @param metadata Optional metadata of the new sample
919  */
920  SceneTracker6DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, const ObjectIds& objectIds, const Orientations& orientations, const Positions& positions, const SharedSceneElements& sceneElements, const Metadata& metadata = Metadata());
921 
922  /**
923  * Creates a new 6DOF tracker sample.
924  * @param timestamp Sample timestamp
925  * @param referenceSystem Tracking reference system used by the underlying tracker
926  * @param objectIds Measurement unit object ids each id corresponds to a different orientation and position measurement
927  * @param orientations Sample orientation measurements
928  * @param positions Sample position measurements in meter
929  * @param sceneElements The scene elements of the new sample
930  * @param metadata Optional metadata of the new sample
931  */
932  SceneTracker6DOFSample(const Timestamp& timestamp, const ReferenceSystem referenceSystem, ObjectIds&& objectIds, Orientations&& orientations, Positions&& positions, SharedSceneElements&& sceneElements, Metadata&& metadata = Metadata());
933 
934  /**
935  * Returns the scene elements of this sample.
936  * Scene elements can be invalid in case a pure 6-DOF pose is provided.
937  * @return The sample's scene elements, some may be invalid
938  */
939  inline const SharedSceneElements& sceneElements() const;
940 
941  protected:
942 
943  /// The scene elements.
945  };
946 
947  /**
948  * Definition of a smart object reference for 6-DOF scene tracker samples.
949  */
951 
952  public:
953 
954  /**
955  * Exports the determined scene elements.
956  * @param format The format of the exported data
957  * @param outputStream The output stream to which the data will be exported
958  * @param options Optional options to configure the export result
959  * @return True, if succeeded; False, if not supported
960  */
961  virtual bool exportSceneElements(const std::string& format, std::ostream& outputStream, const std::string& options = std::string()) const;
962 
963  /**
964  * Definition of this device type.
965  */
966  static inline DeviceType deviceTypeSceneTracker6DOF();
967 
968  protected:
969 
970  /**
971  * Creates a new 6-DOF scene tracker object.
972  * @param name The name of the 6DOF tracker, must be valid
973  */
974  explicit SceneTracker6DOF(const std::string& name);
975 
976  /**
977  * Destructs a 6-DOF tracker object.
978  */
979  ~SceneTracker6DOF() override;
980 };
981 
983  sceneElementType_(sceneElementType)
984 {
985  // nothing to do here
986 }
987 
989 {
990  return sceneElementType_;
991 }
992 
994  SceneElement(SET_OBJECT_POINTS),
995  objectPoints_(std::move(objectPoints)),
996  objectPointIds_(std::move(objectPointIds))
997 {
998  ocean_assert(!objectPoints_.empty());
999  ocean_assert(objectPointIds_.empty() || objectPointIds_.size() == objectPoints_.size());
1000 }
1001 
1003 {
1004  ocean_assert(sceneElementType_ == SET_FEATURE_CORRESPONDENCES || sceneElementType_ == SET_OBJECT_POINTS);
1005  return objectPoints_;
1006 }
1007 
1009 {
1010  return objectPointIds_;
1011 }
1012 
1014  SceneElement(SET_FEATURE_CORRESPONDENCES),
1015  objectPoints_(std::move(objectPoints)),
1016  imagePoints_(std::move(imagePoints)),
1017  objectPointIds_(std::move(objectPointIds))
1018 {
1019  ocean_assert(!objectPoints_.empty());
1020  ocean_assert(imagePoints_.size() == objectPoints_.size());
1021 
1022  ocean_assert(objectPointIds_.empty() || objectPointIds_.size() == objectPoints_.size());
1023 }
1024 
1026 {
1027  ocean_assert(sceneElementType_ == SET_FEATURE_CORRESPONDENCES || sceneElementType_ == SET_OBJECT_POINTS);
1028  return objectPoints_;
1029 }
1030 
1032 {
1033  ocean_assert(sceneElementType_ == SET_FEATURE_CORRESPONDENCES);
1034  return imagePoints_;
1035 }
1036 
1038 {
1039  return objectPointIds_;
1040 }
1041 
1042 inline SceneTracker6DOF::SceneElementPlanes::Plane::Plane(const Index32 planeId, const PlaneType planeType, const HomogenousMatrix4& world_T_plane, const Box3& boundingBox, Vectors3&& boundaryVertices) :
1043  planeId_(planeId),
1044  planeType_(planeType),
1045  world_T_plane_(world_T_plane),
1046  boundingBox_(std::move(boundingBox)),
1047  boundaryVertices_(std::move(boundaryVertices))
1048 {
1049  ocean_assert(world_T_plane_.isValid());
1050  ocean_assert(boundingBox_.isValid());
1051 }
1052 
1053 inline SceneTracker6DOF::SceneElementPlanes::Plane::Plane(const Index32 planeId, const PlaneType planeType, const HomogenousMatrix4& world_T_plane, const Box3& boundingBox, Vectors3&& vertices, Vectors2&& textureCoordinates, Indices32&& triangleIndices, Vectors3&& boundaryVertices) :
1054  planeId_(planeId),
1055  planeType_(planeType),
1056  world_T_plane_(world_T_plane),
1057  boundingBox_(std::move(boundingBox)),
1058  vertices_(std::move(vertices)),
1059  textureCoordinates_(std::move(textureCoordinates)),
1060  triangleIndices_(std::move(triangleIndices)),
1061  boundaryVertices_(std::move(boundaryVertices))
1062 {
1063  ocean_assert(world_T_plane_.isValid());
1064  ocean_assert(boundingBox_.isValid());
1065  ocean_assert(textureCoordinates.empty() || textureCoordinates.size() == vertices_.size());
1066  ocean_assert(triangleIndices.empty() || triangleIndices.size() % 3 == 0);
1067 }
1068 
1070 {
1071  return planeId_;
1072 }
1073 
1075 {
1076  return planeType_;
1077 }
1078 
1080 {
1081  ocean_assert(world_T_plane_.isValid());
1082  return world_T_plane_;
1083 }
1084 
1086 {
1087  ocean_assert(world_T_plane_.isValid());
1088 
1089  ocean_assert(world_T_plane_.yAxis().isUnit());
1090  return Plane3(world_T_plane_.translation(), world_T_plane_.yAxis());
1091 }
1092 
1094 {
1095  ocean_assert(boundingBox_.isValid());
1096  return boundingBox_;
1097 }
1098 
1100 {
1101  return vertices_;
1102 }
1103 
1105 {
1106  return textureCoordinates_;
1107 }
1108 
1110 {
1111  return triangleIndices_;
1112 }
1113 
1115 {
1116  return boundaryVertices_;
1117 }
1118 
1121  planes_(std::move(planes))
1122 {
1123  ocean_assert(!planes_.empty());
1124 }
1125 
1127 {
1128  return planes_;
1129 }
1130 
1131 inline SceneTracker6DOF::SceneElementMeshes::Mesh::Mesh(const Index32 meshId, const HomogenousMatrix4& world_T_mesh, Vectors3&& vertices, Vectors3&& perVertexNormals, Indices32&& triangleIndices) :
1132  meshId_(meshId),
1133  world_T_mesh_(world_T_mesh),
1134  vertices_(std::move(vertices)),
1135  perVertexNormals_(std::move(perVertexNormals)),
1136  triangleIndices_(std::move(triangleIndices))
1137 {
1138  ocean_assert(triangleIndices_.size() % 3 == 0);
1139  ocean_assert(vertices_.size() == perVertexNormals_.size());
1140 }
1141 
1143 {
1144  return meshId_;
1145 }
1146 
1148 {
1149  return world_T_mesh_;
1150 }
1151 
1153 {
1154  return vertices_;
1155 }
1156 
1158 {
1159  return perVertexNormals_;
1160 }
1161 
1163 {
1164  return triangleIndices_;
1165 }
1166 
1169  meshes_(std::move(meshes))
1170 {
1171  ocean_assert(!meshes_.empty());
1172 }
1173 
1175 {
1176  return meshes_;
1177 }
1178 
1179 inline SceneTracker6DOF::SceneElementRoom::RoomObject::RoomObject(const ObjectType objectType, std::string&& identifier, const float confidence, const HomogenousMatrix4& world_T_object, const Vector3& dimension) :
1180  objectType_(objectType),
1181  identifier_(std::move(identifier)),
1182  confidence_(confidence),
1183  world_T_object_(world_T_object),
1184  dimension_(dimension)
1185 {
1186  ocean_assert(objectType != OT_UNDEFINED);
1187  ocean_assert(!identifier_.empty());
1188  ocean_assert(confidence >= 0.0f && confidence <= 1.0f);
1189  ocean_assert(world_T_object_.isValid());
1190 }
1191 
1193 {
1194  return objectType_;
1195 }
1196 
1198 {
1199  return identifier_;
1200 }
1201 
1203 {
1204  return confidence_;
1205 }
1206 
1208 {
1209  return world_T_object_;
1210 }
1211 
1213 {
1214  ocean_assert(world_T_object.isValid());
1215  world_T_object_ = world_T_object;
1216 }
1217 
1219 {
1220  return dimension_;
1221 }
1222 
1223 inline SceneTracker6DOF::SceneElementRoom::PlanarRoomObject::PlanarRoomObject(std::string&& identifier, const PlanarType planarType, const float confidence, const HomogenousMatrix4& world_T_object, const Vector3& dimension) :
1224  RoomObject(OT_PLANAR, std::move(identifier), confidence, world_T_object, dimension),
1225  planarType_(planarType)
1226 {
1227  ocean_assert(planarType_ != PT_UNKNOWN);
1228 }
1229 
1231 {
1232  return planarType_;
1233 }
1234 
1235 inline SceneTracker6DOF::SceneElementRoom::VolumetricRoomObject::VolumetricRoomObject(std::string&& identifier, const VolumetricType volumetricType, const float confidence, const HomogenousMatrix4& world_T_object, const Vector3& dimension) :
1236  RoomObject(OT_VOLUMETRIC, std::move(identifier), confidence, world_T_object, dimension),
1237  volumetricType_(volumetricType)
1238 {
1239  ocean_assert(volumetricType_ != VT_UNKNOWN);
1240 }
1241 
1243 {
1244  return volumetricType_;
1245 }
1246 
1249  roomObjectMap_(std::move(roomObjectMap)),
1250  addedRoomObjects_(std::move(addedRoomObjects)),
1254 {
1255  // nothing to do here
1256 }
1257 
1259 {
1260  return roomObjectMap_;
1261 }
1262 
1264 {
1265  return addedRoomObjects_;
1266 }
1267 
1269 {
1270  return removedRoomObjects_;
1271 }
1272 
1274 {
1275  return changedRoomObjects_;
1276 }
1277 
1279 {
1280  return updatedRoomObjects_;
1281 }
1282 
1283 inline SceneTracker6DOF::SceneElementDepth::SceneElementDepth(SharedAnyCamera camera, const HomogenousMatrix4& device_T_depth, std::shared_ptr<Frame> depth, std::shared_ptr<Frame> confidence) :
1284  SceneElement(SET_DEPTH),
1285  camera_(std::move(camera)),
1286  device_T_depth_(device_T_depth),
1287  depth_(std::move(depth)),
1288  confidence_(std::move(confidence))
1289 {
1290  ocean_assert(camera_ && depth_ && device_T_depth_.isValid());
1291 }
1292 
1294 {
1295  ocean_assert(camera_);
1296  return camera_;
1297 }
1298 
1300 {
1301  ocean_assert(device_T_depth_.isValid());
1302  return device_T_depth_;
1303 }
1304 
1305 inline std::shared_ptr<Frame> SceneTracker6DOF::SceneElementDepth::depth(std::shared_ptr<Frame>* confidence) const
1306 {
1307  if (confidence != nullptr)
1308  {
1309  *confidence = confidence_;
1310  }
1311 
1312  ocean_assert(depth_);
1313  return depth_;
1314 }
1315 
1317 {
1318  return sceneElements_;
1319 }
1320 
1322 {
1324 }
1325 
1326 }
1327 
1328 }
1329 
1330 #endif // META_OCEAN_DEVICES_SCENE_TRACKER_6DOF_H
bool isValid() const
Returns whether the bounding box is valid.
Definition of a class holding the major and minor device type.
Definition: devices/Device.h:62
@ DEVICE_TRACKER
Tracker device.
Definition: devices/Device.h:46
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition: Measurement.h:61
std::vector< ObjectId > ObjectIds
Definition of a vector holding object ids.
Definition: Measurement.h:51
std::vector< Quaternion > Orientations
Definition of a vector holding orientation values.
Definition: OrientationTracker3DOF.h:51
std::vector< Vector3 > Positions
Definition of a vector holding position values.
Definition: PositionTracker3DOF.h:50
This class implements a scene element holding depth information.
Definition: SceneTracker6DOF.h:477
SharedAnyCamera camera() const
Returns the camera profile of the depth image.
Definition: SceneTracker6DOF.h:1293
SceneElementDepth(SharedAnyCamera camera, const HomogenousMatrix4 &device_T_depth, std::shared_ptr< Frame > depth, std::shared_ptr< Frame > confidence=nullptr)
Creates a new scene element object with depth information.
Definition: SceneTracker6DOF.h:1283
SharedAnyCamera camera_
The camera profile defining the projection of the depth image.
Definition: SceneTracker6DOF.h:511
HomogenousMatrix4 device_T_depth_
The transformation between depth image and the device.
Definition: SceneTracker6DOF.h:514
const HomogenousMatrix4 & device_T_depth() const
Returns the transformation between depth image and the device.
Definition: SceneTracker6DOF.h:1299
std::shared_ptr< Frame > depth_
The scene element's depth image.
Definition: SceneTracker6DOF.h:517
std::shared_ptr< Frame > depth(std::shared_ptr< Frame > *confidence=nullptr) const
Returns the depth image.
Definition: SceneTracker6DOF.h:1305
std::shared_ptr< Frame > confidence_
The scene element's confidence map, one entry for each pixel in the depth image, if known.
Definition: SceneTracker6DOF.h:520
This class implements a scene element holding 2D/3D feature correspondences.
Definition: SceneTracker6DOF.h:140
SceneElementFeatureCorrespondences(Vectors3 &&objectPoints, Vectors2 &&imagePoints, Indices64 &&objectPointIds=Indices64())
Creates a new scene element for 2D/3D correspondences.
Definition: SceneTracker6DOF.h:1013
Vectors3 objectPoints_
The 3D object points of this scene element.
Definition: SceneTracker6DOF.h:172
const Vectors2 & imagePoints() const
Returns the 2D image points of this scene element.
Definition: SceneTracker6DOF.h:1031
Vectors2 imagePoints_
The 2D image points of this scene element, one for each 3D object point.
Definition: SceneTracker6DOF.h:175
Indices64 objectPointIds_
The unique ids of the 3D object points, if known.
Definition: SceneTracker6DOF.h:178
const Indices64 & objectPointIds() const
Returns the unique object point ids.
Definition: SceneTracker6DOF.h:1037
const Vectors3 & objectPoints() const
Returns the 3D object points of this scene element.
Definition: SceneTracker6DOF.h:1025
This class implements the base class of all scene elements.
Definition: SceneTracker6DOF.h:49
SceneElementType
Definition of individual types of scene elements.
Definition: SceneTracker6DOF.h:56
@ SET_ROOM
The scene element contains room objects.
Definition: SceneTracker6DOF.h:70
@ SET_DEPTH
The scene element contains depth information.
Definition: SceneTracker6DOF.h:68
@ SET_PLANES
The scene element contains 3D planes.
Definition: SceneTracker6DOF.h:64
@ SET_OBJECT_POINTS
The scene element contains 3D object points.
Definition: SceneTracker6DOF.h:60
@ SET_MESHES
The scene element contains 3D meshes.
Definition: SceneTracker6DOF.h:66
@ SET_FEATURE_CORRESPONDENCES
The scene element contains 2D/3D correspondences.
Definition: SceneTracker6DOF.h:62
virtual ~SceneElement()=default
Destructs a scene element.
SceneElementType sceneElementType() const
Returns the type of this scene element.
Definition: SceneTracker6DOF.h:988
SceneElement(const SceneElementType sceneElementType)
Creates a default scene element with specified type.
Definition: SceneTracker6DOF.h:982
This class stores the relevant information of a 3D mesh.
Definition: SceneTracker6DOF.h:354
const Indices32 & triangleIndices() const
Returns the indices of the vertices representing the mesh's surface triangles, three indices define o...
Definition: SceneTracker6DOF.h:1162
MeshType
Definition of individual mesh types.
Definition: SceneTracker6DOF.h:361
@ MT_TABLE
The mesh is representing a table.
Definition: SceneTracker6DOF.h:373
@ MT_DOOR
The mesh is representing a door.
Definition: SceneTracker6DOF.h:367
@ MT_CEILING
The mesh is representing a ceiling.
Definition: SceneTracker6DOF.h:365
@ MT_WALL
The mesh is representing a wall.
Definition: SceneTracker6DOF.h:375
@ MT_FLOOR
The mesh is representing a floor.
Definition: SceneTracker6DOF.h:369
@ MT_SEAT
The mesh is representing a seat.
Definition: SceneTracker6DOF.h:371
const Vectors3 & vertices() const
Returns the vertices representing the mesh.
Definition: SceneTracker6DOF.h:1152
Index32 meshId() const
Returns the unique id of the mesh.
Definition: SceneTracker6DOF.h:1142
Mesh(const Index32 meshId, const HomogenousMatrix4 &world_T_mesh, Vectors3 &&vertices, Vectors3 &&perVertexNormals, Indices32 &&triangleIndices)
Creates a new mesh object.
Definition: SceneTracker6DOF.h:1131
Indices32 triangleIndices_
The indices of the vertices representing the mesh's surface triangles, three indices define one trian...
Definition: SceneTracker6DOF.h:440
Vectors3 perVertexNormals_
The per-vertex normals of the mesh, one for each vertex.
Definition: SceneTracker6DOF.h:437
const Vectors3 & perVertexNormals() const
Returns the per-vertex normals of the mesh's faces.
Definition: SceneTracker6DOF.h:1157
Vectors3 vertices_
The vertices representing the mesh, defined in the mesh's coordinate system.
Definition: SceneTracker6DOF.h:434
const HomogenousMatrix4 & world_T_mesh() const
Returns the transformation of the mesh in relation to world.
Definition: SceneTracker6DOF.h:1147
This class implements a scene element holding 3D meshes.
Definition: SceneTracker6DOF.h:346
std::shared_ptr< Mesh > SharedMesh
Definition of a shared pointer for Mesh objects.
Definition: SceneTracker6DOF.h:446
const SharedMeshes & meshes() const
Returns all meshes of this scene element object, may be empty.
Definition: SceneTracker6DOF.h:1174
std::vector< SharedMesh > SharedMeshes
Definition of a vector holding meshes.
Definition: SceneTracker6DOF.h:451
SceneElementMeshes(SharedMeshes meshes)
Creates a new scene element object with several given meshes.
Definition: SceneTracker6DOF.h:1167
SharedMeshes meshes_
The meshes stores in this scene element object.
Definition: SceneTracker6DOF.h:470
Definition of a scene element holding 3D object points.
Definition: SceneTracker6DOF.h:105
const Indices64 & objectPointIds() const
Returns the unique ids of the object points if known.
Definition: SceneTracker6DOF.h:1008
const Vectors3 & objectPoints() const
Returns the 3D object points of this scene element.
Definition: SceneTracker6DOF.h:1002
Indices64 objectPointIds_
The unique ids of this scene element.
Definition: SceneTracker6DOF.h:133
SceneElementObjectPoints(Vectors3 &&objectPoints, Indices64 &&objectPointIds=Indices64())
Creates a new SceneElement object for 3D object points.
Definition: SceneTracker6DOF.h:993
Vectors3 objectPoints_
The 3D object points of this scene element.
Definition: SceneTracker6DOF.h:130
This class stores the relevant information of a 3D plane.
Definition: SceneTracker6DOF.h:194
HomogenousMatrix4 world_T_plane_
The transformation between plane and world, with y-axis as the plane's normal.
Definition: SceneTracker6DOF.h:299
Indices32 triangleIndices_
The indices of the vertices representing the plane's surface triangles, three indices define one tria...
Definition: SceneTracker6DOF.h:311
Vectors3 vertices_
The vertices representing the plane, defined in the plane's coordinate system.
Definition: SceneTracker6DOF.h:305
PlaneType planeType() const
Returns the type of the plane.
Definition: SceneTracker6DOF.h:1074
PlaneType
Definition of individual plane types.
Definition: SceneTracker6DOF.h:201
@ PT_HORIZONTAL
The plane is horizontal and perpendicular to gravity (e.g., a floor/ceiling plane).
Definition: SceneTracker6DOF.h:205
Box3 boundingBox_
The bounding box of the plane, defined in the plane's origin.
Definition: SceneTracker6DOF.h:302
Vectors2 textureCoordinates_
The vertices' texture coordinates, one for each vertex, empty if unknown.
Definition: SceneTracker6DOF.h:308
const Vectors3 & boundaryVertices() const
Returns the vertices of the boundary of the plane.
Definition: SceneTracker6DOF.h:1114
const Indices32 & triangleIndices() const
Returns the indices of the vertices representing the plane's surface triangles, three indices define ...
Definition: SceneTracker6DOF.h:1109
const Vectors3 & vertices() const
Returns the vertices representing the plane.
Definition: SceneTracker6DOF.h:1099
Index32 planeId() const
Returns the unique id of the plane.
Definition: SceneTracker6DOF.h:1069
Vectors3 boundaryVertices_
The vertices of the boundaries of the plane, defined in the plane's coordinate system.
Definition: SceneTracker6DOF.h:314
const Box3 & boundingBox() const
Returns the plane's bounding box (the extent of the plane).
Definition: SceneTracker6DOF.h:1093
const Vectors2 & textureCoordinates() const
Returns the texture coordinates of the vertices, if known.
Definition: SceneTracker6DOF.h:1104
Plane(const Index32 planeId, const PlaneType planeType, const HomogenousMatrix4 &world_T_plane, const Box3 &boundingBox, Vectors3 &&boundaryVertices)
Creates a new plane object.
Definition: SceneTracker6DOF.h:1042
Plane3 worldPlane() const
Returns the 3D plane as defined in world.
Definition: SceneTracker6DOF.h:1085
const HomogenousMatrix4 & world_T_plane() const
Returns the transformation of the plane in relation to world.
Definition: SceneTracker6DOF.h:1079
This class implements a scene element holding 3D planes.
Definition: SceneTracker6DOF.h:185
Planes planes_
The planes stores in this scene element object.
Definition: SceneTracker6DOF.h:339
SceneElementPlanes(Planes &&planes)
Creates a new scene element object with several given planes.
Definition: SceneTracker6DOF.h:1119
std::vector< Plane > Planes
Definition of a vector holding planes.
Definition: SceneTracker6DOF.h:320
const Planes & planes() const
Returns all planes of this scene element object, may be empty.
Definition: SceneTracker6DOF.h:1126
This class implements a room object which is planar/flat.
Definition: SceneTracker6DOF.h:636
PlanarType
Definition of individual types of planar objects.
Definition: SceneTracker6DOF.h:643
@ PT_OPENING
The object is an opening.
Definition: SceneTracker6DOF.h:653
@ PT_FLOOR
The object is a floor.
Definition: SceneTracker6DOF.h:655
@ PT_WINDOW
The object is a window.
Definition: SceneTracker6DOF.h:651
@ PT_UNKNOWN
The type is unknown.
Definition: SceneTracker6DOF.h:645
@ PT_WALL
The object is a planar wall.
Definition: SceneTracker6DOF.h:647
@ PT_DOOR
The object is a door.
Definition: SceneTracker6DOF.h:649
static std::string translatePlanarType(const PlanarType planarType)
Translates the planar type to a readable string.
PlanarRoomObject(std::string &&identifier, const PlanarType planarType, const float confidence, const HomogenousMatrix4 &world_T_object, const Vector3 &dimension)
Creates a new room object.
Definition: SceneTracker6DOF.h:1223
PlanarType planarType() const
Returns the planar type of this object.
Definition: SceneTracker6DOF.h:1230
PlanarType planarType_
The planar type of this object.
Definition: SceneTracker6DOF.h:695
static PlanarType translatePlanarType(const std::string &planarType)
Translates the readable stirng of a planar type to the corresponding value.
This class implemenets the base class for all room objects.
Definition: SceneTracker6DOF.h:534
static ObjectType translateObjectType(const std::string &objectType)
Translates the readable string of an object type to an object type value.
float confidence() const
Returns the confidence of this object.
Definition: SceneTracker6DOF.h:1202
HomogenousMatrix4 world_T_object_
The transformation between this object and world.
Definition: SceneTracker6DOF.h:626
static std::string translateObjectType(const ObjectType objectType)
Translates the type of an object to a readable string.
std::string identifier_
The unique identifier of this object.
Definition: SceneTracker6DOF.h:620
ObjectType objectType() const
Returns the type of this object.
Definition: SceneTracker6DOF.h:1192
RoomObject(const ObjectType objectType, std::string &&identifier, const float confidence, const HomogenousMatrix4 &world_T_object, const Vector3 &dimension)
Creates a new room object.
Definition: SceneTracker6DOF.h:1179
const Vector3 & dimension() const
Returns the dimension of this object.
Definition: SceneTracker6DOF.h:1218
void setWorld_T_object(const HomogenousMatrix4 &world_T_object)
Sets or updates the transformation between this object and world.
Definition: SceneTracker6DOF.h:1212
const HomogenousMatrix4 & world_T_object() const
Returns the transformation between this object and world.
Definition: SceneTracker6DOF.h:1207
const std::string & identifier() const
Returns the unique identifier of this object.
Definition: SceneTracker6DOF.h:1197
ObjectType
Definition of individual room object types.
Definition: SceneTracker6DOF.h:541
@ OT_PLANAR
The object is a planar room object.
Definition: SceneTracker6DOF.h:545
@ OT_UNDEFINED
Undefined type.
Definition: SceneTracker6DOF.h:543
This class implements a room object which is volumetric.
Definition: SceneTracker6DOF.h:702
std::unordered_map< std::string, VolumetricType > VolumetricTypeMap
Definition of an unordered map mapping readable strings to volumetric types.
Definition: SceneTracker6DOF.h:753
static VolumetricType translateVolumetricType(const std::string &volumetricType)
Translates the readable string of a volumetric type to the corresponding value.
VolumetricType
Definition of individual types of volumetric objects.
Definition: SceneTracker6DOF.h:709
@ VT_REFRIGERATOR
The object is a refrigerator.
Definition: SceneTracker6DOF.h:715
@ VT_SOFA
The object is a sofa.
Definition: SceneTracker6DOF.h:735
@ VT_STORAGE
The object is a storage.
Definition: SceneTracker6DOF.h:713
@ VT_FIREPLACE
The object is a fire place.
Definition: SceneTracker6DOF.h:739
@ VT_SINK
The object is a sink.
Definition: SceneTracker6DOF.h:721
@ VT_TOILET
The object is a toilet.
Definition: SceneTracker6DOF.h:725
@ VT_STOVE
The object is a stove.
Definition: SceneTracker6DOF.h:717
@ VT_WASHER_DRYER
The object is a washer/driver.
Definition: SceneTracker6DOF.h:723
@ VT_DISHWASHER
The object is a dishwasher.
Definition: SceneTracker6DOF.h:731
@ VT_BATHTUB
The object is a bathtub.
Definition: SceneTracker6DOF.h:727
@ VT_TABLE
The object is a table.
Definition: SceneTracker6DOF.h:733
@ VT_CHAIR
The object is a char.
Definition: SceneTracker6DOF.h:737
@ VT_BED
The object is a bed.
Definition: SceneTracker6DOF.h:719
@ VT_OVEN
The object is an oven.
Definition: SceneTracker6DOF.h:729
@ VT_TELEVISION
The object is a television.
Definition: SceneTracker6DOF.h:741
@ VT_STAIRS
The object is stairs.
Definition: SceneTracker6DOF.h:743
@ VT_UNKNOWN
The type is unknown.
Definition: SceneTracker6DOF.h:711
static std::string translateVolumetricType(const VolumetricType volumetricType)
Translates the volumetric type to a readable string.
VolumetricType volumetricType_
The volumetric type of this object.
Definition: SceneTracker6DOF.h:790
VolumetricRoomObject(std::string &&identifier, const VolumetricType volumetricType, float confidence, const HomogenousMatrix4 &world_T_object, const Vector3 &dimension)
Creates a new room object.
Definition: SceneTracker6DOF.h:1235
VolumetricType volumetricType() const
Returns the volumetric type of this object.
Definition: SceneTracker6DOF.h:1242
This class implements a scene element holding room objects.
Definition: SceneTracker6DOF.h:527
std::shared_ptr< RoomObject > SharedRoomObject
Definition of a shared pointer holding a room object.
Definition: SceneTracker6DOF.h:796
RoomObjectMap roomObjectMap_
The room objects in this scene element object.
Definition: SceneTracker6DOF.h:878
RoomObjectIdentifierSet updatedRoomObjects_
The identifiers of all changed room objects.
Definition: SceneTracker6DOF.h:890
SceneElementRoom(RoomObjectMap &&roomObjectMap, RoomObjectIdentifierSet &&addedRoomObjects, RoomObjectIdentifierSet &&removedRoomObjects, RoomObjectIdentifierSet &&changedRoomObjects, RoomObjectIdentifierSet &&updatedRoomObjects)
Creates a new scene element object with several given room objects.
Definition: SceneTracker6DOF.h:1247
RoomObjectIdentifierSet addedRoomObjects_
The identifiers of all added room objects.
Definition: SceneTracker6DOF.h:881
std::vector< SharedRoomObject > SharedRoomObjects
Definition of a vector holding room objects.
Definition: SceneTracker6DOF.h:811
std::shared_ptr< VolumetricRoomObject > SharedVolumetricRoomObject
Definition of a shared pointer holding a volumetric room object.
Definition: SceneTracker6DOF.h:806
RoomObjectIdentifierSet removedRoomObjects_
The identifiers of all removed room objects.
Definition: SceneTracker6DOF.h:884
std::vector< SharedVolumetricRoomObject > SharedVolumetricRoomObjects
Definition of a vector holding volumetric room objects.
Definition: SceneTracker6DOF.h:821
const RoomObjectIdentifierSet & removedRoomObjects() const
Returns the identifiers of all room object which have been removed.
Definition: SceneTracker6DOF.h:1268
const RoomObjectMap & roomObjectMap() const
Returns all room objects of this scene element object, may be empty.
Definition: SceneTracker6DOF.h:1258
std::vector< SharedPlanarRoomObject > SharedPlanarRoomObjects
Definition of a vector holding planar room objects.
Definition: SceneTracker6DOF.h:816
const RoomObjectIdentifierSet & addedRoomObjects() const
Returns the identifiers of all room object which have been added.
Definition: SceneTracker6DOF.h:1263
RoomObjectIdentifierSet changedRoomObjects_
The identifiers of all changed room objects.
Definition: SceneTracker6DOF.h:887
std::shared_ptr< PlanarRoomObject > SharedPlanarRoomObject
Definition of a shared pointer holding a planar room object.
Definition: SceneTracker6DOF.h:801
const RoomObjectIdentifierSet & updatedRoomObjects() const
Returns the identifiers of all room object which have been updated.
Definition: SceneTracker6DOF.h:1278
std::unordered_set< std::string > RoomObjectIdentifierSet
Definition of an unordered set holding object identifiers.
Definition: SceneTracker6DOF.h:826
const RoomObjectIdentifierSet & changedRoomObjects() const
Returns the identifiers of all room object which have been changed.
Definition: SceneTracker6DOF.h:1273
std::unordered_map< std::string, SharedRoomObject > RoomObjectMap
Definitio of an unordered map mapping object identifiers to room objects.
Definition: SceneTracker6DOF.h:831
Definition of a sample holding one single 6DOF tracker measurement.
Definition: SceneTracker6DOF.h:907
SceneTracker6DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Orientations &orientations, const Positions &positions, const SharedSceneElements &sceneElements, const Metadata &metadata=Metadata())
Creates a new 6DOF tracker sample.
SharedSceneElements sceneElements_
The scene elements.
Definition: SceneTracker6DOF.h:944
const SharedSceneElements & sceneElements() const
Returns the scene elements of this sample.
Definition: SceneTracker6DOF.h:1316
SceneTracker6DOFSample(const Timestamp &timestamp, const ReferenceSystem referenceSystem, ObjectIds &&objectIds, Orientations &&orientations, Positions &&positions, SharedSceneElements &&sceneElements, Metadata &&metadata=Metadata())
Creates a new 6DOF tracker sample.
This class implements the base for all 6-DOF scene trackers.
Definition: SceneTracker6DOF.h:42
~SceneTracker6DOF() override
Destructs a 6-DOF tracker object.
std::shared_ptr< SceneElement > SharedSceneElement
Definition of a shared pointer holding a scene element.
Definition: SceneTracker6DOF.h:896
SceneTracker6DOF(const std::string &name)
Creates a new 6-DOF scene tracker object.
static DeviceType deviceTypeSceneTracker6DOF()
Definition of this device type.
Definition: SceneTracker6DOF.h:1321
virtual bool exportSceneElements(const std::string &format, std::ostream &outputStream, const std::string &options=std::string()) const
Exports the determined scene elements.
SmartObjectRef< SceneTracker6DOFSample, Sample > SceneTracker6DOFSampleRef
Definition of a smart object reference for 6-DOF scene tracker samples.
Definition: SceneTracker6DOF.h:950
std::vector< SharedSceneElement > SharedSceneElements
Definition of a vector holding scene elements.
Definition: SceneTracker6DOF.h:901
This class implements a smart device reference.
Definition: DeviceRef.h:36
Definition of a sample holding one single 6DOF tracker measurement.
Definition: Tracker6DOF.h:48
This class implements the base for all 6DOF trackers.
Definition: Tracker6DOF.h:39
@ SCENE_TRACKER_6DOF
6DOF scene tracker.
Definition: devices/Tracker.h:56
ReferenceSystem
Definition of different tracking reference system.
Definition: devices/Tracker.h:72
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition: HomogenousMatrix4.h:1806
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
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition: Base.h:96
std::vector< Index64 > Indices64
Definition of a vector holding 64 bit index values.
Definition: Base.h:108
uint32_t Index32
Definition of a 32 bit index value.
Definition: Base.h:84
SmartDeviceRef< SceneTracker6DOF > SceneTracker6DOFRef
Definition of a smart object reference for a 6-DOF scene tracker.
Definition: SceneTracker6DOF.h:27
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition: AnyCamera.h:60
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition: Vector3.h:22
PlaneT3< Scalar > Plane3
Definition of the Plane3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single ...
Definition: Plane3.h:24
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition: Vector2.h:64
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition: HomogenousMatrix4.h:37
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15