@blueyerobotics/protocol-definitions 3.4.0-8187f91a → 3.4.0-eddb8a5e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/slam.js ADDED
@@ -0,0 +1,2427 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.7
4
+ // protoc v3.21.12
5
+ // source: slam.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { Timestamp } from "./google/protobuf/timestamp.js";
9
+ import { guestPortDeviceIDFromJSON, guestPortDeviceIDToJSON, PointCloud, Quaternion, storageLocationFromJSON, storageLocationToJSON, Vector3, } from "./message_formats.js";
10
+ /**
11
+ * SLAM
12
+ *
13
+ * The SLAM's (simultaneous localization and mapping) state, poses, map and
14
+ * sensors: what its telemetry (Slam*Tel in telemetry.proto) and its requests
15
+ * (in req_rep.proto) carry.
16
+ *
17
+ * The SLAM has its own publisher, not the drone's telemetry socket: a client
18
+ * subscribes to it on the drone at TCP port 5561 (WebSocket 9989) to get the
19
+ * Slam*Tel messages. Its requests (GetSlamMapReq, ResetSlamReq,
20
+ * SetSlamActiveReq, SetSlamSensorSettingsReq, SetSlamRecordingReq) go to the
21
+ * drone's request server as other requests do, which forwards them to the
22
+ * SLAM's (TCP 5562, WebSocket 9990).
23
+ *
24
+ * These messages change only by addition: new fields, messages, enum values and
25
+ * oneof members, never a field renumbered, retyped or given another meaning (CI
26
+ * checks the numbers and types, ci-buf.yaml). A client ignores what it does not
27
+ * know: an enum value as UNSPECIFIED, a oneof set to a member it does not know as
28
+ * unset (a submap with such content keeps its id and anchor and shows nothing),
29
+ * and fields it does not know. Packed bytes (PointCloud, SlamKeyframePoses) keep
30
+ * their layout: more data per point or per pose comes in a field of its own, with
31
+ * the same count.
32
+ */
33
+ /** State of the SLAM (simultaneous localization and mapping). */
34
+ export var SlamState;
35
+ (function (SlamState) {
36
+ /** SLAM_STATE_UNSPECIFIED - Unspecified. */
37
+ SlamState[SlamState["SLAM_STATE_UNSPECIFIED"] = 0] = "SLAM_STATE_UNSPECIFIED";
38
+ /** SLAM_STATE_WAITING - Waiting for the first scan and orientation. */
39
+ SlamState[SlamState["SLAM_STATE_WAITING"] = 1] = "SLAM_STATE_WAITING";
40
+ /** SLAM_STATE_TRACKING - The latest scan was matched against the map. */
41
+ SlamState[SlamState["SLAM_STATE_TRACKING"] = 2] = "SLAM_STATE_TRACKING";
42
+ /** SLAM_STATE_COASTING - The latest scan could not be matched; the pose follows the motion model. */
43
+ SlamState[SlamState["SLAM_STATE_COASTING"] = 3] = "SLAM_STATE_COASTING";
44
+ /**
45
+ * SLAM_STATE_LOST - Coasting long enough that the prediction may be far off: a scan is placed again only by a match
46
+ * that fixes the pose firmly.
47
+ */
48
+ SlamState[SlamState["SLAM_STATE_LOST"] = 4] = "SLAM_STATE_LOST";
49
+ SlamState[SlamState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
50
+ })(SlamState || (SlamState = {}));
51
+ export function slamStateFromJSON(object) {
52
+ switch (object) {
53
+ case 0:
54
+ case "SLAM_STATE_UNSPECIFIED":
55
+ return SlamState.SLAM_STATE_UNSPECIFIED;
56
+ case 1:
57
+ case "SLAM_STATE_WAITING":
58
+ return SlamState.SLAM_STATE_WAITING;
59
+ case 2:
60
+ case "SLAM_STATE_TRACKING":
61
+ return SlamState.SLAM_STATE_TRACKING;
62
+ case 3:
63
+ case "SLAM_STATE_COASTING":
64
+ return SlamState.SLAM_STATE_COASTING;
65
+ case 4:
66
+ case "SLAM_STATE_LOST":
67
+ return SlamState.SLAM_STATE_LOST;
68
+ case -1:
69
+ case "UNRECOGNIZED":
70
+ default:
71
+ return SlamState.UNRECOGNIZED;
72
+ }
73
+ }
74
+ export function slamStateToJSON(object) {
75
+ switch (object) {
76
+ case SlamState.SLAM_STATE_UNSPECIFIED:
77
+ return "SLAM_STATE_UNSPECIFIED";
78
+ case SlamState.SLAM_STATE_WAITING:
79
+ return "SLAM_STATE_WAITING";
80
+ case SlamState.SLAM_STATE_TRACKING:
81
+ return "SLAM_STATE_TRACKING";
82
+ case SlamState.SLAM_STATE_COASTING:
83
+ return "SLAM_STATE_COASTING";
84
+ case SlamState.SLAM_STATE_LOST:
85
+ return "SLAM_STATE_LOST";
86
+ case SlamState.UNRECOGNIZED:
87
+ default:
88
+ return "UNRECOGNIZED";
89
+ }
90
+ }
91
+ /** Kind of sensor a SLAM scan comes from. */
92
+ export var SlamSensorType;
93
+ (function (SlamSensorType) {
94
+ /** SLAM_SENSOR_TYPE_UNSPECIFIED - Unspecified. */
95
+ SlamSensorType[SlamSensorType["SLAM_SENSOR_TYPE_UNSPECIFIED"] = 0] = "SLAM_SENSOR_TYPE_UNSPECIFIED";
96
+ /** SLAM_SENSOR_TYPE_SONAR_3D - A 3D imaging sonar, e.g. the Water Linked Sonar 3D-15. */
97
+ SlamSensorType[SlamSensorType["SLAM_SENSOR_TYPE_SONAR_3D"] = 1] = "SLAM_SENSOR_TYPE_SONAR_3D";
98
+ /** SLAM_SENSOR_TYPE_STEREO_CAMERA - A stereo camera's depth. */
99
+ SlamSensorType[SlamSensorType["SLAM_SENSOR_TYPE_STEREO_CAMERA"] = 2] = "SLAM_SENSOR_TYPE_STEREO_CAMERA";
100
+ SlamSensorType[SlamSensorType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
101
+ })(SlamSensorType || (SlamSensorType = {}));
102
+ export function slamSensorTypeFromJSON(object) {
103
+ switch (object) {
104
+ case 0:
105
+ case "SLAM_SENSOR_TYPE_UNSPECIFIED":
106
+ return SlamSensorType.SLAM_SENSOR_TYPE_UNSPECIFIED;
107
+ case 1:
108
+ case "SLAM_SENSOR_TYPE_SONAR_3D":
109
+ return SlamSensorType.SLAM_SENSOR_TYPE_SONAR_3D;
110
+ case 2:
111
+ case "SLAM_SENSOR_TYPE_STEREO_CAMERA":
112
+ return SlamSensorType.SLAM_SENSOR_TYPE_STEREO_CAMERA;
113
+ case -1:
114
+ case "UNRECOGNIZED":
115
+ default:
116
+ return SlamSensorType.UNRECOGNIZED;
117
+ }
118
+ }
119
+ export function slamSensorTypeToJSON(object) {
120
+ switch (object) {
121
+ case SlamSensorType.SLAM_SENSOR_TYPE_UNSPECIFIED:
122
+ return "SLAM_SENSOR_TYPE_UNSPECIFIED";
123
+ case SlamSensorType.SLAM_SENSOR_TYPE_SONAR_3D:
124
+ return "SLAM_SENSOR_TYPE_SONAR_3D";
125
+ case SlamSensorType.SLAM_SENSOR_TYPE_STEREO_CAMERA:
126
+ return "SLAM_SENSOR_TYPE_STEREO_CAMERA";
127
+ case SlamSensorType.UNRECOGNIZED:
128
+ default:
129
+ return "UNRECOGNIZED";
130
+ }
131
+ }
132
+ /** What the SLAM's poses are the poses of: its platform. */
133
+ export var SlamPlatform;
134
+ (function (SlamPlatform) {
135
+ /** SLAM_PLATFORM_UNSPECIFIED - Not known. */
136
+ SlamPlatform[SlamPlatform["SLAM_PLATFORM_UNSPECIFIED"] = 0] = "SLAM_PLATFORM_UNSPECIFIED";
137
+ /**
138
+ * SLAM_PLATFORM_DRONE - The drone, its body frame x forward, y right, z down from the middle of the hull. Each
139
+ * sensor is on it through its mount (SlamPose mount in the messages that carry one).
140
+ */
141
+ SlamPlatform[SlamPlatform["SLAM_PLATFORM_DRONE"] = 1] = "SLAM_PLATFORM_DRONE";
142
+ /** SLAM_PLATFORM_SENSOR - The sensor itself: the SLAM did not know how the sensor is mounted. */
143
+ SlamPlatform[SlamPlatform["SLAM_PLATFORM_SENSOR"] = 2] = "SLAM_PLATFORM_SENSOR";
144
+ SlamPlatform[SlamPlatform["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
145
+ })(SlamPlatform || (SlamPlatform = {}));
146
+ export function slamPlatformFromJSON(object) {
147
+ switch (object) {
148
+ case 0:
149
+ case "SLAM_PLATFORM_UNSPECIFIED":
150
+ return SlamPlatform.SLAM_PLATFORM_UNSPECIFIED;
151
+ case 1:
152
+ case "SLAM_PLATFORM_DRONE":
153
+ return SlamPlatform.SLAM_PLATFORM_DRONE;
154
+ case 2:
155
+ case "SLAM_PLATFORM_SENSOR":
156
+ return SlamPlatform.SLAM_PLATFORM_SENSOR;
157
+ case -1:
158
+ case "UNRECOGNIZED":
159
+ default:
160
+ return SlamPlatform.UNRECOGNIZED;
161
+ }
162
+ }
163
+ export function slamPlatformToJSON(object) {
164
+ switch (object) {
165
+ case SlamPlatform.SLAM_PLATFORM_UNSPECIFIED:
166
+ return "SLAM_PLATFORM_UNSPECIFIED";
167
+ case SlamPlatform.SLAM_PLATFORM_DRONE:
168
+ return "SLAM_PLATFORM_DRONE";
169
+ case SlamPlatform.SLAM_PLATFORM_SENSOR:
170
+ return "SLAM_PLATFORM_SENSOR";
171
+ case SlamPlatform.UNRECOGNIZED:
172
+ default:
173
+ return "UNRECOGNIZED";
174
+ }
175
+ }
176
+ /** Frequency mode of a 3D imaging sonar. */
177
+ export var Sonar3dFrequencyMode;
178
+ (function (Sonar3dFrequencyMode) {
179
+ /** SONAR_3D_FREQUENCY_MODE_UNSPECIFIED - Unspecified: left as it is. */
180
+ Sonar3dFrequencyMode[Sonar3dFrequencyMode["SONAR_3D_FREQUENCY_MODE_UNSPECIFIED"] = 0] = "SONAR_3D_FREQUENCY_MODE_UNSPECIFIED";
181
+ /** SONAR_3D_FREQUENCY_MODE_LOW - Wide view, long range (3D-15: 90° x 40°, 15 m, 5 scans/s). */
182
+ Sonar3dFrequencyMode[Sonar3dFrequencyMode["SONAR_3D_FREQUENCY_MODE_LOW"] = 1] = "SONAR_3D_FREQUENCY_MODE_LOW";
183
+ /** SONAR_3D_FREQUENCY_MODE_HIGH - Narrow view, short range, fine detail (3D-15: 40° x 40°, 4 m, 20 scans/s). */
184
+ Sonar3dFrequencyMode[Sonar3dFrequencyMode["SONAR_3D_FREQUENCY_MODE_HIGH"] = 2] = "SONAR_3D_FREQUENCY_MODE_HIGH";
185
+ Sonar3dFrequencyMode[Sonar3dFrequencyMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
186
+ })(Sonar3dFrequencyMode || (Sonar3dFrequencyMode = {}));
187
+ export function sonar3dFrequencyModeFromJSON(object) {
188
+ switch (object) {
189
+ case 0:
190
+ case "SONAR_3D_FREQUENCY_MODE_UNSPECIFIED":
191
+ return Sonar3dFrequencyMode.SONAR_3D_FREQUENCY_MODE_UNSPECIFIED;
192
+ case 1:
193
+ case "SONAR_3D_FREQUENCY_MODE_LOW":
194
+ return Sonar3dFrequencyMode.SONAR_3D_FREQUENCY_MODE_LOW;
195
+ case 2:
196
+ case "SONAR_3D_FREQUENCY_MODE_HIGH":
197
+ return Sonar3dFrequencyMode.SONAR_3D_FREQUENCY_MODE_HIGH;
198
+ case -1:
199
+ case "UNRECOGNIZED":
200
+ default:
201
+ return Sonar3dFrequencyMode.UNRECOGNIZED;
202
+ }
203
+ }
204
+ export function sonar3dFrequencyModeToJSON(object) {
205
+ switch (object) {
206
+ case Sonar3dFrequencyMode.SONAR_3D_FREQUENCY_MODE_UNSPECIFIED:
207
+ return "SONAR_3D_FREQUENCY_MODE_UNSPECIFIED";
208
+ case Sonar3dFrequencyMode.SONAR_3D_FREQUENCY_MODE_LOW:
209
+ return "SONAR_3D_FREQUENCY_MODE_LOW";
210
+ case Sonar3dFrequencyMode.SONAR_3D_FREQUENCY_MODE_HIGH:
211
+ return "SONAR_3D_FREQUENCY_MODE_HIGH";
212
+ case Sonar3dFrequencyMode.UNRECOGNIZED:
213
+ default:
214
+ return "UNRECOGNIZED";
215
+ }
216
+ }
217
+ /** Why the SLAM did not do what a request asked (the reply says what it did do). */
218
+ export var SlamRequestError;
219
+ (function (SlamRequestError) {
220
+ /** SLAM_REQUEST_ERROR_UNSPECIFIED - None: the request was done, or asked for what already was. */
221
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_UNSPECIFIED"] = 0] = "SLAM_REQUEST_ERROR_UNSPECIFIED";
222
+ /** SLAM_REQUEST_ERROR_NOT_READABLE - The request could not be read. */
223
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_NOT_READABLE"] = 1] = "SLAM_REQUEST_ERROR_NOT_READABLE";
224
+ /** SLAM_REQUEST_ERROR_OTHER_MAP - The request named a map that is not the current one. */
225
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_OTHER_MAP"] = 2] = "SLAM_REQUEST_ERROR_OTHER_MAP";
226
+ /** SLAM_REQUEST_ERROR_NO_SUCH_SENSOR - The request named a sensor the SLAM does not have, or named none where it has several that fit. */
227
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_NO_SUCH_SENSOR"] = 3] = "SLAM_REQUEST_ERROR_NO_SUCH_SENSOR";
228
+ /** SLAM_REQUEST_ERROR_SENSOR - The sensor did not take it (it did not answer, or refused). */
229
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_SENSOR"] = 4] = "SLAM_REQUEST_ERROR_SENSOR";
230
+ /** SLAM_REQUEST_ERROR_BUSY - Another change to the sensor is under way; ask again after it. */
231
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_BUSY"] = 5] = "SLAM_REQUEST_ERROR_BUSY";
232
+ /** SLAM_REQUEST_ERROR_NOT_MAPPING - It needs the SLAM to be mapping (a recording). */
233
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_NOT_MAPPING"] = 6] = "SLAM_REQUEST_ERROR_NOT_MAPPING";
234
+ /** SLAM_REQUEST_ERROR_STORAGE - No storage to record to, or it is full. */
235
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_STORAGE"] = 7] = "SLAM_REQUEST_ERROR_STORAGE";
236
+ /** SLAM_REQUEST_ERROR_NOT_SUPPORTED - The SLAM or its sensor cannot do it. */
237
+ SlamRequestError[SlamRequestError["SLAM_REQUEST_ERROR_NOT_SUPPORTED"] = 8] = "SLAM_REQUEST_ERROR_NOT_SUPPORTED";
238
+ SlamRequestError[SlamRequestError["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
239
+ })(SlamRequestError || (SlamRequestError = {}));
240
+ export function slamRequestErrorFromJSON(object) {
241
+ switch (object) {
242
+ case 0:
243
+ case "SLAM_REQUEST_ERROR_UNSPECIFIED":
244
+ return SlamRequestError.SLAM_REQUEST_ERROR_UNSPECIFIED;
245
+ case 1:
246
+ case "SLAM_REQUEST_ERROR_NOT_READABLE":
247
+ return SlamRequestError.SLAM_REQUEST_ERROR_NOT_READABLE;
248
+ case 2:
249
+ case "SLAM_REQUEST_ERROR_OTHER_MAP":
250
+ return SlamRequestError.SLAM_REQUEST_ERROR_OTHER_MAP;
251
+ case 3:
252
+ case "SLAM_REQUEST_ERROR_NO_SUCH_SENSOR":
253
+ return SlamRequestError.SLAM_REQUEST_ERROR_NO_SUCH_SENSOR;
254
+ case 4:
255
+ case "SLAM_REQUEST_ERROR_SENSOR":
256
+ return SlamRequestError.SLAM_REQUEST_ERROR_SENSOR;
257
+ case 5:
258
+ case "SLAM_REQUEST_ERROR_BUSY":
259
+ return SlamRequestError.SLAM_REQUEST_ERROR_BUSY;
260
+ case 6:
261
+ case "SLAM_REQUEST_ERROR_NOT_MAPPING":
262
+ return SlamRequestError.SLAM_REQUEST_ERROR_NOT_MAPPING;
263
+ case 7:
264
+ case "SLAM_REQUEST_ERROR_STORAGE":
265
+ return SlamRequestError.SLAM_REQUEST_ERROR_STORAGE;
266
+ case 8:
267
+ case "SLAM_REQUEST_ERROR_NOT_SUPPORTED":
268
+ return SlamRequestError.SLAM_REQUEST_ERROR_NOT_SUPPORTED;
269
+ case -1:
270
+ case "UNRECOGNIZED":
271
+ default:
272
+ return SlamRequestError.UNRECOGNIZED;
273
+ }
274
+ }
275
+ export function slamRequestErrorToJSON(object) {
276
+ switch (object) {
277
+ case SlamRequestError.SLAM_REQUEST_ERROR_UNSPECIFIED:
278
+ return "SLAM_REQUEST_ERROR_UNSPECIFIED";
279
+ case SlamRequestError.SLAM_REQUEST_ERROR_NOT_READABLE:
280
+ return "SLAM_REQUEST_ERROR_NOT_READABLE";
281
+ case SlamRequestError.SLAM_REQUEST_ERROR_OTHER_MAP:
282
+ return "SLAM_REQUEST_ERROR_OTHER_MAP";
283
+ case SlamRequestError.SLAM_REQUEST_ERROR_NO_SUCH_SENSOR:
284
+ return "SLAM_REQUEST_ERROR_NO_SUCH_SENSOR";
285
+ case SlamRequestError.SLAM_REQUEST_ERROR_SENSOR:
286
+ return "SLAM_REQUEST_ERROR_SENSOR";
287
+ case SlamRequestError.SLAM_REQUEST_ERROR_BUSY:
288
+ return "SLAM_REQUEST_ERROR_BUSY";
289
+ case SlamRequestError.SLAM_REQUEST_ERROR_NOT_MAPPING:
290
+ return "SLAM_REQUEST_ERROR_NOT_MAPPING";
291
+ case SlamRequestError.SLAM_REQUEST_ERROR_STORAGE:
292
+ return "SLAM_REQUEST_ERROR_STORAGE";
293
+ case SlamRequestError.SLAM_REQUEST_ERROR_NOT_SUPPORTED:
294
+ return "SLAM_REQUEST_ERROR_NOT_SUPPORTED";
295
+ case SlamRequestError.UNRECOGNIZED:
296
+ default:
297
+ return "UNRECOGNIZED";
298
+ }
299
+ }
300
+ /** Where the SLAM's orientation comes from. */
301
+ export var SlamOrientationSource;
302
+ (function (SlamOrientationSource) {
303
+ /** SLAM_ORIENTATION_SOURCE_UNSPECIFIED - None: the scans are matched without an orientation. */
304
+ SlamOrientationSource[SlamOrientationSource["SLAM_ORIENTATION_SOURCE_UNSPECIFIED"] = 0] = "SLAM_ORIENTATION_SOURCE_UNSPECIFIED";
305
+ /** SLAM_ORIENTATION_SOURCE_SENSOR_IMU - The sensor's own IMU. */
306
+ SlamOrientationSource[SlamOrientationSource["SLAM_ORIENTATION_SOURCE_SENSOR_IMU"] = 1] = "SLAM_ORIENTATION_SOURCE_SENSOR_IMU";
307
+ /** SLAM_ORIENTATION_SOURCE_DRONE_ATTITUDE - The drone's attitude, its heading from the compass. */
308
+ SlamOrientationSource[SlamOrientationSource["SLAM_ORIENTATION_SOURCE_DRONE_ATTITUDE"] = 2] = "SLAM_ORIENTATION_SOURCE_DRONE_ATTITUDE";
309
+ /** SLAM_ORIENTATION_SOURCE_DRONE_GYRO - The drone's attitude for roll and pitch, its turn from the drone's calibrated gyro (not the compass). */
310
+ SlamOrientationSource[SlamOrientationSource["SLAM_ORIENTATION_SOURCE_DRONE_GYRO"] = 3] = "SLAM_ORIENTATION_SOURCE_DRONE_GYRO";
311
+ SlamOrientationSource[SlamOrientationSource["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
312
+ })(SlamOrientationSource || (SlamOrientationSource = {}));
313
+ export function slamOrientationSourceFromJSON(object) {
314
+ switch (object) {
315
+ case 0:
316
+ case "SLAM_ORIENTATION_SOURCE_UNSPECIFIED":
317
+ return SlamOrientationSource.SLAM_ORIENTATION_SOURCE_UNSPECIFIED;
318
+ case 1:
319
+ case "SLAM_ORIENTATION_SOURCE_SENSOR_IMU":
320
+ return SlamOrientationSource.SLAM_ORIENTATION_SOURCE_SENSOR_IMU;
321
+ case 2:
322
+ case "SLAM_ORIENTATION_SOURCE_DRONE_ATTITUDE":
323
+ return SlamOrientationSource.SLAM_ORIENTATION_SOURCE_DRONE_ATTITUDE;
324
+ case 3:
325
+ case "SLAM_ORIENTATION_SOURCE_DRONE_GYRO":
326
+ return SlamOrientationSource.SLAM_ORIENTATION_SOURCE_DRONE_GYRO;
327
+ case -1:
328
+ case "UNRECOGNIZED":
329
+ default:
330
+ return SlamOrientationSource.UNRECOGNIZED;
331
+ }
332
+ }
333
+ export function slamOrientationSourceToJSON(object) {
334
+ switch (object) {
335
+ case SlamOrientationSource.SLAM_ORIENTATION_SOURCE_UNSPECIFIED:
336
+ return "SLAM_ORIENTATION_SOURCE_UNSPECIFIED";
337
+ case SlamOrientationSource.SLAM_ORIENTATION_SOURCE_SENSOR_IMU:
338
+ return "SLAM_ORIENTATION_SOURCE_SENSOR_IMU";
339
+ case SlamOrientationSource.SLAM_ORIENTATION_SOURCE_DRONE_ATTITUDE:
340
+ return "SLAM_ORIENTATION_SOURCE_DRONE_ATTITUDE";
341
+ case SlamOrientationSource.SLAM_ORIENTATION_SOURCE_DRONE_GYRO:
342
+ return "SLAM_ORIENTATION_SOURCE_DRONE_GYRO";
343
+ case SlamOrientationSource.UNRECOGNIZED:
344
+ default:
345
+ return "UNRECOGNIZED";
346
+ }
347
+ }
348
+ /** What the x axis of a SLAM map's frame points along. */
349
+ export var SlamHeadingReference;
350
+ (function (SlamHeadingReference) {
351
+ /** SLAM_HEADING_REFERENCE_UNSPECIFIED - Not known. */
352
+ SlamHeadingReference[SlamHeadingReference["SLAM_HEADING_REFERENCE_UNSPECIFIED"] = 0] = "SLAM_HEADING_REFERENCE_UNSPECIFIED";
353
+ /**
354
+ * SLAM_HEADING_REFERENCE_FIRST_SCAN - The platform's heading at the map's first scan; without gravity alignment, the
355
+ * platform's frame at the first scan as it is.
356
+ */
357
+ SlamHeadingReference[SlamHeadingReference["SLAM_HEADING_REFERENCE_FIRST_SCAN"] = 1] = "SLAM_HEADING_REFERENCE_FIRST_SCAN";
358
+ /** SLAM_HEADING_REFERENCE_DRONE_COMPASS - North, as the drone's compass heading (AttitudeTel yaw) gave it at the map's first scan. */
359
+ SlamHeadingReference[SlamHeadingReference["SLAM_HEADING_REFERENCE_DRONE_COMPASS"] = 2] = "SLAM_HEADING_REFERENCE_DRONE_COMPASS";
360
+ SlamHeadingReference[SlamHeadingReference["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
361
+ })(SlamHeadingReference || (SlamHeadingReference = {}));
362
+ export function slamHeadingReferenceFromJSON(object) {
363
+ switch (object) {
364
+ case 0:
365
+ case "SLAM_HEADING_REFERENCE_UNSPECIFIED":
366
+ return SlamHeadingReference.SLAM_HEADING_REFERENCE_UNSPECIFIED;
367
+ case 1:
368
+ case "SLAM_HEADING_REFERENCE_FIRST_SCAN":
369
+ return SlamHeadingReference.SLAM_HEADING_REFERENCE_FIRST_SCAN;
370
+ case 2:
371
+ case "SLAM_HEADING_REFERENCE_DRONE_COMPASS":
372
+ return SlamHeadingReference.SLAM_HEADING_REFERENCE_DRONE_COMPASS;
373
+ case -1:
374
+ case "UNRECOGNIZED":
375
+ default:
376
+ return SlamHeadingReference.UNRECOGNIZED;
377
+ }
378
+ }
379
+ export function slamHeadingReferenceToJSON(object) {
380
+ switch (object) {
381
+ case SlamHeadingReference.SLAM_HEADING_REFERENCE_UNSPECIFIED:
382
+ return "SLAM_HEADING_REFERENCE_UNSPECIFIED";
383
+ case SlamHeadingReference.SLAM_HEADING_REFERENCE_FIRST_SCAN:
384
+ return "SLAM_HEADING_REFERENCE_FIRST_SCAN";
385
+ case SlamHeadingReference.SLAM_HEADING_REFERENCE_DRONE_COMPASS:
386
+ return "SLAM_HEADING_REFERENCE_DRONE_COMPASS";
387
+ case SlamHeadingReference.UNRECOGNIZED:
388
+ default:
389
+ return "UNRECOGNIZED";
390
+ }
391
+ }
392
+ function createBaseSlamSensor() {
393
+ return { id: "", sensorType: 0, fovHorizontal: 0, fovVertical: 0, maxRange: 0, deviceId: 0, simulated: false };
394
+ }
395
+ export const SlamSensor = {
396
+ encode(message, writer = new BinaryWriter()) {
397
+ if (message.id !== "") {
398
+ writer.uint32(10).string(message.id);
399
+ }
400
+ if (message.sensorType !== 0) {
401
+ writer.uint32(16).int32(message.sensorType);
402
+ }
403
+ if (message.fovHorizontal !== 0) {
404
+ writer.uint32(29).float(message.fovHorizontal);
405
+ }
406
+ if (message.fovVertical !== 0) {
407
+ writer.uint32(37).float(message.fovVertical);
408
+ }
409
+ if (message.maxRange !== 0) {
410
+ writer.uint32(45).float(message.maxRange);
411
+ }
412
+ if (message.deviceId !== 0) {
413
+ writer.uint32(48).int32(message.deviceId);
414
+ }
415
+ if (message.simulated !== false) {
416
+ writer.uint32(56).bool(message.simulated);
417
+ }
418
+ return writer;
419
+ },
420
+ decode(input, length) {
421
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
422
+ const end = length === undefined ? reader.len : reader.pos + length;
423
+ const message = createBaseSlamSensor();
424
+ while (reader.pos < end) {
425
+ const tag = reader.uint32();
426
+ switch (tag >>> 3) {
427
+ case 1: {
428
+ if (tag !== 10) {
429
+ break;
430
+ }
431
+ message.id = reader.string();
432
+ continue;
433
+ }
434
+ case 2: {
435
+ if (tag !== 16) {
436
+ break;
437
+ }
438
+ message.sensorType = reader.int32();
439
+ continue;
440
+ }
441
+ case 3: {
442
+ if (tag !== 29) {
443
+ break;
444
+ }
445
+ message.fovHorizontal = reader.float();
446
+ continue;
447
+ }
448
+ case 4: {
449
+ if (tag !== 37) {
450
+ break;
451
+ }
452
+ message.fovVertical = reader.float();
453
+ continue;
454
+ }
455
+ case 5: {
456
+ if (tag !== 45) {
457
+ break;
458
+ }
459
+ message.maxRange = reader.float();
460
+ continue;
461
+ }
462
+ case 6: {
463
+ if (tag !== 48) {
464
+ break;
465
+ }
466
+ message.deviceId = reader.int32();
467
+ continue;
468
+ }
469
+ case 7: {
470
+ if (tag !== 56) {
471
+ break;
472
+ }
473
+ message.simulated = reader.bool();
474
+ continue;
475
+ }
476
+ }
477
+ if ((tag & 7) === 4 || tag === 0) {
478
+ break;
479
+ }
480
+ reader.skip(tag & 7);
481
+ }
482
+ return message;
483
+ },
484
+ fromJSON(object) {
485
+ return {
486
+ id: isSet(object.id) ? gt.String(object.id) : "",
487
+ sensorType: isSet(object.sensorType) ? slamSensorTypeFromJSON(object.sensorType) : 0,
488
+ fovHorizontal: isSet(object.fovHorizontal) ? gt.Number(object.fovHorizontal) : 0,
489
+ fovVertical: isSet(object.fovVertical) ? gt.Number(object.fovVertical) : 0,
490
+ maxRange: isSet(object.maxRange) ? gt.Number(object.maxRange) : 0,
491
+ deviceId: isSet(object.deviceId) ? guestPortDeviceIDFromJSON(object.deviceId) : 0,
492
+ simulated: isSet(object.simulated) ? gt.Boolean(object.simulated) : false,
493
+ };
494
+ },
495
+ toJSON(message) {
496
+ const obj = {};
497
+ if (message.id !== "") {
498
+ obj.id = message.id;
499
+ }
500
+ if (message.sensorType !== 0) {
501
+ obj.sensorType = slamSensorTypeToJSON(message.sensorType);
502
+ }
503
+ if (message.fovHorizontal !== 0) {
504
+ obj.fovHorizontal = message.fovHorizontal;
505
+ }
506
+ if (message.fovVertical !== 0) {
507
+ obj.fovVertical = message.fovVertical;
508
+ }
509
+ if (message.maxRange !== 0) {
510
+ obj.maxRange = message.maxRange;
511
+ }
512
+ if (message.deviceId !== 0) {
513
+ obj.deviceId = guestPortDeviceIDToJSON(message.deviceId);
514
+ }
515
+ if (message.simulated !== false) {
516
+ obj.simulated = message.simulated;
517
+ }
518
+ return obj;
519
+ },
520
+ create(base) {
521
+ return SlamSensor.fromPartial(base ?? {});
522
+ },
523
+ fromPartial(object) {
524
+ const message = createBaseSlamSensor();
525
+ message.id = object.id ?? "";
526
+ message.sensorType = object.sensorType ?? 0;
527
+ message.fovHorizontal = object.fovHorizontal ?? 0;
528
+ message.fovVertical = object.fovVertical ?? 0;
529
+ message.maxRange = object.maxRange ?? 0;
530
+ message.deviceId = object.deviceId ?? 0;
531
+ message.simulated = object.simulated ?? false;
532
+ return message;
533
+ },
534
+ };
535
+ function createBaseSlamRecordingState() {
536
+ return { isRecording: false, name: "", seconds: 0, size: 0, sensorData: false, storageLocation: 0 };
537
+ }
538
+ export const SlamRecordingState = {
539
+ encode(message, writer = new BinaryWriter()) {
540
+ if (message.isRecording !== false) {
541
+ writer.uint32(8).bool(message.isRecording);
542
+ }
543
+ if (message.name !== "") {
544
+ writer.uint32(18).string(message.name);
545
+ }
546
+ if (message.seconds !== 0) {
547
+ writer.uint32(24).int32(message.seconds);
548
+ }
549
+ if (message.size !== 0) {
550
+ writer.uint32(32).uint64(message.size);
551
+ }
552
+ if (message.sensorData !== false) {
553
+ writer.uint32(40).bool(message.sensorData);
554
+ }
555
+ if (message.storageLocation !== 0) {
556
+ writer.uint32(48).int32(message.storageLocation);
557
+ }
558
+ return writer;
559
+ },
560
+ decode(input, length) {
561
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
562
+ const end = length === undefined ? reader.len : reader.pos + length;
563
+ const message = createBaseSlamRecordingState();
564
+ while (reader.pos < end) {
565
+ const tag = reader.uint32();
566
+ switch (tag >>> 3) {
567
+ case 1: {
568
+ if (tag !== 8) {
569
+ break;
570
+ }
571
+ message.isRecording = reader.bool();
572
+ continue;
573
+ }
574
+ case 2: {
575
+ if (tag !== 18) {
576
+ break;
577
+ }
578
+ message.name = reader.string();
579
+ continue;
580
+ }
581
+ case 3: {
582
+ if (tag !== 24) {
583
+ break;
584
+ }
585
+ message.seconds = reader.int32();
586
+ continue;
587
+ }
588
+ case 4: {
589
+ if (tag !== 32) {
590
+ break;
591
+ }
592
+ message.size = longToNumber(reader.uint64());
593
+ continue;
594
+ }
595
+ case 5: {
596
+ if (tag !== 40) {
597
+ break;
598
+ }
599
+ message.sensorData = reader.bool();
600
+ continue;
601
+ }
602
+ case 6: {
603
+ if (tag !== 48) {
604
+ break;
605
+ }
606
+ message.storageLocation = reader.int32();
607
+ continue;
608
+ }
609
+ }
610
+ if ((tag & 7) === 4 || tag === 0) {
611
+ break;
612
+ }
613
+ reader.skip(tag & 7);
614
+ }
615
+ return message;
616
+ },
617
+ fromJSON(object) {
618
+ return {
619
+ isRecording: isSet(object.isRecording) ? gt.Boolean(object.isRecording) : false,
620
+ name: isSet(object.name) ? gt.String(object.name) : "",
621
+ seconds: isSet(object.seconds) ? gt.Number(object.seconds) : 0,
622
+ size: isSet(object.size) ? gt.Number(object.size) : 0,
623
+ sensorData: isSet(object.sensorData) ? gt.Boolean(object.sensorData) : false,
624
+ storageLocation: isSet(object.storageLocation) ? storageLocationFromJSON(object.storageLocation) : 0,
625
+ };
626
+ },
627
+ toJSON(message) {
628
+ const obj = {};
629
+ if (message.isRecording !== false) {
630
+ obj.isRecording = message.isRecording;
631
+ }
632
+ if (message.name !== "") {
633
+ obj.name = message.name;
634
+ }
635
+ if (message.seconds !== 0) {
636
+ obj.seconds = Math.round(message.seconds);
637
+ }
638
+ if (message.size !== 0) {
639
+ obj.size = Math.round(message.size);
640
+ }
641
+ if (message.sensorData !== false) {
642
+ obj.sensorData = message.sensorData;
643
+ }
644
+ if (message.storageLocation !== 0) {
645
+ obj.storageLocation = storageLocationToJSON(message.storageLocation);
646
+ }
647
+ return obj;
648
+ },
649
+ create(base) {
650
+ return SlamRecordingState.fromPartial(base ?? {});
651
+ },
652
+ fromPartial(object) {
653
+ const message = createBaseSlamRecordingState();
654
+ message.isRecording = object.isRecording ?? false;
655
+ message.name = object.name ?? "";
656
+ message.seconds = object.seconds ?? 0;
657
+ message.size = object.size ?? 0;
658
+ message.sensorData = object.sensorData ?? false;
659
+ message.storageLocation = object.storageLocation ?? 0;
660
+ return message;
661
+ },
662
+ };
663
+ function createBaseSlamSonar3dSettings() {
664
+ return { frequencyMode: 0, maxRange: 0 };
665
+ }
666
+ export const SlamSonar3dSettings = {
667
+ encode(message, writer = new BinaryWriter()) {
668
+ if (message.frequencyMode !== 0) {
669
+ writer.uint32(8).int32(message.frequencyMode);
670
+ }
671
+ if (message.maxRange !== 0) {
672
+ writer.uint32(21).float(message.maxRange);
673
+ }
674
+ return writer;
675
+ },
676
+ decode(input, length) {
677
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
678
+ const end = length === undefined ? reader.len : reader.pos + length;
679
+ const message = createBaseSlamSonar3dSettings();
680
+ while (reader.pos < end) {
681
+ const tag = reader.uint32();
682
+ switch (tag >>> 3) {
683
+ case 1: {
684
+ if (tag !== 8) {
685
+ break;
686
+ }
687
+ message.frequencyMode = reader.int32();
688
+ continue;
689
+ }
690
+ case 2: {
691
+ if (tag !== 21) {
692
+ break;
693
+ }
694
+ message.maxRange = reader.float();
695
+ continue;
696
+ }
697
+ }
698
+ if ((tag & 7) === 4 || tag === 0) {
699
+ break;
700
+ }
701
+ reader.skip(tag & 7);
702
+ }
703
+ return message;
704
+ },
705
+ fromJSON(object) {
706
+ return {
707
+ frequencyMode: isSet(object.frequencyMode) ? sonar3dFrequencyModeFromJSON(object.frequencyMode) : 0,
708
+ maxRange: isSet(object.maxRange) ? gt.Number(object.maxRange) : 0,
709
+ };
710
+ },
711
+ toJSON(message) {
712
+ const obj = {};
713
+ if (message.frequencyMode !== 0) {
714
+ obj.frequencyMode = sonar3dFrequencyModeToJSON(message.frequencyMode);
715
+ }
716
+ if (message.maxRange !== 0) {
717
+ obj.maxRange = message.maxRange;
718
+ }
719
+ return obj;
720
+ },
721
+ create(base) {
722
+ return SlamSonar3dSettings.fromPartial(base ?? {});
723
+ },
724
+ fromPartial(object) {
725
+ const message = createBaseSlamSonar3dSettings();
726
+ message.frequencyMode = object.frequencyMode ?? 0;
727
+ message.maxRange = object.maxRange ?? 0;
728
+ return message;
729
+ },
730
+ };
731
+ function createBaseSlamSensorSettings() {
732
+ return { sonar3d: undefined };
733
+ }
734
+ export const SlamSensorSettings = {
735
+ encode(message, writer = new BinaryWriter()) {
736
+ if (message.sonar3d !== undefined) {
737
+ SlamSonar3dSettings.encode(message.sonar3d, writer.uint32(10).fork()).join();
738
+ }
739
+ return writer;
740
+ },
741
+ decode(input, length) {
742
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
743
+ const end = length === undefined ? reader.len : reader.pos + length;
744
+ const message = createBaseSlamSensorSettings();
745
+ while (reader.pos < end) {
746
+ const tag = reader.uint32();
747
+ switch (tag >>> 3) {
748
+ case 1: {
749
+ if (tag !== 10) {
750
+ break;
751
+ }
752
+ message.sonar3d = SlamSonar3dSettings.decode(reader, reader.uint32());
753
+ continue;
754
+ }
755
+ }
756
+ if ((tag & 7) === 4 || tag === 0) {
757
+ break;
758
+ }
759
+ reader.skip(tag & 7);
760
+ }
761
+ return message;
762
+ },
763
+ fromJSON(object) {
764
+ return { sonar3d: isSet(object.sonar3d) ? SlamSonar3dSettings.fromJSON(object.sonar3d) : undefined };
765
+ },
766
+ toJSON(message) {
767
+ const obj = {};
768
+ if (message.sonar3d !== undefined) {
769
+ obj.sonar3d = SlamSonar3dSettings.toJSON(message.sonar3d);
770
+ }
771
+ return obj;
772
+ },
773
+ create(base) {
774
+ return SlamSensorSettings.fromPartial(base ?? {});
775
+ },
776
+ fromPartial(object) {
777
+ const message = createBaseSlamSensorSettings();
778
+ message.sonar3d = (object.sonar3d !== undefined && object.sonar3d !== null)
779
+ ? SlamSonar3dSettings.fromPartial(object.sonar3d)
780
+ : undefined;
781
+ return message;
782
+ },
783
+ };
784
+ function createBaseSlamSensorStatus() {
785
+ return { sensor: undefined, settings: undefined, mount: undefined, mountTilt: undefined };
786
+ }
787
+ export const SlamSensorStatus = {
788
+ encode(message, writer = new BinaryWriter()) {
789
+ if (message.sensor !== undefined) {
790
+ SlamSensor.encode(message.sensor, writer.uint32(10).fork()).join();
791
+ }
792
+ if (message.settings !== undefined) {
793
+ SlamSensorSettings.encode(message.settings, writer.uint32(18).fork()).join();
794
+ }
795
+ if (message.mount !== undefined) {
796
+ SlamPose.encode(message.mount, writer.uint32(26).fork()).join();
797
+ }
798
+ if (message.mountTilt !== undefined) {
799
+ writer.uint32(37).float(message.mountTilt);
800
+ }
801
+ return writer;
802
+ },
803
+ decode(input, length) {
804
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
805
+ const end = length === undefined ? reader.len : reader.pos + length;
806
+ const message = createBaseSlamSensorStatus();
807
+ while (reader.pos < end) {
808
+ const tag = reader.uint32();
809
+ switch (tag >>> 3) {
810
+ case 1: {
811
+ if (tag !== 10) {
812
+ break;
813
+ }
814
+ message.sensor = SlamSensor.decode(reader, reader.uint32());
815
+ continue;
816
+ }
817
+ case 2: {
818
+ if (tag !== 18) {
819
+ break;
820
+ }
821
+ message.settings = SlamSensorSettings.decode(reader, reader.uint32());
822
+ continue;
823
+ }
824
+ case 3: {
825
+ if (tag !== 26) {
826
+ break;
827
+ }
828
+ message.mount = SlamPose.decode(reader, reader.uint32());
829
+ continue;
830
+ }
831
+ case 4: {
832
+ if (tag !== 37) {
833
+ break;
834
+ }
835
+ message.mountTilt = reader.float();
836
+ continue;
837
+ }
838
+ }
839
+ if ((tag & 7) === 4 || tag === 0) {
840
+ break;
841
+ }
842
+ reader.skip(tag & 7);
843
+ }
844
+ return message;
845
+ },
846
+ fromJSON(object) {
847
+ return {
848
+ sensor: isSet(object.sensor) ? SlamSensor.fromJSON(object.sensor) : undefined,
849
+ settings: isSet(object.settings) ? SlamSensorSettings.fromJSON(object.settings) : undefined,
850
+ mount: isSet(object.mount) ? SlamPose.fromJSON(object.mount) : undefined,
851
+ mountTilt: isSet(object.mountTilt) ? gt.Number(object.mountTilt) : undefined,
852
+ };
853
+ },
854
+ toJSON(message) {
855
+ const obj = {};
856
+ if (message.sensor !== undefined) {
857
+ obj.sensor = SlamSensor.toJSON(message.sensor);
858
+ }
859
+ if (message.settings !== undefined) {
860
+ obj.settings = SlamSensorSettings.toJSON(message.settings);
861
+ }
862
+ if (message.mount !== undefined) {
863
+ obj.mount = SlamPose.toJSON(message.mount);
864
+ }
865
+ if (message.mountTilt !== undefined) {
866
+ obj.mountTilt = message.mountTilt;
867
+ }
868
+ return obj;
869
+ },
870
+ create(base) {
871
+ return SlamSensorStatus.fromPartial(base ?? {});
872
+ },
873
+ fromPartial(object) {
874
+ const message = createBaseSlamSensorStatus();
875
+ message.sensor = (object.sensor !== undefined && object.sensor !== null)
876
+ ? SlamSensor.fromPartial(object.sensor)
877
+ : undefined;
878
+ message.settings = (object.settings !== undefined && object.settings !== null)
879
+ ? SlamSensorSettings.fromPartial(object.settings)
880
+ : undefined;
881
+ message.mount = (object.mount !== undefined && object.mount !== null)
882
+ ? SlamPose.fromPartial(object.mount)
883
+ : undefined;
884
+ message.mountTilt = object.mountTilt ?? undefined;
885
+ return message;
886
+ },
887
+ };
888
+ function createBaseSlamPose() {
889
+ return { position: undefined, orientation: undefined };
890
+ }
891
+ export const SlamPose = {
892
+ encode(message, writer = new BinaryWriter()) {
893
+ if (message.position !== undefined) {
894
+ Vector3.encode(message.position, writer.uint32(10).fork()).join();
895
+ }
896
+ if (message.orientation !== undefined) {
897
+ Quaternion.encode(message.orientation, writer.uint32(18).fork()).join();
898
+ }
899
+ return writer;
900
+ },
901
+ decode(input, length) {
902
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
903
+ const end = length === undefined ? reader.len : reader.pos + length;
904
+ const message = createBaseSlamPose();
905
+ while (reader.pos < end) {
906
+ const tag = reader.uint32();
907
+ switch (tag >>> 3) {
908
+ case 1: {
909
+ if (tag !== 10) {
910
+ break;
911
+ }
912
+ message.position = Vector3.decode(reader, reader.uint32());
913
+ continue;
914
+ }
915
+ case 2: {
916
+ if (tag !== 18) {
917
+ break;
918
+ }
919
+ message.orientation = Quaternion.decode(reader, reader.uint32());
920
+ continue;
921
+ }
922
+ }
923
+ if ((tag & 7) === 4 || tag === 0) {
924
+ break;
925
+ }
926
+ reader.skip(tag & 7);
927
+ }
928
+ return message;
929
+ },
930
+ fromJSON(object) {
931
+ return {
932
+ position: isSet(object.position) ? Vector3.fromJSON(object.position) : undefined,
933
+ orientation: isSet(object.orientation) ? Quaternion.fromJSON(object.orientation) : undefined,
934
+ };
935
+ },
936
+ toJSON(message) {
937
+ const obj = {};
938
+ if (message.position !== undefined) {
939
+ obj.position = Vector3.toJSON(message.position);
940
+ }
941
+ if (message.orientation !== undefined) {
942
+ obj.orientation = Quaternion.toJSON(message.orientation);
943
+ }
944
+ return obj;
945
+ },
946
+ create(base) {
947
+ return SlamPose.fromPartial(base ?? {});
948
+ },
949
+ fromPartial(object) {
950
+ const message = createBaseSlamPose();
951
+ message.position = (object.position !== undefined && object.position !== null)
952
+ ? Vector3.fromPartial(object.position)
953
+ : undefined;
954
+ message.orientation = (object.orientation !== undefined && object.orientation !== null)
955
+ ? Quaternion.fromPartial(object.orientation)
956
+ : undefined;
957
+ return message;
958
+ },
959
+ };
960
+ function createBaseSlamPoseEstimate() {
961
+ return {
962
+ mapId: 0,
963
+ state: 0,
964
+ pose: undefined,
965
+ time: undefined,
966
+ scanPoints: 0,
967
+ matchInlierRatio: 0,
968
+ matchRms: 0,
969
+ keyframeCount: 0,
970
+ mapPointCount: 0,
971
+ depth: undefined,
972
+ sensorId: "",
973
+ mount: undefined,
974
+ covarianceElements: [],
975
+ keyframeId: 0,
976
+ };
977
+ }
978
+ export const SlamPoseEstimate = {
979
+ encode(message, writer = new BinaryWriter()) {
980
+ if (message.mapId !== 0) {
981
+ writer.uint32(8).uint32(message.mapId);
982
+ }
983
+ if (message.state !== 0) {
984
+ writer.uint32(16).int32(message.state);
985
+ }
986
+ if (message.pose !== undefined) {
987
+ SlamPose.encode(message.pose, writer.uint32(26).fork()).join();
988
+ }
989
+ if (message.time !== undefined) {
990
+ Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).join();
991
+ }
992
+ if (message.scanPoints !== 0) {
993
+ writer.uint32(40).uint32(message.scanPoints);
994
+ }
995
+ if (message.matchInlierRatio !== 0) {
996
+ writer.uint32(53).float(message.matchInlierRatio);
997
+ }
998
+ if (message.matchRms !== 0) {
999
+ writer.uint32(61).float(message.matchRms);
1000
+ }
1001
+ if (message.keyframeCount !== 0) {
1002
+ writer.uint32(64).uint32(message.keyframeCount);
1003
+ }
1004
+ if (message.mapPointCount !== 0) {
1005
+ writer.uint32(72).uint32(message.mapPointCount);
1006
+ }
1007
+ if (message.depth !== undefined) {
1008
+ writer.uint32(85).float(message.depth);
1009
+ }
1010
+ if (message.sensorId !== "") {
1011
+ writer.uint32(90).string(message.sensorId);
1012
+ }
1013
+ if (message.mount !== undefined) {
1014
+ SlamPose.encode(message.mount, writer.uint32(98).fork()).join();
1015
+ }
1016
+ writer.uint32(106).fork();
1017
+ for (const v of message.covarianceElements) {
1018
+ writer.float(v);
1019
+ }
1020
+ writer.join();
1021
+ if (message.keyframeId !== 0) {
1022
+ writer.uint32(112).uint32(message.keyframeId);
1023
+ }
1024
+ return writer;
1025
+ },
1026
+ decode(input, length) {
1027
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1028
+ const end = length === undefined ? reader.len : reader.pos + length;
1029
+ const message = createBaseSlamPoseEstimate();
1030
+ while (reader.pos < end) {
1031
+ const tag = reader.uint32();
1032
+ switch (tag >>> 3) {
1033
+ case 1: {
1034
+ if (tag !== 8) {
1035
+ break;
1036
+ }
1037
+ message.mapId = reader.uint32();
1038
+ continue;
1039
+ }
1040
+ case 2: {
1041
+ if (tag !== 16) {
1042
+ break;
1043
+ }
1044
+ message.state = reader.int32();
1045
+ continue;
1046
+ }
1047
+ case 3: {
1048
+ if (tag !== 26) {
1049
+ break;
1050
+ }
1051
+ message.pose = SlamPose.decode(reader, reader.uint32());
1052
+ continue;
1053
+ }
1054
+ case 4: {
1055
+ if (tag !== 34) {
1056
+ break;
1057
+ }
1058
+ message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1059
+ continue;
1060
+ }
1061
+ case 5: {
1062
+ if (tag !== 40) {
1063
+ break;
1064
+ }
1065
+ message.scanPoints = reader.uint32();
1066
+ continue;
1067
+ }
1068
+ case 6: {
1069
+ if (tag !== 53) {
1070
+ break;
1071
+ }
1072
+ message.matchInlierRatio = reader.float();
1073
+ continue;
1074
+ }
1075
+ case 7: {
1076
+ if (tag !== 61) {
1077
+ break;
1078
+ }
1079
+ message.matchRms = reader.float();
1080
+ continue;
1081
+ }
1082
+ case 8: {
1083
+ if (tag !== 64) {
1084
+ break;
1085
+ }
1086
+ message.keyframeCount = reader.uint32();
1087
+ continue;
1088
+ }
1089
+ case 9: {
1090
+ if (tag !== 72) {
1091
+ break;
1092
+ }
1093
+ message.mapPointCount = reader.uint32();
1094
+ continue;
1095
+ }
1096
+ case 10: {
1097
+ if (tag !== 85) {
1098
+ break;
1099
+ }
1100
+ message.depth = reader.float();
1101
+ continue;
1102
+ }
1103
+ case 11: {
1104
+ if (tag !== 90) {
1105
+ break;
1106
+ }
1107
+ message.sensorId = reader.string();
1108
+ continue;
1109
+ }
1110
+ case 12: {
1111
+ if (tag !== 98) {
1112
+ break;
1113
+ }
1114
+ message.mount = SlamPose.decode(reader, reader.uint32());
1115
+ continue;
1116
+ }
1117
+ case 13: {
1118
+ if (tag === 109) {
1119
+ message.covarianceElements.push(reader.float());
1120
+ continue;
1121
+ }
1122
+ if (tag === 106) {
1123
+ const end2 = reader.uint32() + reader.pos;
1124
+ while (reader.pos < end2) {
1125
+ message.covarianceElements.push(reader.float());
1126
+ }
1127
+ continue;
1128
+ }
1129
+ break;
1130
+ }
1131
+ case 14: {
1132
+ if (tag !== 112) {
1133
+ break;
1134
+ }
1135
+ message.keyframeId = reader.uint32();
1136
+ continue;
1137
+ }
1138
+ }
1139
+ if ((tag & 7) === 4 || tag === 0) {
1140
+ break;
1141
+ }
1142
+ reader.skip(tag & 7);
1143
+ }
1144
+ return message;
1145
+ },
1146
+ fromJSON(object) {
1147
+ return {
1148
+ mapId: isSet(object.mapId) ? gt.Number(object.mapId) : 0,
1149
+ state: isSet(object.state) ? slamStateFromJSON(object.state) : 0,
1150
+ pose: isSet(object.pose) ? SlamPose.fromJSON(object.pose) : undefined,
1151
+ time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
1152
+ scanPoints: isSet(object.scanPoints) ? gt.Number(object.scanPoints) : 0,
1153
+ matchInlierRatio: isSet(object.matchInlierRatio) ? gt.Number(object.matchInlierRatio) : 0,
1154
+ matchRms: isSet(object.matchRms) ? gt.Number(object.matchRms) : 0,
1155
+ keyframeCount: isSet(object.keyframeCount) ? gt.Number(object.keyframeCount) : 0,
1156
+ mapPointCount: isSet(object.mapPointCount) ? gt.Number(object.mapPointCount) : 0,
1157
+ depth: isSet(object.depth) ? gt.Number(object.depth) : undefined,
1158
+ sensorId: isSet(object.sensorId) ? gt.String(object.sensorId) : "",
1159
+ mount: isSet(object.mount) ? SlamPose.fromJSON(object.mount) : undefined,
1160
+ covarianceElements: gt.Array.isArray(object?.covarianceElements)
1161
+ ? object.covarianceElements.map((e) => gt.Number(e))
1162
+ : [],
1163
+ keyframeId: isSet(object.keyframeId) ? gt.Number(object.keyframeId) : 0,
1164
+ };
1165
+ },
1166
+ toJSON(message) {
1167
+ const obj = {};
1168
+ if (message.mapId !== 0) {
1169
+ obj.mapId = Math.round(message.mapId);
1170
+ }
1171
+ if (message.state !== 0) {
1172
+ obj.state = slamStateToJSON(message.state);
1173
+ }
1174
+ if (message.pose !== undefined) {
1175
+ obj.pose = SlamPose.toJSON(message.pose);
1176
+ }
1177
+ if (message.time !== undefined) {
1178
+ obj.time = message.time.toISOString();
1179
+ }
1180
+ if (message.scanPoints !== 0) {
1181
+ obj.scanPoints = Math.round(message.scanPoints);
1182
+ }
1183
+ if (message.matchInlierRatio !== 0) {
1184
+ obj.matchInlierRatio = message.matchInlierRatio;
1185
+ }
1186
+ if (message.matchRms !== 0) {
1187
+ obj.matchRms = message.matchRms;
1188
+ }
1189
+ if (message.keyframeCount !== 0) {
1190
+ obj.keyframeCount = Math.round(message.keyframeCount);
1191
+ }
1192
+ if (message.mapPointCount !== 0) {
1193
+ obj.mapPointCount = Math.round(message.mapPointCount);
1194
+ }
1195
+ if (message.depth !== undefined) {
1196
+ obj.depth = message.depth;
1197
+ }
1198
+ if (message.sensorId !== "") {
1199
+ obj.sensorId = message.sensorId;
1200
+ }
1201
+ if (message.mount !== undefined) {
1202
+ obj.mount = SlamPose.toJSON(message.mount);
1203
+ }
1204
+ if (message.covarianceElements?.length) {
1205
+ obj.covarianceElements = message.covarianceElements;
1206
+ }
1207
+ if (message.keyframeId !== 0) {
1208
+ obj.keyframeId = Math.round(message.keyframeId);
1209
+ }
1210
+ return obj;
1211
+ },
1212
+ create(base) {
1213
+ return SlamPoseEstimate.fromPartial(base ?? {});
1214
+ },
1215
+ fromPartial(object) {
1216
+ const message = createBaseSlamPoseEstimate();
1217
+ message.mapId = object.mapId ?? 0;
1218
+ message.state = object.state ?? 0;
1219
+ message.pose = (object.pose !== undefined && object.pose !== null) ? SlamPose.fromPartial(object.pose) : undefined;
1220
+ message.time = object.time ?? undefined;
1221
+ message.scanPoints = object.scanPoints ?? 0;
1222
+ message.matchInlierRatio = object.matchInlierRatio ?? 0;
1223
+ message.matchRms = object.matchRms ?? 0;
1224
+ message.keyframeCount = object.keyframeCount ?? 0;
1225
+ message.mapPointCount = object.mapPointCount ?? 0;
1226
+ message.depth = object.depth ?? undefined;
1227
+ message.sensorId = object.sensorId ?? "";
1228
+ message.mount = (object.mount !== undefined && object.mount !== null)
1229
+ ? SlamPose.fromPartial(object.mount)
1230
+ : undefined;
1231
+ message.covarianceElements = object.covarianceElements?.map((e) => e) || [];
1232
+ message.keyframeId = object.keyframeId ?? 0;
1233
+ return message;
1234
+ },
1235
+ };
1236
+ function createBaseSlamKeyframe() {
1237
+ return { id: 0, submapId: 0, pose: undefined, time: undefined, sensorId: "", mount: undefined };
1238
+ }
1239
+ export const SlamKeyframe = {
1240
+ encode(message, writer = new BinaryWriter()) {
1241
+ if (message.id !== 0) {
1242
+ writer.uint32(8).uint32(message.id);
1243
+ }
1244
+ if (message.submapId !== 0) {
1245
+ writer.uint32(16).uint32(message.submapId);
1246
+ }
1247
+ if (message.pose !== undefined) {
1248
+ SlamPose.encode(message.pose, writer.uint32(26).fork()).join();
1249
+ }
1250
+ if (message.time !== undefined) {
1251
+ Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).join();
1252
+ }
1253
+ if (message.sensorId !== "") {
1254
+ writer.uint32(42).string(message.sensorId);
1255
+ }
1256
+ if (message.mount !== undefined) {
1257
+ SlamPose.encode(message.mount, writer.uint32(50).fork()).join();
1258
+ }
1259
+ return writer;
1260
+ },
1261
+ decode(input, length) {
1262
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1263
+ const end = length === undefined ? reader.len : reader.pos + length;
1264
+ const message = createBaseSlamKeyframe();
1265
+ while (reader.pos < end) {
1266
+ const tag = reader.uint32();
1267
+ switch (tag >>> 3) {
1268
+ case 1: {
1269
+ if (tag !== 8) {
1270
+ break;
1271
+ }
1272
+ message.id = reader.uint32();
1273
+ continue;
1274
+ }
1275
+ case 2: {
1276
+ if (tag !== 16) {
1277
+ break;
1278
+ }
1279
+ message.submapId = reader.uint32();
1280
+ continue;
1281
+ }
1282
+ case 3: {
1283
+ if (tag !== 26) {
1284
+ break;
1285
+ }
1286
+ message.pose = SlamPose.decode(reader, reader.uint32());
1287
+ continue;
1288
+ }
1289
+ case 4: {
1290
+ if (tag !== 34) {
1291
+ break;
1292
+ }
1293
+ message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1294
+ continue;
1295
+ }
1296
+ case 5: {
1297
+ if (tag !== 42) {
1298
+ break;
1299
+ }
1300
+ message.sensorId = reader.string();
1301
+ continue;
1302
+ }
1303
+ case 6: {
1304
+ if (tag !== 50) {
1305
+ break;
1306
+ }
1307
+ message.mount = SlamPose.decode(reader, reader.uint32());
1308
+ continue;
1309
+ }
1310
+ }
1311
+ if ((tag & 7) === 4 || tag === 0) {
1312
+ break;
1313
+ }
1314
+ reader.skip(tag & 7);
1315
+ }
1316
+ return message;
1317
+ },
1318
+ fromJSON(object) {
1319
+ return {
1320
+ id: isSet(object.id) ? gt.Number(object.id) : 0,
1321
+ submapId: isSet(object.submapId) ? gt.Number(object.submapId) : 0,
1322
+ pose: isSet(object.pose) ? SlamPose.fromJSON(object.pose) : undefined,
1323
+ time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
1324
+ sensorId: isSet(object.sensorId) ? gt.String(object.sensorId) : "",
1325
+ mount: isSet(object.mount) ? SlamPose.fromJSON(object.mount) : undefined,
1326
+ };
1327
+ },
1328
+ toJSON(message) {
1329
+ const obj = {};
1330
+ if (message.id !== 0) {
1331
+ obj.id = Math.round(message.id);
1332
+ }
1333
+ if (message.submapId !== 0) {
1334
+ obj.submapId = Math.round(message.submapId);
1335
+ }
1336
+ if (message.pose !== undefined) {
1337
+ obj.pose = SlamPose.toJSON(message.pose);
1338
+ }
1339
+ if (message.time !== undefined) {
1340
+ obj.time = message.time.toISOString();
1341
+ }
1342
+ if (message.sensorId !== "") {
1343
+ obj.sensorId = message.sensorId;
1344
+ }
1345
+ if (message.mount !== undefined) {
1346
+ obj.mount = SlamPose.toJSON(message.mount);
1347
+ }
1348
+ return obj;
1349
+ },
1350
+ create(base) {
1351
+ return SlamKeyframe.fromPartial(base ?? {});
1352
+ },
1353
+ fromPartial(object) {
1354
+ const message = createBaseSlamKeyframe();
1355
+ message.id = object.id ?? 0;
1356
+ message.submapId = object.submapId ?? 0;
1357
+ message.pose = (object.pose !== undefined && object.pose !== null) ? SlamPose.fromPartial(object.pose) : undefined;
1358
+ message.time = object.time ?? undefined;
1359
+ message.sensorId = object.sensorId ?? "";
1360
+ message.mount = (object.mount !== undefined && object.mount !== null)
1361
+ ? SlamPose.fromPartial(object.mount)
1362
+ : undefined;
1363
+ return message;
1364
+ },
1365
+ };
1366
+ function createBaseSlamSubmap() {
1367
+ return { submapId: 0, anchorKeyframeId: 0, sensorId: "", points: undefined, replace: false };
1368
+ }
1369
+ export const SlamSubmap = {
1370
+ encode(message, writer = new BinaryWriter()) {
1371
+ if (message.submapId !== 0) {
1372
+ writer.uint32(8).uint32(message.submapId);
1373
+ }
1374
+ if (message.anchorKeyframeId !== 0) {
1375
+ writer.uint32(16).uint32(message.anchorKeyframeId);
1376
+ }
1377
+ if (message.sensorId !== "") {
1378
+ writer.uint32(26).string(message.sensorId);
1379
+ }
1380
+ if (message.points !== undefined) {
1381
+ PointCloud.encode(message.points, writer.uint32(34).fork()).join();
1382
+ }
1383
+ if (message.replace !== false) {
1384
+ writer.uint32(40).bool(message.replace);
1385
+ }
1386
+ return writer;
1387
+ },
1388
+ decode(input, length) {
1389
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1390
+ const end = length === undefined ? reader.len : reader.pos + length;
1391
+ const message = createBaseSlamSubmap();
1392
+ while (reader.pos < end) {
1393
+ const tag = reader.uint32();
1394
+ switch (tag >>> 3) {
1395
+ case 1: {
1396
+ if (tag !== 8) {
1397
+ break;
1398
+ }
1399
+ message.submapId = reader.uint32();
1400
+ continue;
1401
+ }
1402
+ case 2: {
1403
+ if (tag !== 16) {
1404
+ break;
1405
+ }
1406
+ message.anchorKeyframeId = reader.uint32();
1407
+ continue;
1408
+ }
1409
+ case 3: {
1410
+ if (tag !== 26) {
1411
+ break;
1412
+ }
1413
+ message.sensorId = reader.string();
1414
+ continue;
1415
+ }
1416
+ case 4: {
1417
+ if (tag !== 34) {
1418
+ break;
1419
+ }
1420
+ message.points = PointCloud.decode(reader, reader.uint32());
1421
+ continue;
1422
+ }
1423
+ case 5: {
1424
+ if (tag !== 40) {
1425
+ break;
1426
+ }
1427
+ message.replace = reader.bool();
1428
+ continue;
1429
+ }
1430
+ }
1431
+ if ((tag & 7) === 4 || tag === 0) {
1432
+ break;
1433
+ }
1434
+ reader.skip(tag & 7);
1435
+ }
1436
+ return message;
1437
+ },
1438
+ fromJSON(object) {
1439
+ return {
1440
+ submapId: isSet(object.submapId) ? gt.Number(object.submapId) : 0,
1441
+ anchorKeyframeId: isSet(object.anchorKeyframeId) ? gt.Number(object.anchorKeyframeId) : 0,
1442
+ sensorId: isSet(object.sensorId) ? gt.String(object.sensorId) : "",
1443
+ points: isSet(object.points) ? PointCloud.fromJSON(object.points) : undefined,
1444
+ replace: isSet(object.replace) ? gt.Boolean(object.replace) : false,
1445
+ };
1446
+ },
1447
+ toJSON(message) {
1448
+ const obj = {};
1449
+ if (message.submapId !== 0) {
1450
+ obj.submapId = Math.round(message.submapId);
1451
+ }
1452
+ if (message.anchorKeyframeId !== 0) {
1453
+ obj.anchorKeyframeId = Math.round(message.anchorKeyframeId);
1454
+ }
1455
+ if (message.sensorId !== "") {
1456
+ obj.sensorId = message.sensorId;
1457
+ }
1458
+ if (message.points !== undefined) {
1459
+ obj.points = PointCloud.toJSON(message.points);
1460
+ }
1461
+ if (message.replace !== false) {
1462
+ obj.replace = message.replace;
1463
+ }
1464
+ return obj;
1465
+ },
1466
+ create(base) {
1467
+ return SlamSubmap.fromPartial(base ?? {});
1468
+ },
1469
+ fromPartial(object) {
1470
+ const message = createBaseSlamSubmap();
1471
+ message.submapId = object.submapId ?? 0;
1472
+ message.anchorKeyframeId = object.anchorKeyframeId ?? 0;
1473
+ message.sensorId = object.sensorId ?? "";
1474
+ message.points = (object.points !== undefined && object.points !== null)
1475
+ ? PointCloud.fromPartial(object.points)
1476
+ : undefined;
1477
+ message.replace = object.replace ?? false;
1478
+ return message;
1479
+ },
1480
+ };
1481
+ function createBaseSlamKeyframePoses() {
1482
+ return { firstKeyframeId: 0, poses: new Uint8Array(0) };
1483
+ }
1484
+ export const SlamKeyframePoses = {
1485
+ encode(message, writer = new BinaryWriter()) {
1486
+ if (message.firstKeyframeId !== 0) {
1487
+ writer.uint32(8).uint32(message.firstKeyframeId);
1488
+ }
1489
+ if (message.poses.length !== 0) {
1490
+ writer.uint32(18).bytes(message.poses);
1491
+ }
1492
+ return writer;
1493
+ },
1494
+ decode(input, length) {
1495
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1496
+ const end = length === undefined ? reader.len : reader.pos + length;
1497
+ const message = createBaseSlamKeyframePoses();
1498
+ while (reader.pos < end) {
1499
+ const tag = reader.uint32();
1500
+ switch (tag >>> 3) {
1501
+ case 1: {
1502
+ if (tag !== 8) {
1503
+ break;
1504
+ }
1505
+ message.firstKeyframeId = reader.uint32();
1506
+ continue;
1507
+ }
1508
+ case 2: {
1509
+ if (tag !== 18) {
1510
+ break;
1511
+ }
1512
+ message.poses = reader.bytes();
1513
+ continue;
1514
+ }
1515
+ }
1516
+ if ((tag & 7) === 4 || tag === 0) {
1517
+ break;
1518
+ }
1519
+ reader.skip(tag & 7);
1520
+ }
1521
+ return message;
1522
+ },
1523
+ fromJSON(object) {
1524
+ return {
1525
+ firstKeyframeId: isSet(object.firstKeyframeId) ? gt.Number(object.firstKeyframeId) : 0,
1526
+ poses: isSet(object.poses) ? bytesFromBase64(object.poses) : new Uint8Array(0),
1527
+ };
1528
+ },
1529
+ toJSON(message) {
1530
+ const obj = {};
1531
+ if (message.firstKeyframeId !== 0) {
1532
+ obj.firstKeyframeId = Math.round(message.firstKeyframeId);
1533
+ }
1534
+ if (message.poses.length !== 0) {
1535
+ obj.poses = base64FromBytes(message.poses);
1536
+ }
1537
+ return obj;
1538
+ },
1539
+ create(base) {
1540
+ return SlamKeyframePoses.fromPartial(base ?? {});
1541
+ },
1542
+ fromPartial(object) {
1543
+ const message = createBaseSlamKeyframePoses();
1544
+ message.firstKeyframeId = object.firstKeyframeId ?? 0;
1545
+ message.poses = object.poses ?? new Uint8Array(0);
1546
+ return message;
1547
+ },
1548
+ };
1549
+ function createBaseSlamLoopClosure() {
1550
+ return { keyframeId: 0, matchedKeyframeId: 0, positionCorrection: 0, headingCorrection: 0 };
1551
+ }
1552
+ export const SlamLoopClosure = {
1553
+ encode(message, writer = new BinaryWriter()) {
1554
+ if (message.keyframeId !== 0) {
1555
+ writer.uint32(8).uint32(message.keyframeId);
1556
+ }
1557
+ if (message.matchedKeyframeId !== 0) {
1558
+ writer.uint32(16).uint32(message.matchedKeyframeId);
1559
+ }
1560
+ if (message.positionCorrection !== 0) {
1561
+ writer.uint32(29).float(message.positionCorrection);
1562
+ }
1563
+ if (message.headingCorrection !== 0) {
1564
+ writer.uint32(37).float(message.headingCorrection);
1565
+ }
1566
+ return writer;
1567
+ },
1568
+ decode(input, length) {
1569
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1570
+ const end = length === undefined ? reader.len : reader.pos + length;
1571
+ const message = createBaseSlamLoopClosure();
1572
+ while (reader.pos < end) {
1573
+ const tag = reader.uint32();
1574
+ switch (tag >>> 3) {
1575
+ case 1: {
1576
+ if (tag !== 8) {
1577
+ break;
1578
+ }
1579
+ message.keyframeId = reader.uint32();
1580
+ continue;
1581
+ }
1582
+ case 2: {
1583
+ if (tag !== 16) {
1584
+ break;
1585
+ }
1586
+ message.matchedKeyframeId = reader.uint32();
1587
+ continue;
1588
+ }
1589
+ case 3: {
1590
+ if (tag !== 29) {
1591
+ break;
1592
+ }
1593
+ message.positionCorrection = reader.float();
1594
+ continue;
1595
+ }
1596
+ case 4: {
1597
+ if (tag !== 37) {
1598
+ break;
1599
+ }
1600
+ message.headingCorrection = reader.float();
1601
+ continue;
1602
+ }
1603
+ }
1604
+ if ((tag & 7) === 4 || tag === 0) {
1605
+ break;
1606
+ }
1607
+ reader.skip(tag & 7);
1608
+ }
1609
+ return message;
1610
+ },
1611
+ fromJSON(object) {
1612
+ return {
1613
+ keyframeId: isSet(object.keyframeId) ? gt.Number(object.keyframeId) : 0,
1614
+ matchedKeyframeId: isSet(object.matchedKeyframeId) ? gt.Number(object.matchedKeyframeId) : 0,
1615
+ positionCorrection: isSet(object.positionCorrection) ? gt.Number(object.positionCorrection) : 0,
1616
+ headingCorrection: isSet(object.headingCorrection) ? gt.Number(object.headingCorrection) : 0,
1617
+ };
1618
+ },
1619
+ toJSON(message) {
1620
+ const obj = {};
1621
+ if (message.keyframeId !== 0) {
1622
+ obj.keyframeId = Math.round(message.keyframeId);
1623
+ }
1624
+ if (message.matchedKeyframeId !== 0) {
1625
+ obj.matchedKeyframeId = Math.round(message.matchedKeyframeId);
1626
+ }
1627
+ if (message.positionCorrection !== 0) {
1628
+ obj.positionCorrection = message.positionCorrection;
1629
+ }
1630
+ if (message.headingCorrection !== 0) {
1631
+ obj.headingCorrection = message.headingCorrection;
1632
+ }
1633
+ return obj;
1634
+ },
1635
+ create(base) {
1636
+ return SlamLoopClosure.fromPartial(base ?? {});
1637
+ },
1638
+ fromPartial(object) {
1639
+ const message = createBaseSlamLoopClosure();
1640
+ message.keyframeId = object.keyframeId ?? 0;
1641
+ message.matchedKeyframeId = object.matchedKeyframeId ?? 0;
1642
+ message.positionCorrection = object.positionCorrection ?? 0;
1643
+ message.headingCorrection = object.headingCorrection ?? 0;
1644
+ return message;
1645
+ },
1646
+ };
1647
+ function createBaseSlamMapUpdate() {
1648
+ return {
1649
+ mapId: 0,
1650
+ sequence: 0,
1651
+ keyframes: [],
1652
+ submaps: [],
1653
+ frame: undefined,
1654
+ loopClosures: [],
1655
+ movedPoses: [],
1656
+ removedSubmapIds: [],
1657
+ };
1658
+ }
1659
+ export const SlamMapUpdate = {
1660
+ encode(message, writer = new BinaryWriter()) {
1661
+ if (message.mapId !== 0) {
1662
+ writer.uint32(8).uint32(message.mapId);
1663
+ }
1664
+ if (message.sequence !== 0) {
1665
+ writer.uint32(16).uint64(message.sequence);
1666
+ }
1667
+ for (const v of message.keyframes) {
1668
+ SlamKeyframe.encode(v, writer.uint32(26).fork()).join();
1669
+ }
1670
+ for (const v of message.submaps) {
1671
+ SlamSubmap.encode(v, writer.uint32(34).fork()).join();
1672
+ }
1673
+ if (message.frame !== undefined) {
1674
+ SlamMapFrame.encode(message.frame, writer.uint32(42).fork()).join();
1675
+ }
1676
+ for (const v of message.loopClosures) {
1677
+ SlamLoopClosure.encode(v, writer.uint32(50).fork()).join();
1678
+ }
1679
+ for (const v of message.movedPoses) {
1680
+ SlamKeyframePoses.encode(v, writer.uint32(58).fork()).join();
1681
+ }
1682
+ writer.uint32(66).fork();
1683
+ for (const v of message.removedSubmapIds) {
1684
+ writer.uint32(v);
1685
+ }
1686
+ writer.join();
1687
+ return writer;
1688
+ },
1689
+ decode(input, length) {
1690
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1691
+ const end = length === undefined ? reader.len : reader.pos + length;
1692
+ const message = createBaseSlamMapUpdate();
1693
+ while (reader.pos < end) {
1694
+ const tag = reader.uint32();
1695
+ switch (tag >>> 3) {
1696
+ case 1: {
1697
+ if (tag !== 8) {
1698
+ break;
1699
+ }
1700
+ message.mapId = reader.uint32();
1701
+ continue;
1702
+ }
1703
+ case 2: {
1704
+ if (tag !== 16) {
1705
+ break;
1706
+ }
1707
+ message.sequence = longToNumber(reader.uint64());
1708
+ continue;
1709
+ }
1710
+ case 3: {
1711
+ if (tag !== 26) {
1712
+ break;
1713
+ }
1714
+ message.keyframes.push(SlamKeyframe.decode(reader, reader.uint32()));
1715
+ continue;
1716
+ }
1717
+ case 4: {
1718
+ if (tag !== 34) {
1719
+ break;
1720
+ }
1721
+ message.submaps.push(SlamSubmap.decode(reader, reader.uint32()));
1722
+ continue;
1723
+ }
1724
+ case 5: {
1725
+ if (tag !== 42) {
1726
+ break;
1727
+ }
1728
+ message.frame = SlamMapFrame.decode(reader, reader.uint32());
1729
+ continue;
1730
+ }
1731
+ case 6: {
1732
+ if (tag !== 50) {
1733
+ break;
1734
+ }
1735
+ message.loopClosures.push(SlamLoopClosure.decode(reader, reader.uint32()));
1736
+ continue;
1737
+ }
1738
+ case 7: {
1739
+ if (tag !== 58) {
1740
+ break;
1741
+ }
1742
+ message.movedPoses.push(SlamKeyframePoses.decode(reader, reader.uint32()));
1743
+ continue;
1744
+ }
1745
+ case 8: {
1746
+ if (tag === 64) {
1747
+ message.removedSubmapIds.push(reader.uint32());
1748
+ continue;
1749
+ }
1750
+ if (tag === 66) {
1751
+ const end2 = reader.uint32() + reader.pos;
1752
+ while (reader.pos < end2) {
1753
+ message.removedSubmapIds.push(reader.uint32());
1754
+ }
1755
+ continue;
1756
+ }
1757
+ break;
1758
+ }
1759
+ }
1760
+ if ((tag & 7) === 4 || tag === 0) {
1761
+ break;
1762
+ }
1763
+ reader.skip(tag & 7);
1764
+ }
1765
+ return message;
1766
+ },
1767
+ fromJSON(object) {
1768
+ return {
1769
+ mapId: isSet(object.mapId) ? gt.Number(object.mapId) : 0,
1770
+ sequence: isSet(object.sequence) ? gt.Number(object.sequence) : 0,
1771
+ keyframes: gt.Array.isArray(object?.keyframes) ? object.keyframes.map((e) => SlamKeyframe.fromJSON(e)) : [],
1772
+ submaps: gt.Array.isArray(object?.submaps) ? object.submaps.map((e) => SlamSubmap.fromJSON(e)) : [],
1773
+ frame: isSet(object.frame) ? SlamMapFrame.fromJSON(object.frame) : undefined,
1774
+ loopClosures: gt.Array.isArray(object?.loopClosures)
1775
+ ? object.loopClosures.map((e) => SlamLoopClosure.fromJSON(e))
1776
+ : [],
1777
+ movedPoses: gt.Array.isArray(object?.movedPoses)
1778
+ ? object.movedPoses.map((e) => SlamKeyframePoses.fromJSON(e))
1779
+ : [],
1780
+ removedSubmapIds: gt.Array.isArray(object?.removedSubmapIds)
1781
+ ? object.removedSubmapIds.map((e) => gt.Number(e))
1782
+ : [],
1783
+ };
1784
+ },
1785
+ toJSON(message) {
1786
+ const obj = {};
1787
+ if (message.mapId !== 0) {
1788
+ obj.mapId = Math.round(message.mapId);
1789
+ }
1790
+ if (message.sequence !== 0) {
1791
+ obj.sequence = Math.round(message.sequence);
1792
+ }
1793
+ if (message.keyframes?.length) {
1794
+ obj.keyframes = message.keyframes.map((e) => SlamKeyframe.toJSON(e));
1795
+ }
1796
+ if (message.submaps?.length) {
1797
+ obj.submaps = message.submaps.map((e) => SlamSubmap.toJSON(e));
1798
+ }
1799
+ if (message.frame !== undefined) {
1800
+ obj.frame = SlamMapFrame.toJSON(message.frame);
1801
+ }
1802
+ if (message.loopClosures?.length) {
1803
+ obj.loopClosures = message.loopClosures.map((e) => SlamLoopClosure.toJSON(e));
1804
+ }
1805
+ if (message.movedPoses?.length) {
1806
+ obj.movedPoses = message.movedPoses.map((e) => SlamKeyframePoses.toJSON(e));
1807
+ }
1808
+ if (message.removedSubmapIds?.length) {
1809
+ obj.removedSubmapIds = message.removedSubmapIds.map((e) => Math.round(e));
1810
+ }
1811
+ return obj;
1812
+ },
1813
+ create(base) {
1814
+ return SlamMapUpdate.fromPartial(base ?? {});
1815
+ },
1816
+ fromPartial(object) {
1817
+ const message = createBaseSlamMapUpdate();
1818
+ message.mapId = object.mapId ?? 0;
1819
+ message.sequence = object.sequence ?? 0;
1820
+ message.keyframes = object.keyframes?.map((e) => SlamKeyframe.fromPartial(e)) || [];
1821
+ message.submaps = object.submaps?.map((e) => SlamSubmap.fromPartial(e)) || [];
1822
+ message.frame = (object.frame !== undefined && object.frame !== null)
1823
+ ? SlamMapFrame.fromPartial(object.frame)
1824
+ : undefined;
1825
+ message.loopClosures = object.loopClosures?.map((e) => SlamLoopClosure.fromPartial(e)) || [];
1826
+ message.movedPoses = object.movedPoses?.map((e) => SlamKeyframePoses.fromPartial(e)) || [];
1827
+ message.removedSubmapIds = object.removedSubmapIds?.map((e) => e) || [];
1828
+ return message;
1829
+ },
1830
+ };
1831
+ function createBaseSlamAiding() {
1832
+ return { orientation: 0, depth: false, velocity: false };
1833
+ }
1834
+ export const SlamAiding = {
1835
+ encode(message, writer = new BinaryWriter()) {
1836
+ if (message.orientation !== 0) {
1837
+ writer.uint32(8).int32(message.orientation);
1838
+ }
1839
+ if (message.depth !== false) {
1840
+ writer.uint32(16).bool(message.depth);
1841
+ }
1842
+ if (message.velocity !== false) {
1843
+ writer.uint32(24).bool(message.velocity);
1844
+ }
1845
+ return writer;
1846
+ },
1847
+ decode(input, length) {
1848
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1849
+ const end = length === undefined ? reader.len : reader.pos + length;
1850
+ const message = createBaseSlamAiding();
1851
+ while (reader.pos < end) {
1852
+ const tag = reader.uint32();
1853
+ switch (tag >>> 3) {
1854
+ case 1: {
1855
+ if (tag !== 8) {
1856
+ break;
1857
+ }
1858
+ message.orientation = reader.int32();
1859
+ continue;
1860
+ }
1861
+ case 2: {
1862
+ if (tag !== 16) {
1863
+ break;
1864
+ }
1865
+ message.depth = reader.bool();
1866
+ continue;
1867
+ }
1868
+ case 3: {
1869
+ if (tag !== 24) {
1870
+ break;
1871
+ }
1872
+ message.velocity = reader.bool();
1873
+ continue;
1874
+ }
1875
+ }
1876
+ if ((tag & 7) === 4 || tag === 0) {
1877
+ break;
1878
+ }
1879
+ reader.skip(tag & 7);
1880
+ }
1881
+ return message;
1882
+ },
1883
+ fromJSON(object) {
1884
+ return {
1885
+ orientation: isSet(object.orientation) ? slamOrientationSourceFromJSON(object.orientation) : 0,
1886
+ depth: isSet(object.depth) ? gt.Boolean(object.depth) : false,
1887
+ velocity: isSet(object.velocity) ? gt.Boolean(object.velocity) : false,
1888
+ };
1889
+ },
1890
+ toJSON(message) {
1891
+ const obj = {};
1892
+ if (message.orientation !== 0) {
1893
+ obj.orientation = slamOrientationSourceToJSON(message.orientation);
1894
+ }
1895
+ if (message.depth !== false) {
1896
+ obj.depth = message.depth;
1897
+ }
1898
+ if (message.velocity !== false) {
1899
+ obj.velocity = message.velocity;
1900
+ }
1901
+ return obj;
1902
+ },
1903
+ create(base) {
1904
+ return SlamAiding.fromPartial(base ?? {});
1905
+ },
1906
+ fromPartial(object) {
1907
+ const message = createBaseSlamAiding();
1908
+ message.orientation = object.orientation ?? 0;
1909
+ message.depth = object.depth ?? false;
1910
+ message.velocity = object.velocity ?? false;
1911
+ return message;
1912
+ },
1913
+ };
1914
+ function createBaseSlamMapFrame() {
1915
+ return {
1916
+ gravityAligned: false,
1917
+ headingReference: 0,
1918
+ magneticDeclination: undefined,
1919
+ originDepth: undefined,
1920
+ startTime: undefined,
1921
+ platform: 0,
1922
+ };
1923
+ }
1924
+ export const SlamMapFrame = {
1925
+ encode(message, writer = new BinaryWriter()) {
1926
+ if (message.gravityAligned !== false) {
1927
+ writer.uint32(8).bool(message.gravityAligned);
1928
+ }
1929
+ if (message.headingReference !== 0) {
1930
+ writer.uint32(16).int32(message.headingReference);
1931
+ }
1932
+ if (message.magneticDeclination !== undefined) {
1933
+ writer.uint32(29).float(message.magneticDeclination);
1934
+ }
1935
+ if (message.originDepth !== undefined) {
1936
+ writer.uint32(37).float(message.originDepth);
1937
+ }
1938
+ if (message.startTime !== undefined) {
1939
+ Timestamp.encode(toTimestamp(message.startTime), writer.uint32(42).fork()).join();
1940
+ }
1941
+ if (message.platform !== 0) {
1942
+ writer.uint32(48).int32(message.platform);
1943
+ }
1944
+ return writer;
1945
+ },
1946
+ decode(input, length) {
1947
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1948
+ const end = length === undefined ? reader.len : reader.pos + length;
1949
+ const message = createBaseSlamMapFrame();
1950
+ while (reader.pos < end) {
1951
+ const tag = reader.uint32();
1952
+ switch (tag >>> 3) {
1953
+ case 1: {
1954
+ if (tag !== 8) {
1955
+ break;
1956
+ }
1957
+ message.gravityAligned = reader.bool();
1958
+ continue;
1959
+ }
1960
+ case 2: {
1961
+ if (tag !== 16) {
1962
+ break;
1963
+ }
1964
+ message.headingReference = reader.int32();
1965
+ continue;
1966
+ }
1967
+ case 3: {
1968
+ if (tag !== 29) {
1969
+ break;
1970
+ }
1971
+ message.magneticDeclination = reader.float();
1972
+ continue;
1973
+ }
1974
+ case 4: {
1975
+ if (tag !== 37) {
1976
+ break;
1977
+ }
1978
+ message.originDepth = reader.float();
1979
+ continue;
1980
+ }
1981
+ case 5: {
1982
+ if (tag !== 42) {
1983
+ break;
1984
+ }
1985
+ message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1986
+ continue;
1987
+ }
1988
+ case 6: {
1989
+ if (tag !== 48) {
1990
+ break;
1991
+ }
1992
+ message.platform = reader.int32();
1993
+ continue;
1994
+ }
1995
+ }
1996
+ if ((tag & 7) === 4 || tag === 0) {
1997
+ break;
1998
+ }
1999
+ reader.skip(tag & 7);
2000
+ }
2001
+ return message;
2002
+ },
2003
+ fromJSON(object) {
2004
+ return {
2005
+ gravityAligned: isSet(object.gravityAligned) ? gt.Boolean(object.gravityAligned) : false,
2006
+ headingReference: isSet(object.headingReference) ? slamHeadingReferenceFromJSON(object.headingReference) : 0,
2007
+ magneticDeclination: isSet(object.magneticDeclination) ? gt.Number(object.magneticDeclination) : undefined,
2008
+ originDepth: isSet(object.originDepth) ? gt.Number(object.originDepth) : undefined,
2009
+ startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
2010
+ platform: isSet(object.platform) ? slamPlatformFromJSON(object.platform) : 0,
2011
+ };
2012
+ },
2013
+ toJSON(message) {
2014
+ const obj = {};
2015
+ if (message.gravityAligned !== false) {
2016
+ obj.gravityAligned = message.gravityAligned;
2017
+ }
2018
+ if (message.headingReference !== 0) {
2019
+ obj.headingReference = slamHeadingReferenceToJSON(message.headingReference);
2020
+ }
2021
+ if (message.magneticDeclination !== undefined) {
2022
+ obj.magneticDeclination = message.magneticDeclination;
2023
+ }
2024
+ if (message.originDepth !== undefined) {
2025
+ obj.originDepth = message.originDepth;
2026
+ }
2027
+ if (message.startTime !== undefined) {
2028
+ obj.startTime = message.startTime.toISOString();
2029
+ }
2030
+ if (message.platform !== 0) {
2031
+ obj.platform = slamPlatformToJSON(message.platform);
2032
+ }
2033
+ return obj;
2034
+ },
2035
+ create(base) {
2036
+ return SlamMapFrame.fromPartial(base ?? {});
2037
+ },
2038
+ fromPartial(object) {
2039
+ const message = createBaseSlamMapFrame();
2040
+ message.gravityAligned = object.gravityAligned ?? false;
2041
+ message.headingReference = object.headingReference ?? 0;
2042
+ message.magneticDeclination = object.magneticDeclination ?? undefined;
2043
+ message.originDepth = object.originDepth ?? undefined;
2044
+ message.startTime = object.startTime ?? undefined;
2045
+ message.platform = object.platform ?? 0;
2046
+ return message;
2047
+ },
2048
+ };
2049
+ function createBaseSlamMap() {
2050
+ return {
2051
+ mapId: 0,
2052
+ sequence: 0,
2053
+ keyframes: [],
2054
+ submaps: [],
2055
+ frame: undefined,
2056
+ loopClosures: [],
2057
+ part: 0,
2058
+ partCount: 0,
2059
+ };
2060
+ }
2061
+ export const SlamMap = {
2062
+ encode(message, writer = new BinaryWriter()) {
2063
+ if (message.mapId !== 0) {
2064
+ writer.uint32(8).uint32(message.mapId);
2065
+ }
2066
+ if (message.sequence !== 0) {
2067
+ writer.uint32(16).uint64(message.sequence);
2068
+ }
2069
+ for (const v of message.keyframes) {
2070
+ SlamKeyframe.encode(v, writer.uint32(26).fork()).join();
2071
+ }
2072
+ for (const v of message.submaps) {
2073
+ SlamSubmap.encode(v, writer.uint32(34).fork()).join();
2074
+ }
2075
+ if (message.frame !== undefined) {
2076
+ SlamMapFrame.encode(message.frame, writer.uint32(42).fork()).join();
2077
+ }
2078
+ for (const v of message.loopClosures) {
2079
+ SlamLoopClosure.encode(v, writer.uint32(50).fork()).join();
2080
+ }
2081
+ if (message.part !== 0) {
2082
+ writer.uint32(56).uint32(message.part);
2083
+ }
2084
+ if (message.partCount !== 0) {
2085
+ writer.uint32(64).uint32(message.partCount);
2086
+ }
2087
+ return writer;
2088
+ },
2089
+ decode(input, length) {
2090
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2091
+ const end = length === undefined ? reader.len : reader.pos + length;
2092
+ const message = createBaseSlamMap();
2093
+ while (reader.pos < end) {
2094
+ const tag = reader.uint32();
2095
+ switch (tag >>> 3) {
2096
+ case 1: {
2097
+ if (tag !== 8) {
2098
+ break;
2099
+ }
2100
+ message.mapId = reader.uint32();
2101
+ continue;
2102
+ }
2103
+ case 2: {
2104
+ if (tag !== 16) {
2105
+ break;
2106
+ }
2107
+ message.sequence = longToNumber(reader.uint64());
2108
+ continue;
2109
+ }
2110
+ case 3: {
2111
+ if (tag !== 26) {
2112
+ break;
2113
+ }
2114
+ message.keyframes.push(SlamKeyframe.decode(reader, reader.uint32()));
2115
+ continue;
2116
+ }
2117
+ case 4: {
2118
+ if (tag !== 34) {
2119
+ break;
2120
+ }
2121
+ message.submaps.push(SlamSubmap.decode(reader, reader.uint32()));
2122
+ continue;
2123
+ }
2124
+ case 5: {
2125
+ if (tag !== 42) {
2126
+ break;
2127
+ }
2128
+ message.frame = SlamMapFrame.decode(reader, reader.uint32());
2129
+ continue;
2130
+ }
2131
+ case 6: {
2132
+ if (tag !== 50) {
2133
+ break;
2134
+ }
2135
+ message.loopClosures.push(SlamLoopClosure.decode(reader, reader.uint32()));
2136
+ continue;
2137
+ }
2138
+ case 7: {
2139
+ if (tag !== 56) {
2140
+ break;
2141
+ }
2142
+ message.part = reader.uint32();
2143
+ continue;
2144
+ }
2145
+ case 8: {
2146
+ if (tag !== 64) {
2147
+ break;
2148
+ }
2149
+ message.partCount = reader.uint32();
2150
+ continue;
2151
+ }
2152
+ }
2153
+ if ((tag & 7) === 4 || tag === 0) {
2154
+ break;
2155
+ }
2156
+ reader.skip(tag & 7);
2157
+ }
2158
+ return message;
2159
+ },
2160
+ fromJSON(object) {
2161
+ return {
2162
+ mapId: isSet(object.mapId) ? gt.Number(object.mapId) : 0,
2163
+ sequence: isSet(object.sequence) ? gt.Number(object.sequence) : 0,
2164
+ keyframes: gt.Array.isArray(object?.keyframes) ? object.keyframes.map((e) => SlamKeyframe.fromJSON(e)) : [],
2165
+ submaps: gt.Array.isArray(object?.submaps) ? object.submaps.map((e) => SlamSubmap.fromJSON(e)) : [],
2166
+ frame: isSet(object.frame) ? SlamMapFrame.fromJSON(object.frame) : undefined,
2167
+ loopClosures: gt.Array.isArray(object?.loopClosures)
2168
+ ? object.loopClosures.map((e) => SlamLoopClosure.fromJSON(e))
2169
+ : [],
2170
+ part: isSet(object.part) ? gt.Number(object.part) : 0,
2171
+ partCount: isSet(object.partCount) ? gt.Number(object.partCount) : 0,
2172
+ };
2173
+ },
2174
+ toJSON(message) {
2175
+ const obj = {};
2176
+ if (message.mapId !== 0) {
2177
+ obj.mapId = Math.round(message.mapId);
2178
+ }
2179
+ if (message.sequence !== 0) {
2180
+ obj.sequence = Math.round(message.sequence);
2181
+ }
2182
+ if (message.keyframes?.length) {
2183
+ obj.keyframes = message.keyframes.map((e) => SlamKeyframe.toJSON(e));
2184
+ }
2185
+ if (message.submaps?.length) {
2186
+ obj.submaps = message.submaps.map((e) => SlamSubmap.toJSON(e));
2187
+ }
2188
+ if (message.frame !== undefined) {
2189
+ obj.frame = SlamMapFrame.toJSON(message.frame);
2190
+ }
2191
+ if (message.loopClosures?.length) {
2192
+ obj.loopClosures = message.loopClosures.map((e) => SlamLoopClosure.toJSON(e));
2193
+ }
2194
+ if (message.part !== 0) {
2195
+ obj.part = Math.round(message.part);
2196
+ }
2197
+ if (message.partCount !== 0) {
2198
+ obj.partCount = Math.round(message.partCount);
2199
+ }
2200
+ return obj;
2201
+ },
2202
+ create(base) {
2203
+ return SlamMap.fromPartial(base ?? {});
2204
+ },
2205
+ fromPartial(object) {
2206
+ const message = createBaseSlamMap();
2207
+ message.mapId = object.mapId ?? 0;
2208
+ message.sequence = object.sequence ?? 0;
2209
+ message.keyframes = object.keyframes?.map((e) => SlamKeyframe.fromPartial(e)) || [];
2210
+ message.submaps = object.submaps?.map((e) => SlamSubmap.fromPartial(e)) || [];
2211
+ message.frame = (object.frame !== undefined && object.frame !== null)
2212
+ ? SlamMapFrame.fromPartial(object.frame)
2213
+ : undefined;
2214
+ message.loopClosures = object.loopClosures?.map((e) => SlamLoopClosure.fromPartial(e)) || [];
2215
+ message.part = object.part ?? 0;
2216
+ message.partCount = object.partCount ?? 0;
2217
+ return message;
2218
+ },
2219
+ };
2220
+ function createBaseSlamScan() {
2221
+ return { mapId: 0, pose: undefined, points: undefined, sensor: undefined, mount: undefined, time: undefined };
2222
+ }
2223
+ export const SlamScan = {
2224
+ encode(message, writer = new BinaryWriter()) {
2225
+ if (message.mapId !== 0) {
2226
+ writer.uint32(8).uint32(message.mapId);
2227
+ }
2228
+ if (message.pose !== undefined) {
2229
+ SlamPose.encode(message.pose, writer.uint32(18).fork()).join();
2230
+ }
2231
+ if (message.points !== undefined) {
2232
+ PointCloud.encode(message.points, writer.uint32(26).fork()).join();
2233
+ }
2234
+ if (message.sensor !== undefined) {
2235
+ SlamSensor.encode(message.sensor, writer.uint32(34).fork()).join();
2236
+ }
2237
+ if (message.mount !== undefined) {
2238
+ SlamPose.encode(message.mount, writer.uint32(42).fork()).join();
2239
+ }
2240
+ if (message.time !== undefined) {
2241
+ Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).join();
2242
+ }
2243
+ return writer;
2244
+ },
2245
+ decode(input, length) {
2246
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2247
+ const end = length === undefined ? reader.len : reader.pos + length;
2248
+ const message = createBaseSlamScan();
2249
+ while (reader.pos < end) {
2250
+ const tag = reader.uint32();
2251
+ switch (tag >>> 3) {
2252
+ case 1: {
2253
+ if (tag !== 8) {
2254
+ break;
2255
+ }
2256
+ message.mapId = reader.uint32();
2257
+ continue;
2258
+ }
2259
+ case 2: {
2260
+ if (tag !== 18) {
2261
+ break;
2262
+ }
2263
+ message.pose = SlamPose.decode(reader, reader.uint32());
2264
+ continue;
2265
+ }
2266
+ case 3: {
2267
+ if (tag !== 26) {
2268
+ break;
2269
+ }
2270
+ message.points = PointCloud.decode(reader, reader.uint32());
2271
+ continue;
2272
+ }
2273
+ case 4: {
2274
+ if (tag !== 34) {
2275
+ break;
2276
+ }
2277
+ message.sensor = SlamSensor.decode(reader, reader.uint32());
2278
+ continue;
2279
+ }
2280
+ case 5: {
2281
+ if (tag !== 42) {
2282
+ break;
2283
+ }
2284
+ message.mount = SlamPose.decode(reader, reader.uint32());
2285
+ continue;
2286
+ }
2287
+ case 6: {
2288
+ if (tag !== 50) {
2289
+ break;
2290
+ }
2291
+ message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2292
+ continue;
2293
+ }
2294
+ }
2295
+ if ((tag & 7) === 4 || tag === 0) {
2296
+ break;
2297
+ }
2298
+ reader.skip(tag & 7);
2299
+ }
2300
+ return message;
2301
+ },
2302
+ fromJSON(object) {
2303
+ return {
2304
+ mapId: isSet(object.mapId) ? gt.Number(object.mapId) : 0,
2305
+ pose: isSet(object.pose) ? SlamPose.fromJSON(object.pose) : undefined,
2306
+ points: isSet(object.points) ? PointCloud.fromJSON(object.points) : undefined,
2307
+ sensor: isSet(object.sensor) ? SlamSensor.fromJSON(object.sensor) : undefined,
2308
+ mount: isSet(object.mount) ? SlamPose.fromJSON(object.mount) : undefined,
2309
+ time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
2310
+ };
2311
+ },
2312
+ toJSON(message) {
2313
+ const obj = {};
2314
+ if (message.mapId !== 0) {
2315
+ obj.mapId = Math.round(message.mapId);
2316
+ }
2317
+ if (message.pose !== undefined) {
2318
+ obj.pose = SlamPose.toJSON(message.pose);
2319
+ }
2320
+ if (message.points !== undefined) {
2321
+ obj.points = PointCloud.toJSON(message.points);
2322
+ }
2323
+ if (message.sensor !== undefined) {
2324
+ obj.sensor = SlamSensor.toJSON(message.sensor);
2325
+ }
2326
+ if (message.mount !== undefined) {
2327
+ obj.mount = SlamPose.toJSON(message.mount);
2328
+ }
2329
+ if (message.time !== undefined) {
2330
+ obj.time = message.time.toISOString();
2331
+ }
2332
+ return obj;
2333
+ },
2334
+ create(base) {
2335
+ return SlamScan.fromPartial(base ?? {});
2336
+ },
2337
+ fromPartial(object) {
2338
+ const message = createBaseSlamScan();
2339
+ message.mapId = object.mapId ?? 0;
2340
+ message.pose = (object.pose !== undefined && object.pose !== null) ? SlamPose.fromPartial(object.pose) : undefined;
2341
+ message.points = (object.points !== undefined && object.points !== null)
2342
+ ? PointCloud.fromPartial(object.points)
2343
+ : undefined;
2344
+ message.sensor = (object.sensor !== undefined && object.sensor !== null)
2345
+ ? SlamSensor.fromPartial(object.sensor)
2346
+ : undefined;
2347
+ message.mount = (object.mount !== undefined && object.mount !== null)
2348
+ ? SlamPose.fromPartial(object.mount)
2349
+ : undefined;
2350
+ message.time = object.time ?? undefined;
2351
+ return message;
2352
+ },
2353
+ };
2354
+ const gt = (() => {
2355
+ if (typeof globalThis !== "undefined") {
2356
+ return globalThis;
2357
+ }
2358
+ if (typeof self !== "undefined") {
2359
+ return self;
2360
+ }
2361
+ if (typeof window !== "undefined") {
2362
+ return window;
2363
+ }
2364
+ if (typeof global !== "undefined") {
2365
+ return global;
2366
+ }
2367
+ throw "Unable to locate global object";
2368
+ })();
2369
+ function bytesFromBase64(b64) {
2370
+ if (gt.Buffer) {
2371
+ return Uint8Array.from(gt.Buffer.from(b64, "base64"));
2372
+ }
2373
+ else {
2374
+ const bin = gt.atob(b64);
2375
+ const arr = new Uint8Array(bin.length);
2376
+ for (let i = 0; i < bin.length; ++i) {
2377
+ arr[i] = bin.charCodeAt(i);
2378
+ }
2379
+ return arr;
2380
+ }
2381
+ }
2382
+ function base64FromBytes(arr) {
2383
+ if (gt.Buffer) {
2384
+ return gt.Buffer.from(arr).toString("base64");
2385
+ }
2386
+ else {
2387
+ const bin = [];
2388
+ arr.forEach((byte) => {
2389
+ bin.push(gt.String.fromCharCode(byte));
2390
+ });
2391
+ return gt.btoa(bin.join(""));
2392
+ }
2393
+ }
2394
+ function toTimestamp(date) {
2395
+ const seconds = Math.trunc(date.getTime() / 1_000);
2396
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
2397
+ return { seconds, nanos };
2398
+ }
2399
+ function fromTimestamp(t) {
2400
+ let millis = (t.seconds || 0) * 1_000;
2401
+ millis += (t.nanos || 0) / 1_000_000;
2402
+ return new gt.Date(millis);
2403
+ }
2404
+ function fromJsonTimestamp(o) {
2405
+ if (o instanceof gt.Date) {
2406
+ return o;
2407
+ }
2408
+ else if (typeof o === "string") {
2409
+ return new gt.Date(o);
2410
+ }
2411
+ else {
2412
+ return fromTimestamp(Timestamp.fromJSON(o));
2413
+ }
2414
+ }
2415
+ function longToNumber(int64) {
2416
+ const num = gt.Number(int64.toString());
2417
+ if (num > gt.Number.MAX_SAFE_INTEGER) {
2418
+ throw new gt.Error("Value is larger than Number.MAX_SAFE_INTEGER");
2419
+ }
2420
+ if (num < gt.Number.MIN_SAFE_INTEGER) {
2421
+ throw new gt.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
2422
+ }
2423
+ return num;
2424
+ }
2425
+ function isSet(value) {
2426
+ return value !== null && value !== undefined;
2427
+ }