Main Page
Namespaces
Classes
Files
File List
File Members
include
mocap_optitrack
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
36
#include <
mocap_optitrack/version.h
>
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
;
72
Pose
pose
;
73
float
meanMarkerError
;
74
bool
isTrackingValid
;
75
76
bool
hasValidData()
const
;
77
};
78
80
struct
ModelDescription
81
{
82
ModelDescription
();
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
111
struct
ServerInfo
112
{
113
ServerInfo
();
114
Version
natNetVersion
;
115
Version
serverVersion
;
116
};
117
119
class
DataModel
120
{
121
public
:
122
DataModel
();
123
124
int
frameNumber
;
125
ModelFrame
dataFrame
;
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
:
138
ServerInfo
serverInfo
;
139
bool
hasValidServerInfo
;
140
};
141
142
}
143
144
#endif
mocap_optitrack::Marker::z
float z
Definition:
data_model.h:47
mocap_optitrack::MarkerSet::markers
std::vector< Marker > markers
Definition:
data_model.h:94
mocap_optitrack::RigidBody
Data object holding information about a single rigid body within a mocap skeleton.
Definition:
data_model.h:68
mocap_optitrack::ServerInfo::natNetVersion
Version natNetVersion
Definition:
data_model.h:114
mocap_optitrack::DataModel::frameNumber
int frameNumber
Definition:
data_model.h:124
mocap_optitrack::ModelFrame
Data object holding poses of a tracked model's components.
Definition:
data_model.h:98
mocap_optitrack::ModelDescription::markerNames
std::vector< std::string > markerNames
Definition:
data_model.h:86
mocap_optitrack::ModelFrame::rigidBodies
std::vector< RigidBody > rigidBodies
Definition:
data_model.h:105
mocap_optitrack::Version
Version class containing the version information and helpers for comparison.
Definition:
version.h:38
mocap_optitrack::MarkerSet
Definition:
data_model.h:89
mocap_optitrack::DataModel::hasValidServerInfo
bool hasValidServerInfo
Definition:
data_model.h:139
mocap_optitrack::ModelFrame::latency
float latency
Definition:
data_model.h:107
mocap_optitrack::ServerInfo::serverVersion
Version serverVersion
Definition:
data_model.h:115
mocap_optitrack::RigidBody::pose
Pose pose
Definition:
data_model.h:72
mocap_optitrack::DataModel::hasServerInfo
bool hasServerInfo() const
Definition:
data_model.h:132
tf::Transform
mocap_optitrack::__attribute__
struct __attribute__((__packed__)) Pose
Definition:
data_model.h:50
mocap_optitrack::Marker::y
float y
Definition:
data_model.h:46
mocap_optitrack::Marker
Data object holding the position of a single mocap marker in 3d space.
Definition:
data_model.h:43
mocap_optitrack::ServerInfo
Data object holding server info.
Definition:
data_model.h:111
version.h
mocap_optitrack::ModelDescription::name
std::string name
Definition:
data_model.h:85
w
TFSIMD_FORCE_INLINE const tfScalar & w() const
mocap_optitrack::DataModel
The data model for this node.
Definition:
data_model.h:119
mocap_optitrack::ModelDescription
Data object describing a single tracked model.
Definition:
data_model.h:80
mocap_optitrack::RigidBody::bodyId
int bodyId
Definition:
data_model.h:71
mocap_optitrack::ModelFrame::markerSets
std::vector< MarkerSet > markerSets
Definition:
data_model.h:103
mocap_optitrack::Marker::x
float x
Definition:
data_model.h:45
mocap_optitrack
Definition:
data_model.h:38
mocap_optitrack::RigidBody::meanMarkerError
float meanMarkerError
Definition:
data_model.h:73
mocap_optitrack::DataModel::dataFrame
ModelFrame dataFrame
Definition:
data_model.h:125
mocap_optitrack::RigidBody::isTrackingValid
bool isTrackingValid
Definition:
data_model.h:74
mocap_optitrack::ModelFrame::otherMarkers
std::vector< Marker > otherMarkers
Definition:
data_model.h:104
mocap_optitrack::DataModel::serverInfo
ServerInfo serverInfo
Definition:
data_model.h:135
mocap_optitrack
Author(s): Kathrin Gräve
, Alex Bencz/
, Tony Baltovski
, JD Yamokoski
autogenerated on Fri Mar 26 2021 02:05:51