-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathroborock_map_file.ksy
289 lines (287 loc) · 6.19 KB
/
roborock_map_file.ksy
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
meta:
id: roborock_map_file
title: Roborock vacuum map format
license: CC-BY-SA-4.0
ks-version: 0.9
endian: le
bit-endian: be
seq:
- id: magic
contents: 'rr'
- id: header
type: header
- id: blocks
type: block
repeat: eos
types:
header:
seq:
- id: header_length
type: u2
- id: data_length
type: u4
- id: version
type: version
- id: map_index
type: u4
- id: map_sequence
type: u4
version:
seq:
- id: major
type: u2
- id: minor
type: u2
block:
seq:
- id: type
type: u2
enum: block_type
- id: header_length
type: u2
- id: data_length
type: u4
- id: data
size: data_length + (header_length - 8)
type:
switch-on: type
cases:
"block_type::image": image_block_data
"block_type::charger_location": position_block_data
"block_type::path": path_block_data
"block_type::goto_path": path_block_data
"block_type::goto_predicted_path": path_block_data
"block_type::currently_cleaned_zones": dual_point_structures_block_data
"block_type::goto_target": position_block_data
"block_type::robot_position": position_block_data
"block_type::no_go_zones": quad_point_structures_block_data
"block_type::virtual_walls": dual_point_structures_block_data
"block_type::active_segments": active_segments_block_data
"block_type::no_mop_zones": quad_point_structures_block_data
"block_type::obstacles_1": obstacles_1_block_data
"block_type::ignored_obstacles_1": obstacles_1_block_data
"block_type::obstacles_2": obstacles_2_block_data
"block_type::ignored_obstacles_2": ignored_obstacles_2_block_data
"block_type::carpet_map": image_block_data
"block_type::digest": digest_block_data
image_block_data:
seq:
- id: segment_count
type: u4
if: _parent.header_length == 28
- id: top
type: u4
- id: left
type: u4
- id: height
type: u4
- id: width
type: u4
- id: pixels
type: pixel
repeat: eos
pixel:
seq:
- id: segment_id
type: b5
- id: type
enum: pixel_type
type: b3
position_block_data:
seq:
- id: x
type: u4
- id: y
type: u4
- id: angle
type: s4
if: _parent.data_length == 12
path_block_data:
seq:
- id: point_count
type: u4
- id: unknown_01
type: u4
- id: angle
type: s4
- id: points
type: point
repeat: eos
point:
seq:
- id: x
type: u2
- id: y
type: u2
dual_point_structures_block_data:
seq:
- id: count
type: u4
- id: structures
type: dual_point_structure
repeat: eos
quad_point_structures_block_data:
seq:
- id: count
type: u4
- id: structures
type: quad_point_structure
repeat: eos
dual_point_structure:
seq:
- id: x0
type: u2
- id: y0
type: u2
- id: x1
type: u2
- id: x2
type: u2
quad_point_structure:
seq:
- id: x0
type: u2
- id: y0
type: u2
- id: x1
type: u2
- id: x2
type: u2
- id: x3
type: u2
- id: y3
type: u2
- id: x4
type: u2
- id: y4
type: u2
active_segments_block_data:
seq:
- id: count
type: u4
- id: segment_ids
type: u1
repeat: eos
obstacle1_structure:
seq:
- id: x0
type: u2
- id: y0
type: u2
- id: unknown1
type: u1
ignored_obstacle2_structure:
seq:
- id: x0
type: u2
- id: y0
type: u2
- id: obstacle_type
enum: obstacle_type
type: u2
obstacle2_structure_no_photo:
seq:
- id: x0
type: u2
- id: y0
type: u2
- id: obstacle_type
enum: obstacle_type
type: u2
- id: confidence
type: u2
- id: unknown2
type: u2
- id: unknown3
type: u4
obstacle2_structure_photo:
seq:
- id: x0
type: u2
- id: y0
type: u2
- id: obstacle_type
enum: obstacle_type
type: u2
- id: confidence
type: u2
- id: photo_text
size: 20
type: str
encoding: utf8
obstacles_1_block_data:
seq:
- id: count
type: u4
- id: obstacles1_ids
type: obstacle1_structure
repeat: eos
obstacles_2_block_data:
seq:
- id: count
type: u4
- id: photo_obstacles2_ids
type: obstacle2_structure_photo
if: _parent.data_length / count == 28
repeat: eos
- id: no_photo_obstacles2_ids
type: obstacle2_structure_no_photo
if: (_parent.data_length / count) < 28
repeat: eos
ignored_obstacles_2_block_data:
seq:
- id: count
type: u4
- id: obstacles1_ids
type: ignored_obstacle2_structure
repeat: eos
digest_block_data:
seq:
- id: hash
size: 12
- id: unknown
size: (_parent.data_length - 12)
enums:
block_type:
1: "charger_location"
2: "image"
3: "path"
4: "goto_path"
5: "goto_predicted_path"
6: "currently_cleaned_zones"
7: "goto_target"
8: "robot_position"
9: "no_go_zones"
10: "virtual_walls"
11: "active_segments"
12: "no_mop_zones"
13: "obstacles_1"
14: "ignored_obstacles_1"
15: "obstacles_2"
16: "ignored_obstacles_2"
17: "carpet_map"
18: "mop_path"
19: "carpet_forbidden_area"
1024: "digest"
pixel_type:
0: "none"
1: "wall"
2: "floor"
3: "floor"
4: "floor"
5: "floor"
6: "floor"
7: "floor"
obstacle_type:
0: "wire"
1: "pet_waste"
2: "footwear"
3: "pedestal"
4: "pedestal"
5: "power_strip"
9: "scale"
10: "fabric"
18: "dustpan"
25: "dustpan"
26: "bar"
27: "bar"