-
Notifications
You must be signed in to change notification settings - Fork 1
/
datastructs.proto
429 lines (383 loc) · 9.41 KB
/
datastructs.proto
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
syntax = "proto3";
package mapit.msgs;
// TODO: The id field might be obsolete. Hash can always be generated.
/**
* \brief A Tree like structure (commit: collection of maps, map: collection of layers, layer: collection of entities)
*
* A tree itself does not have a name. Each subelement of the tree does have a name.
* The id is the (sha) checksum of the referenced object (binary)
* The name is used to identify the object across versions.
*
* Versioning will be implemented in two steps:
* 1) Every object has a name (unique in the tree) and id (globaly uniqe, two ids reference the same object).
* Objects can be read and can be written to.
* 2) Objects can be read in the context of a commit OR a rolling commit (aka workspace).
* When writing in the context of this commit, changes are indexed/appended to a protocol.
*/
message Tree {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 2;
}
map<string, ObjectReference> refs = 2;
}
//// TODO: Entity may be ObjectReference
//// this builds up the tree structure. Tree has a list of references.
//// id or path: only exactly one of them must be set. id xor path.
//// id is the hash of an object after it was commited
//// path is [/]<workspaceName>/[<tree>/.../<entity>]
message ObjectReference {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 3;
}
string id = 1; // a hash of a tree, or entity.
string path = 2; // a path to a tree or entity.
//int64 lastChange = 3; // unix time
//string meta = 4;
}
// Not a good idea as it would be possible to build a hierarchy of objects in one object
//message GenericEntryOrReference
//{
// GenericEntry entry = 1;
// string reference = 2;
//}
// TODO: Using MessageType and GenericMessage would be more elegant (and performant?)
// Maybe give GenericEntry the filed "id" and remove it from concrete classes
enum MessageType
{
MessageTree = 0;
MessageEntity = 1;
MessageCommit = 2;
MessageWorkspace = 3;
MessageBranch = 4;
MessageEntitydata = 5;
MessageEmpty = 6;
}
message GenericEntry
{
MessageType type = 1;
Tree tree = 2;
Entity entity = 3;
Commit commit = 4;
WorkspaceObj workspace = 5;
Branch branch = 6;
bytes entityData = 7; // may be zero and stream contains data afterwards this object
}
/**
* \brief A map containing multiple layers, grouping them logically together.
*
* The layers of a map share the same coordinate system. If an operation on the map's layers results in a layer,
* which remains in the same coordinate system, a layer will be added to the originating map (for most operators \sa Operator ).
* If the layer is not in the same coordinate system, a new map will be created.
*/
//message Map {
// string name = 1;
// int64 id = 2;
// int64 lastChange = 3; // unix time
// repeated Layer layers = 4;
//}
/**
* \brief Type of binary layerdata saved
* For each type correspnding wrappers must exist which handle serialization of a layer using \sa LayerDataStreamProvider.
* Moreover spartial requests must be made possible by such a module \sa LayerData.
*/
enum LayerType {
NONE = 0;
ANY_RAW = 1;
POINTCLOUD = 4;
OCTOMAP = 5;
OPENVDB = 6;
TF = 7;
BOUNDINGBOX = 8;
ASSET = 9;
LAST_PREDEFINED = 32;
}
enum LayerUsageType {
LASER = 0;
RADAR = 1;
NAVIGATION = 2;
ANNOTATION = 3;
}
//message Layer {
// string name = 1;
// string id = 2;
// LayerType type = 3;
// LayerUsageType usageType = 4;
// repeated Entity entities = 5;
//}
message Entity {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 4;
}
Time stamp = 1;
string frame_id = 2;
string dataId = 3; // Hash of the complete entity data stream
//LayerType type = 3;
string type = 4;
LayerUsageType usageType = 5;
}
message Time {
uint32 sec = 1;
uint32 nsec = 2;
}
message Vector {
float x = 1;
float y = 2;
float z = 3;
}
message Quaternion {
float w = 4;
float x = 1;
float y = 2;
float z = 3;
}
message Transform {
Vector translation = 2;
Quaternion rotation = 3;
}
message TransformWithTime {
Time stamp = 1;
Transform transform = 3;
}
message TransformStampedList {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 5;
}
string frame_id = 1;
string child_frame_id = 2;
bool is_static = 4;
repeated TransformWithTime transforms = 3;
}
message TransformPath {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 51;
}
repeated Transform transforms = 1;
}
message Pose {
Vector translation = 1;
Quaternion rotation = 2;
}
message PosePath {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 53;
}
repeated Pose poses = 1;
}
message Primitive {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 60;
}
// All primitives are 1 unit in size and must be transformed to fit
enum PrimitiveType {
SPHERE = 0;
CUBE = 1;
PLANE = 2;
CYLINDER = 3;
CONE = 4;
CAPSULE = 5;
TORUS = 6;
DISC = 7;
POINT = 8;
ARROW = 9;
LINE = 10;
TEXT = 11;
ICON = 12;
}
PrimitiveType type = 1;
string text = 2;
string data = 3;
}
message Boundingbox {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 50;
}
float x1 = 1; // left
float y1 = 2; // top
float x2 = 3; // right
float y2 = 4; // bottom
}
message CommitRef {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 6;
}
Commit commit = 1;
Branch branch = 2;
// CommitRef ref = 3; // complete git ref syntax can not be implemented using members here
// int32 ancestor = 4;
// int32 sibling = 5;
}
message Branch {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 7;
}
// string name = 1;
string commitId = 2;
}
message WorkspaceObj {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 8;
}
Commit rollingCommit = 1; // This commit is exclusive for this workspace. It's parent is the last commit that is sealed and has no paths as ids.
// stored references or copies. Contains all data of the workspace.
// Advantage over git. no copy is created
// TODO: Not needed ?
//repeated string transientOids = 2;
map<string, string> transientOidsToOrigin = 2;
}
message Commit {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 9;
}
string commitMessage = 1;
string author = 2;
Time stamp = 3;
repeated string parentCommitIds = 4;
repeated OperationDescription ops = 5; // Also tracks renames via "update metadata" operator. Thus the history of a map can be restored, although the name changed.
// repeated ObjectVersion maps = 4;
// repeated ObjectVersion entities = 5;
// Maps objectIds in this commit to Ids from parentCommit. TODO: Must be a multimap? in a merge, there might be multiple parents.
// Note: deletions are transitions to -> NULL?
message ObjectIdPair {
string sourceObjectId = 1;
string parentObjectId = 2;
}
repeated ObjectIdPair transitions = 6;
// contains all hashes after each (StreamProvider write) step
message ObjectIdList {
string sourceObjectId = 1;
repeated string objectId = 2;
}
repeated ObjectIdList detailedTransitions = 7;
// Entrypoint to Tree with children hierarchy: root-> maps -> layers -> entities
ObjectReference root = 8;
}
message Conflict {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 10;
}
string path = 1;
repeated string objectIds = 2;
}
//message ObjectVersion {
// int64 id = 1;
// string commitId = 2;
//}
message OperatorDescription {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 15;
}
string operatorName = 1;
int32 operatorVersion = 2;
bool restorable = 3;
}
message OperationDescription {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 11;
}
OperatorDescription operator = 1;
string params = 3;
}
//temporary use prototype for pointcloud2
message Pointcloud2Header {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 12;
}
uint32 seq = 1;
uint64 stamp = 2;
string frame_id = 3;
}
message Pointcloud2PointField {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 13;
}
string name = 1;
uint32 offset = 2;
int32 datatype = 3;
uint32 count = 4;
}
message Pointcloud2 {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 14;
}
Pointcloud2Header header = 1;
uint32 height = 2;
uint32 width = 3;
repeated Pointcloud2PointField fields = 4;
bool is_bigendian = 5;
uint32 point_step = 6;
uint32 row_step = 7;
bytes data = 8;
bool is_dense = 9;
}
/**
* 2D map data as occupancy grid
*/
message Grid2D {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 15;
}
float resolution = 1;
uint32 width = 2;
uint32 height = 3;
// TODO rename
// Position of origin
Pose origin = 4;
bytes data = 5;
}
/**
* 2D LaserSca data
*/
message LaserScan2D {
enum CompType {
PROTO_3 = 0;
COMP_ID = 1;
MSG_TYPE = 16;
}
float angle_min = 1;
float angle_max = 2;
float angle_increment = 3;
float time_increment = 4;
float scan_time = 5;
float range_min = 6;
float range_max = 7;
repeated float ranges = 8;
repeated float intensities = 9;
}