-
Notifications
You must be signed in to change notification settings - Fork 11
/
WearableData.thrift
194 lines (160 loc) · 3.8 KB
/
WearableData.thrift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
// SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
// SPDX-License-Identifier: BSD-3-Clause
namespace yarp wearable.msg
// ================
// Sensors metadata
// ================
enum SensorStatus {
ERROR,
OK,
CALIBRATING,
DATA_OVERFLOW,
TIMEOUT,
UNKNOWN,
WAITING_FOR_FIRST_READ,
}
struct SensorInfo{
1: string name;
2: SensorStatus status = SensorStatus.UNKNOWN;
}
// =====================
// Elementary data types
// =====================
struct VectorXYZ {
1: double x;
2: double y;
3: double z;
}
struct VectorRPY {
1: double r;
2: double p;
3: double y;
}
struct QuaternionWXYZ {
1: double w;
2: double x;
3: double y;
4: double z;
}
// ==========================
// Composed sensor data types
// ==========================
struct ForceTorque6DSensorData {
1: VectorXYZ force;
2: VectorXYZ torque;
}
struct PoseSensorData {
1: QuaternionWXYZ orientation;
2: VectorXYZ position;
}
struct VirtualLinkKinSensorData {
1: QuaternionWXYZ orientation;
2: VectorXYZ position;
3: VectorXYZ linearVelocity;
4: VectorXYZ angularVelocity;
5: VectorXYZ linearAcceleration;
6: VectorXYZ angularAcceleration;
}
struct VirtualJointKinSensorData {
1: double position;
2: double velocity;
3: double acceleration;
}
struct VirtualSphericalJointKinSensorData {
1: VectorRPY angle;
2: VectorXYZ velocity;
3: VectorXYZ acceleration;
}
struct EmgData {
1: double value;
2: double normalization;
}
// =================
// Sensor structures
// =================
struct Accelerometer {
1: SensorInfo info;
2: VectorXYZ data;
}
struct EmgSensor {
1: SensorInfo info;
2: EmgData data;
}
struct FreeBodyAccelerationSensor {
1: SensorInfo info;
2: VectorXYZ data;
}
struct Force3DSensor {
1: SensorInfo info;
2: VectorXYZ data;
}
struct ForceTorque6DSensor {
1: SensorInfo info;
2: ForceTorque6DSensorData data;
}
struct Gyroscope {
1: SensorInfo info;
2: VectorXYZ data;
}
struct Magnetometer {
1: SensorInfo info;
2: VectorXYZ data;
}
struct OrientationSensor {
1: SensorInfo info;
2: QuaternionWXYZ data;
}
struct PoseSensor {
1: SensorInfo info;
2: PoseSensorData data;
}
struct PositionSensor {
1: SensorInfo info;
2: VectorXYZ data;
}
struct SkinSensor {
1: SensorInfo info;
2: list<double> data;
}
struct TemperatureSensor {
1: SensorInfo info;
2: double data;
}
struct Torque3DSensor {
1: SensorInfo info;
2: VectorXYZ data;
}
struct VirtualLinkKinSensor {
1: SensorInfo info;
2: VirtualLinkKinSensorData data;
}
struct VirtualJointKinSensor {
1: SensorInfo info;
2: VirtualJointKinSensorData data;
}
struct VirtualSphericalJointKinSensor {
1: SensorInfo info;
2: VirtualSphericalJointKinSensorData data;
}
// ========================
// Complete WearData struct
// ========================
struct WearableData {
1: required string producerName;
2: optional map<string,Accelerometer> accelerometers;
3: optional map<string,EmgSensor> emgSensors;
4: optional map<string,Force3DSensor> force3DSensors;
5: optional map<string,ForceTorque6DSensor> forceTorque6DSensors;
6: optional map<string,FreeBodyAccelerationSensor> freeBodyAccelerationSensors;
7: optional map<string,Gyroscope> gyroscopes;
8: optional map<string,Magnetometer> magnetometers;
9: optional map<string,OrientationSensor> orientationSensors;
10: optional map<string,PoseSensor> poseSensors;
11: optional map<string,PositionSensor> positionSensors;
12: optional map<string,SkinSensor> skinSensors;
13: optional map<string,TemperatureSensor> temperatureSensors;
14: optional map<string,Torque3DSensor> torque3DSensors;
15: optional map<string,VirtualLinkKinSensor> virtualLinkKinSensors;
16: optional map<string,VirtualJointKinSensor> virtualJointKinSensors;
17: optional map<string,VirtualSphericalJointKinSensor> virtualSphericalJointKinSensors;
}