data_model.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 University of Bonn, Computer Science Institute,
3  * Kathrin Gräve
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 #ifndef __MOCAP_OPTITRACK_DATA_MODEL_H__
31 #define __MOCAP_OPTITRACK_DATA_MODEL_H__
32 
33 #include <string>
34 #include <vector>
35 
37 
38 namespace mocap_optitrack
39 {
40 
41 
43 struct Marker
44 {
45  float x;
46  float y;
47  float z;
48 };
49 
50 struct __attribute__((__packed__)) Pose
51 {
52  struct __attribute__((__packed__))
53  {
54  float x;
55  float y;
56  float z;
57  } position;
58  struct __attribute__((__packed__))
59  {
60  float x;
61  float y;
62  float z;
63  float w;
64  } orientation;
65 };
66 
68 struct RigidBody
69 {
70  RigidBody();
71  int bodyId;
75 
76  bool hasValidData() const;
77 };
78 
81 {
83  void clear();
84 
85  std::string name;
86  std::vector<std::string> markerNames;
87 };
88 
89 struct MarkerSet
90 {
91  void clear();
92 
93  char name[256];
94  std::vector<Marker> markers;
95 };
96 
98 struct ModelFrame
99 {
100  ModelFrame();
101  void clear();
102 
103  std::vector<MarkerSet> markerSets;
104  std::vector<Marker> otherMarkers;
105  std::vector<RigidBody> rigidBodies;
106 
107  float latency;
108 };
109 
112 {
113  ServerInfo();
116 };
117 
120 {
121 public:
122  DataModel();
123 
126 
127  void clear();
128 
129  void setVersions(int* nver, int* sver);
130  Version const& getNatNetVersion() const;
131  Version const& getServerVersion() const;
132  bool hasServerInfo() const
133  {
134  return hasValidServerInfo;
135  };
136 
137 private:
140 };
141 
142 }
143 
144 #endif
std::vector< Marker > markers
Definition: data_model.h:94
Data object holding information about a single rigid body within a mocap skeleton.
Definition: data_model.h:68
Data object holding poses of a tracked model&#39;s components.
Definition: data_model.h:98
std::vector< std::string > markerNames
Definition: data_model.h:86
std::vector< RigidBody > rigidBodies
Definition: data_model.h:105
Version class containing the version information and helpers for comparison.
Definition: version.h:38
bool hasServerInfo() const
Definition: data_model.h:132
struct __attribute__((__packed__)) Pose
Definition: data_model.h:50
Data object holding the position of a single mocap marker in 3d space.
Definition: data_model.h:43
Data object holding server info.
Definition: data_model.h:111
TFSIMD_FORCE_INLINE const tfScalar & w() const
The data model for this node.
Definition: data_model.h:119
Data object describing a single tracked model.
Definition: data_model.h:80
std::vector< MarkerSet > markerSets
Definition: data_model.h:103
std::vector< Marker > otherMarkers
Definition: data_model.h:104


mocap_optitrack
Author(s): Kathrin Gräve , Alex Bencz/ , Tony Baltovski , JD Yamokoski
autogenerated on Fri Mar 26 2021 02:05:51