-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathosmap.proto
111 lines (93 loc) · 3.59 KB
/
osmap.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
/**
* This file is part of OSMAP.
*
* Copyright (C) 2018-2019 Alejandro Silvestri <alejandrosilvestri at gmail>
* For more information see <https://github.com/AlejandroSilvestri/osmap>
*
* OSMAP is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OSMAP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMAP. If not, see <http://www.gnu.org/licenses/>.
*/
/*
OSMAP: Map serialization structure definition, for ORB-SLAM2.
Messages are ORB-SLAM2 objects minimal serialization. They ommit not used properties: those effimeral and those that can be regenerated.
Repeated fields can be ommited. Their ommission can compromise the map integrity.
*/
syntax = "proto3";
// 256 bits descriptor: 32 bytes, 8 uint32. Exactly 8 fixed32 required.
message SerializedDescriptor{
repeated fixed32 block = 1;
}
// Pose, first 12 elements in an homogeneous 4x4 pose matrix. Exactly 12 float required.
message SerializedPose{
repeated float element = 1;
}
// 3x1 Mat 3D position, all 3 fields required.
message SerializedPosition{
float x = 1;
float y = 2;
float z = 3;
}
// KeyPoint, all 4 fields required.
message SerializedKeypoint{
float ptx = 1;
float pty = 2;
float angle = 3;
float octave = 4;
}
// Intrinsic matrix K, all 4 fields required.
message SerializedK{
float fx = 1;
float fy = 2;
float cx = 3;
float cy = 4;
}
message SerializedKArray{
repeated SerializedK k = 1;
}
// MapPoint, all fields optional, should provide position at least.
message SerializedMappoint{
uint32 id = 1; // mnId
SerializedPosition position = 2; // mWorldPos
float visible = 3; // mnVisible
float found = 4; // mnFound
SerializedDescriptor briefdescriptor = 5; // mDescriptor, very optional. This field is named briefdescriptor instead of descriptor because the latter es a reserved word in protocol buffers.
}
message SerializedMappointArray{
repeated SerializedMappoint mappoint = 1;
}
// KeyFrame, all fields optional, should provide pose at least.
message SerializedKeyframe{
uint32 id = 1; // mnId
SerializedPose pose = 2; // mTcw
SerializedK kmatrix = 3; // K matrix, alternative to index k
uint32 kindex = 4; // index to matrix list K, ignored if kmatrix is present
repeated uint32 loopedgesids = 5; // indexes to keyframes connected in a loop
double timestamp = 6; // Time stamp
}
message SerializedKeyframeArray{
repeated SerializedKeyframe keyframe = 1;
}
// One observed feature in a keyframe.
message SerializedFeature{
uint32 mappoint_id = 2; // mappoint id used to construct mvpMapPoints
SerializedKeypoint keypoint = 3; // element of mvKeysUn
SerializedDescriptor briefdescriptor = 4; // row of mDescriptors. This field is named briefdescriptor instead of descriptor because the latter es a reserved word in protocol buffers.
}
// All observed features in a keyframe. keyframe_id required.
message SerializedKeyframeFeatures{
uint32 keyframe_id = 1; // kfId, keyframe id
repeated SerializedFeature feature = 2;
}
message SerializedKeyframeFeaturesArray{
repeated SerializedKeyframeFeatures feature = 1;
}