Datasets:

DOI:
License:
mateosss commited on
Commit
1e3d185
1 Parent(s): 65f8ea4

Update factory calibration of WMR headsets with wmr2bslt tool

Browse files
M_monado_datasets/MG_reverb_g2/extras/calibration.factory.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "value0": {
3
- "comment": "Calibration as obtained from transfroming factory.json data from the headset into Basalt's calibration format",
4
  "T_imu_cam": [
5
  {
6
  "px": -0.052326593548059466,
 
1
  {
2
  "value0": {
3
+ "comment": "Calibration as obtained from transfroming factory.json data from the headset into Basalt's calibration format with the wmr2bslt_calib.json",
4
  "T_imu_cam": [
5
  {
6
  "px": -0.052326593548059466,
M_monado_datasets/MO_odyssey_plus/extras/calibration.factory.json CHANGED
@@ -1,5 +1,6 @@
1
  {
2
  "value0": {
 
3
  "T_imu_cam": [
4
  {
5
  "px": -0.08394275605678558,
 
1
  {
2
  "value0": {
3
+ "comment": "Calibration as obtained from transfroming factory.json data from the headset into Basalt's calibration format with the wmr2bslt_calib.json",
4
  "T_imu_cam": [
5
  {
6
  "px": -0.08394275605678558,
M_monado_datasets/MO_odyssey_plus/extras/factory.json CHANGED
@@ -1,754 +1,222 @@
1
  {
2
- "CalibrationInformation": {
3
- "Cameras": [
4
- {
5
- "Intrinsics": {
6
- "ModelParameterCount": 15,
7
- "ModelParameters": [
8
- 0.5067707896232605,
9
- 0.51088905334472656,
10
- 0.42040637135505676,
11
- 0.56076663732528687,
12
- 0.6257319450378418,
13
- 0.46612036228179932,
14
- 0.0041795829311013222,
15
- 0.89431935548782349,
16
- 0.54253977537155151,
17
- 0.06621214747428894,
18
- 0.0027008021716028452,
19
- -0.00058499001897871494,
20
- -4.2882973502855748e-05,
21
- -0.00018502399325370789,
22
- 2.7941114902496338
23
- ],
24
- "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
25
- },
26
- "Location": "CALIBRATION_CameraLocationHT0",
27
- "Purpose": "CALIBRATION_CameraPurposeHeadTracking",
28
- "MetricRadius": 2.7941114902496338,
29
- "Rt": {
30
- "Rotation": [
31
- 1,
32
- 0,
33
- 0,
34
- 0,
35
- 1,
36
- 0,
37
- 0,
38
- 0,
39
- 1
40
- ],
41
- "Translation": [
42
- 0,
43
- 0,
44
- 0
45
- ]
46
- },
47
- "SensorHeight": 480,
48
- "SensorWidth": 640,
49
- "Shutter": "CALIBRATION_ShutterTypeUndefined",
50
- "ThermalAdjustmentParams": {
51
- "Params": [
52
- 0,
53
- 0,
54
- 0,
55
- 0,
56
- 0,
57
- 0,
58
- 0,
59
- 0,
60
- 0,
61
- 0,
62
- 0,
63
- 0
64
- ]
65
  }
66
- },
67
- {
68
- "Intrinsics": {
69
- "ModelParameterCount": 15,
70
- "ModelParameters": [
71
- 0.50554186105728149,
72
- 0.52156180143356323,
73
- 0.42205807566642761,
74
- 0.56302011013031006,
75
- 0.55718272924423218,
76
- 0.22437196969985962,
77
- 0.0068156048655509949,
78
- 0.83317267894744873,
79
- 0.26174271106719971,
80
- 0.043505862355232239,
81
- 0.00676964595913887,
82
- -0.0012049071956425905,
83
- 0.0001220563062815927,
84
- 0.00011782468209275976,
85
- 2.7899987697601318
86
- ],
87
- "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
88
- },
89
- "Location": "CALIBRATION_CameraLocationHT1",
90
- "Purpose": "CALIBRATION_CameraPurposeHeadTracking",
91
- "MetricRadius": 2.7899987697601318,
92
- "Rt": {
93
- "Rotation": [
94
- 0.68708890676498413,
95
- -0.0066884770058095455,
96
- -0.726542592048645,
97
- -0.004866383969783783,
98
- 0.99989283084869385,
99
- -0.013807035051286221,
100
- 0.72655707597732544,
101
- 0.013022295199334621,
102
- 0.68698269128799438
103
- ],
104
- "Translation": [
105
- -0.096558056771755219,
106
- -0.00065802858443930745,
107
- -0.041434925049543381
108
- ]
109
- },
110
- "SensorHeight": 480,
111
- "SensorWidth": 640,
112
- "Shutter": "CALIBRATION_ShutterTypeUndefined",
113
- "ThermalAdjustmentParams": {
114
- "Params": [
115
- 0,
116
- 0,
117
- 0,
118
- 0,
119
- 0,
120
- 0,
121
- 0,
122
- 0,
123
- 0,
124
- 0,
125
- 0,
126
- 0
127
- ]
128
  }
129
- },
130
- {
131
- "Intrinsics": {
132
- "ModelParameterCount": 15,
133
- "ModelParameters": [
134
- 0.50590163469314575,
135
- 0.501025915145874,
136
- 0.43491056561470032,
137
- 0.51977533102035522,
138
- 1.3840854167938232,
139
- -1.6851117610931396,
140
- 6.9683127403259277,
141
- 1.4408130645751953,
142
- -1.7367498874664307,
143
- 6.9408659934997559,
144
- 0.015325400047004223,
145
- -9.7191208624280989e-05,
146
- -0.00023150799097493291,
147
- 0.00017367169493809342,
148
- 1.3999999761581421
149
- ],
150
- "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
151
- },
152
- "Location": "CALIBRATION_CameraLocationDO0",
153
- "Purpose": "CALIBRATION_CameraPurposeDisplayObserver",
154
- "MetricRadius": 1.3999999761581421,
155
- "Rt": {
156
- "Rotation": [
157
- 1,
158
- 0,
159
- 0,
160
- 0,
161
- 1,
162
- 0,
163
- 0,
164
- 0,
165
- 1
166
- ],
167
- "Translation": [
168
- 0,
169
- 0,
170
- 0
171
- ]
172
- },
173
- "SensorHeight": 2048,
174
- "SensorWidth": 2448,
175
- "Shutter": "CALIBRATION_ShutterTypeUndefined",
176
- "ThermalAdjustmentParams": {
177
- "Params": [
178
- 0,
179
- 0,
180
- 0,
181
- 0,
182
- 0,
183
- 0,
184
- 0,
185
- 0,
186
- 0,
187
- 0,
188
- 0,
189
- 0
190
- ]
191
  }
192
- },
193
- {
194
- "Intrinsics": {
195
- "ModelParameterCount": 15,
196
- "ModelParameters": [
197
- 0.505301833152771,
198
- 0.50203627347946167,
199
- 0.43675145506858826,
200
- 0.52202123403549194,
201
- 9.5410280227661133,
202
- -19.506465911865234,
203
- 31.453699111938477,
204
- 9.64380931854248,
205
- -19.527170181274414,
206
- 31.339166641235352,
207
- 0.016977680847048759,
208
- 0.0032255123369395733,
209
- -0.00076866301242262125,
210
- 0.000584927445743233,
211
- 1.3999999761581421
212
- ],
213
- "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
214
- },
215
- "Location": "CALIBRATION_CameraLocationDO1",
216
- "Purpose": "CALIBRATION_CameraPurposeDisplayObserver",
217
- "MetricRadius": 1.3999999761581421,
218
- "Rt": {
219
- "Rotation": [
220
- 0.99999630451202393,
221
- 0.0025376041885465384,
222
- -0.00095876428531482816,
223
- -0.0025385897606611252,
224
- 0.99999624490737915,
225
- -0.0010279536945745349,
226
- 0.00095615215832367539,
227
- 0.0010303838644176722,
228
- 0.99999898672103882
229
- ],
230
- "Translation": [
231
- -0.0659172385931015,
232
- 7.41809417377226e-05,
233
- -0.00013815540296491235
234
- ]
235
- },
236
- "SensorHeight": 2048,
237
- "SensorWidth": 2448,
238
- "Shutter": "CALIBRATION_ShutterTypeUndefined",
239
- "ThermalAdjustmentParams": {
240
- "Params": [
241
- 0,
242
- 0,
243
- 0,
244
- 0,
245
- 0,
246
- 0,
247
- 0,
248
- 0,
249
- 0,
250
- 0,
251
- 0,
252
- 0
253
- ]
254
  }
255
- }
256
- ],
257
- "Displays": [
258
- {
259
- "Affine": [
260
- 907.99212646484375,
261
- -0.55761176347732544,
262
- 785.1776123046875,
263
- -0,
264
- 908.129150390625,
265
- 796.96160888671875,
266
- 0,
267
- 0,
268
- 1
269
- ],
270
- "AssignedEye": "CALIBRATION_DisplayEyeLeft",
271
- "DisplayHeight": 1600,
272
- "DisplayWidth": 2880,
273
- "DistortionRed": {
274
- "ModelParameterCount": 5,
275
- "ModelParameters": [
276
- 787.31629583849372,
277
- 795.24291853725526,
278
- 3.9138434409665894e-07,
279
- 2.8758159734654908e-13,
280
- 4.9106499642880268e-19
281
- ],
282
- "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
283
- },
284
- "DistortionGreen": {
285
- "ModelParameterCount": 5,
286
- "ModelParameters": [
287
- 786.6702072553893,
288
- 794.69238050015588,
289
- 4.2007202329361826e-07,
290
- 1.8878438698927907e-13,
291
- 7.0250600169383861e-19
292
- ],
293
- "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
294
- },
295
- "DistortionBlue": {
296
- "ModelParameterCount": 5,
297
- "ModelParameters": [
298
- 785.89252155554175,
299
- 797.67656573162583,
300
- 5.0202131325863806e-07,
301
- -1.2813487061581019e-13,
302
- 1.2345214819185544e-18
303
- ],
304
- "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
305
- },
306
- "EyePositionCorrectionModel": {
307
- "ModelParameterCount": 0,
308
- "ModelParameters": [],
309
- "ModelType": "CALIBRATION_EyePositionCorrectionModelIpdTranslational"
310
- },
311
- "HorizontalFieldOfView": 0,
312
- "VerticalFieldOfView": 0,
313
- "VisibleAreaCenter": {
314
- "X": 785.1776315693005,
315
- "Y": 796.96162857569425
316
- },
317
- "VisibleAreaRadius": 820,
318
- "VBlankToPhotonLatency": 0,
319
- "Rt": {
320
- "Rotation": [
321
- 0.915799617767334,
322
- 0.0045000603422522545,
323
- -0.40161022543907166,
324
- 0.13639208674430847,
325
- 0.93702936172485352,
326
- 0.32151702046394348,
327
- 0.377767413854599,
328
- -0.3492216169834137,
329
- 0.85751736164093018
330
- ],
331
- "Translation": [
332
- -0.021123100072145462,
333
- 0.018961008638143539,
334
- 0.079663842916488647
335
- ]
336
  }
337
- },
338
- {
339
- "Affine": [
340
- 907.9639892578125,
341
- -0.49046245217323303,
342
- 2103.386474609375,
343
- -0,
344
- 907.97808837890625,
345
- 801.86834716796875,
346
- 0,
347
- 0,
348
- 1
349
- ],
350
- "AssignedEye": "CALIBRATION_DisplayEyeRight",
351
- "DisplayHeight": 1600,
352
- "DisplayWidth": 2880,
353
- "DistortionRed": {
354
- "ModelParameterCount": 5,
355
- "ModelParameters": [
356
- 2101.5711896433636,
357
- 800.96838064339022,
358
- 3.9383231143483177e-07,
359
- 2.4224056018878508e-13,
360
- 5.8448606879296118e-19
361
- ],
362
- "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
363
- },
364
- "DistortionGreen": {
365
- "ModelParameterCount": 5,
366
- "ModelParameters": [
367
- 2101.1059339164444,
368
- 799.96334797691441,
369
- 4.2454822843541872e-07,
370
- 1.412440585952293e-13,
371
- 7.9387878585863295e-19
372
- ],
373
- "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
374
- },
375
- "DistortionBlue": {
376
- "ModelParameterCount": 5,
377
- "ModelParameters": [
378
- 2100.8534549194974,
379
- 802.57825131804134,
380
- 5.1161917803099739e-07,
381
- -1.9534633908166077e-13,
382
- 1.3528407038619122e-18
383
- ],
384
- "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
385
- },
386
- "EyePositionCorrectionModel": {
387
- "ModelParameterCount": 0,
388
- "ModelParameters": [],
389
- "ModelType": "CALIBRATION_EyePositionCorrectionModelIpdTranslational"
390
- },
391
- "HorizontalFieldOfView": 0,
392
- "VerticalFieldOfView": 0,
393
- "VisibleAreaCenter": {
394
- "X": 2103.3864389371893,
395
- "Y": 801.86837363199038
396
- },
397
- "VisibleAreaRadius": 820,
398
- "VBlankToPhotonLatency": 0,
399
- "Rt": {
400
- "Rotation": [
401
- 0.9165765643119812,
402
- 0.0027716662734746933,
403
- -0.39984956383705139,
404
- 0.13801105320453644,
405
- 0.93633246421813965,
406
- 0.322853684425354,
407
- 0.37528696656227112,
408
- -0.35110378265380859,
409
- 0.85783785581588745
410
- ],
411
- "Translation": [
412
- -0.086859606206417084,
413
- 0.018304631114006042,
414
- 0.080222859978675842
415
- ]
416
  }
417
- }
418
- ],
419
- "InertialSensors": [
420
- {
421
- "BiasTemperatureModel": [
422
- 0.016492774710059166,
423
- 0,
424
- 0,
425
- 0,
426
- -0.01642640121281147,
427
- 0,
428
- 0,
429
- 0,
430
- -0.0045625129714608192,
431
- 0,
432
- 0,
433
- 0
434
- ],
435
- "BiasUncertainty": [
436
- 9.9999997473787516e-05,
437
- 9.9999997473787516e-05,
438
- 9.9999997473787516e-05
439
- ],
440
- "Id": "CALIBRATION_InertialSensorId_ICM20602",
441
- "MixingMatrixTemperatureModel": [
442
- 1.0000957250595093,
443
- 0,
444
- 0,
445
- 0,
446
- -0.00082343036774545908,
447
- 0,
448
- 0,
449
- 0,
450
- -0.0015050634974613786,
451
- 0,
452
- 0,
453
- 0,
454
- -0.00082384591223672032,
455
- 0,
456
- 0,
457
- 0,
458
- 0.99958902597427368,
459
- 0,
460
- 0,
461
- 0,
462
- -4.7339185584860388e-06,
463
- 0,
464
- 0,
465
- 0,
466
- -0.0015064212493598461,
467
- 0,
468
- 0,
469
- 0,
470
- -4.7357993935293052e-06,
471
- 0,
472
- 0,
473
- 0,
474
- 0.99919366836547852,
475
- 0,
476
- 0,
477
- 0
478
- ],
479
- "ModelTypeMask": 16,
480
- "Noise": [
481
- 0.00095000001601874828,
482
- 0.00095000001601874828,
483
- 0.00095000001601874828,
484
- 0,
485
- 0,
486
- 0
487
- ],
488
- "Rt": {
489
- "Rotation": [
490
- 0.91831707954406738,
491
- 0.0026458536740392447,
492
- -0.39583677053451538,
493
- 0.13994280993938446,
494
- 0.93323278427124023,
495
- 0.33089667558670044,
496
- 0.3702833354473114,
497
- -0.35926258563995361,
498
- 0.85663330554962158
499
- ],
500
- "Translation": [
501
- 0,
502
- 0,
503
- 0
504
- ]
505
- },
506
- "SecondOrderScaling": [
507
- 0,
508
- 0,
509
- 0,
510
- 0,
511
- 0,
512
- 0,
513
- 0,
514
- 0,
515
- 0
516
- ],
517
- "SensorType": "CALIBRATION_InertialSensorType_Gyro",
518
- "TemperatureBounds": [
519
- 5,
520
- 60
521
- ],
522
- "TemperatureC": 0
523
- },
524
- {
525
- "BiasTemperatureModel": [
526
- -0.18563582003116608,
527
- 0,
528
- 0,
529
- 0,
530
- 0.057621683925390244,
531
- 0,
532
- 0,
533
- 0,
534
- -0.13435612618923187,
535
- 0,
536
- 0,
537
- 0
538
- ],
539
- "BiasUncertainty": [
540
- 0.0099999997764825821,
541
- 0.0099999997764825821,
542
- 0.0099999997764825821
543
- ],
544
- "Id": "CALIBRATION_InertialSensorId_ICM20602",
545
- "MixingMatrixTemperatureModel": [
546
- 0.99813401699066162,
547
- 0,
548
- 0,
549
- 0,
550
- 0.00030715670436620712,
551
- 0,
552
- 0,
553
- 0,
554
- -0.00016754241369199008,
555
- 0,
556
- 0,
557
- 0,
558
- 0.00030630044057033956,
559
- 0,
560
- 0,
561
- 0,
562
- 1.0009244680404663,
563
- 0,
564
- 0,
565
- 0,
566
- 0.00029482797253876925,
567
- 0,
568
- 0,
569
- 0,
570
- -0.0001675997773418203,
571
- 0,
572
- 0,
573
- 0,
574
- 0.000295753387035802,
575
- 0,
576
- 0,
577
- 0,
578
- 0.99779242277145386,
579
- 0,
580
- 0,
581
- 0
582
- ],
583
- "ModelTypeMask": 56,
584
- "Noise": [
585
- 0.010700000450015068,
586
- 0.010700000450015068,
587
- 0.010700000450015068,
588
- 0,
589
- 0,
590
- 0
591
- ],
592
- "Rt": {
593
- "Rotation": [
594
- 0.918566882610321,
595
- 0.0016602915711700916,
596
- -0.39526209235191345,
597
- 0.13899369537830353,
598
- 0.93476790189743042,
599
- 0.32693997025489807,
600
- 0.37002113461494446,
601
- -0.35525518655776978,
602
- 0.85841602087020874
603
- ],
604
- "Translation": [
605
- -0.083942756056785583,
606
- -0.0025952591095119715,
607
- 0.0026445253752171993
608
- ]
609
- },
610
- "SecondOrderScaling": [
611
- 0,
612
- 0,
613
- 0,
614
- 0,
615
- 0,
616
- 0,
617
- 0,
618
- 0,
619
- 0
620
- ],
621
- "SensorType": "CALIBRATION_InertialSensorType_Accelerometer",
622
- "TemperatureBounds": [
623
- 5,
624
- 60
625
- ],
626
- "TemperatureC": 0
627
- },
628
- {
629
- "BiasTemperatureModel": [
630
- 0,
631
- 0,
632
- 0,
633
- 0,
634
- 0,
635
- 0,
636
- 0,
637
- 0,
638
- 0,
639
- 0,
640
- 0,
641
- 0
642
- ],
643
- "BiasUncertainty": [
644
- 0,
645
- 0,
646
- 0
647
- ],
648
- "Id": "CALIBRATION_InertialSensorId_AK09916",
649
- "MixingMatrixTemperatureModel": [
650
- 1,
651
- 0,
652
- 0,
653
- 0,
654
- 0,
655
- 0,
656
- 0,
657
- 0,
658
- 0,
659
- 0,
660
- 0,
661
- 0,
662
- 0,
663
- 0,
664
- 0,
665
- 0,
666
- 1,
667
- 0,
668
- 0,
669
- 0,
670
- 0,
671
- 0,
672
- 0,
673
- 0,
674
- 0,
675
- 0,
676
- 0,
677
- 0,
678
- 0,
679
- 0,
680
- 0,
681
- 0,
682
- 1,
683
- 0,
684
- 0,
685
- 0
686
- ],
687
- "ModelTypeMask": 0,
688
- "Noise": [
689
- 0.699999988079071,
690
- 0.699999988079071,
691
- 0.699999988079071,
692
- 0,
693
- 0,
694
- 0
695
- ],
696
- "Rt": {
697
- "Rotation": [
698
- 0.918566882610321,
699
- 0.0016602915711700916,
700
- -0.39526209235191345,
701
- 0.13899369537830353,
702
- 0.93476790189743042,
703
- 0.32693997025489807,
704
- 0.37002113461494446,
705
- -0.35525518655776978,
706
- 0.85841602087020874
707
- ],
708
- "Translation": [
709
- 0,
710
- 0,
711
- 0
712
- ]
713
- },
714
- "SecondOrderScaling": [
715
- 0,
716
- 0,
717
- 0,
718
- 0,
719
- 0,
720
- 0,
721
- 0,
722
- 0,
723
- 0
724
- ],
725
- "SensorType": "CALIBRATION_InertialSensorType_Magnetometer",
726
- "TemperatureBounds": [
727
- 0,
728
- 0
729
- ],
730
- "TemperatureC": 0
731
- }
732
- ],
733
- "Metadata": {
734
- "SerialId": "XQ8198CM61077ZA",
735
- "FactoryCalDate": "6/24/2019 6:38:33 AM GMT",
736
- "Version": {
737
- "Major": 1,
738
- "Minor": 2
739
  },
740
- "DeviceName": "GOERTEK-BUILD-MP"
741
  },
742
- "TemperatureData": {
743
- "ACCEL_0": {
744
- "Average": 36.477929875996843,
745
- "Min": 34.54,
746
- "Max": 37.92
747
  },
748
- "GYRO_0": {
749
- "Average": 36.477925294725082,
750
- "Min": 34.54,
751
- "Max": 37.92
752
  }
753
  }
754
  }
 
1
  {
2
+ "CalibrationInformation": {
3
+ "Cameras": [{
4
+ "Intrinsics": {
5
+ "ModelParameterCount": 15,
6
+ "ModelParameters": [0.5067707896232605, 0.51088905334472656, 0.42040637135505676, 0.56076663732528687, 0.6257319450378418, 0.46612036228179932, 0.0041795829311013222, 0.89431935548782349, 0.54253977537155151, 0.06621214747428894, 0.0027008021716028452, -0.00058499001897871494, -4.2882973502855748e-05, -0.00018502399325370789, 2.7941114902496338],
7
+ "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
8
+ },
9
+ "Location": "CALIBRATION_CameraLocationHT0",
10
+ "Purpose": "CALIBRATION_CameraPurposeHeadTracking",
11
+ "MetricRadius": 2.7941114902496338,
12
+ "Rt": {
13
+ "Rotation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
14
+ "Translation": [0, 0, 0]
15
+ },
16
+ "SensorHeight": 480,
17
+ "SensorWidth": 640,
18
+ "Shutter": "CALIBRATION_ShutterTypeUndefined",
19
+ "ThermalAdjustmentParams": {
20
+ "Params": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
+ }, {
23
+ "Intrinsics": {
24
+ "ModelParameterCount": 15,
25
+ "ModelParameters": [0.50554186105728149, 0.52156180143356323, 0.42205807566642761, 0.56302011013031006, 0.55718272924423218, 0.22437196969985962, 0.0068156048655509949, 0.83317267894744873, 0.26174271106719971, 0.043505862355232239, 0.00676964595913887, -0.0012049071956425905, 0.0001220563062815927, 0.00011782468209275976, 2.7899987697601318],
26
+ "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
27
+ },
28
+ "Location": "CALIBRATION_CameraLocationHT1",
29
+ "Purpose": "CALIBRATION_CameraPurposeHeadTracking",
30
+ "MetricRadius": 2.7899987697601318,
31
+ "Rt": {
32
+ "Rotation": [0.68708890676498413, -0.0066884770058095455, -0.726542592048645, -0.004866383969783783, 0.99989283084869385, -0.013807035051286221, 0.72655707597732544, 0.013022295199334621, 0.68698269128799438],
33
+ "Translation": [-0.096558056771755219, -0.00065802858443930745, -0.041434925049543381]
34
+ },
35
+ "SensorHeight": 480,
36
+ "SensorWidth": 640,
37
+ "Shutter": "CALIBRATION_ShutterTypeUndefined",
38
+ "ThermalAdjustmentParams": {
39
+ "Params": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
+ }, {
42
+ "Intrinsics": {
43
+ "ModelParameterCount": 15,
44
+ "ModelParameters": [0.50590163469314575, 0.501025915145874, 0.43491056561470032, 0.51977533102035522, 1.3840854167938232, -1.6851117610931396, 6.9683127403259277, 1.4408130645751953, -1.7367498874664307, 6.9408659934997559, 0.015325400047004223, -9.7191208624280989e-05, -0.00023150799097493291, 0.00017367169493809342, 1.3999999761581421],
45
+ "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
46
+ },
47
+ "Location": "CALIBRATION_CameraLocationDO0",
48
+ "Purpose": "CALIBRATION_CameraPurposeDisplayObserver",
49
+ "MetricRadius": 1.3999999761581421,
50
+ "Rt": {
51
+ "Rotation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
52
+ "Translation": [0, 0, 0]
53
+ },
54
+ "SensorHeight": 2048,
55
+ "SensorWidth": 2448,
56
+ "Shutter": "CALIBRATION_ShutterTypeUndefined",
57
+ "ThermalAdjustmentParams": {
58
+ "Params": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
60
+ }, {
61
+ "Intrinsics": {
62
+ "ModelParameterCount": 15,
63
+ "ModelParameters": [0.505301833152771, 0.50203627347946167, 0.43675145506858826, 0.52202123403549194, 9.5410280227661133, -19.506465911865234, 31.453699111938477, 9.64380931854248, -19.527170181274414, 31.339166641235352, 0.016977680847048759, 0.0032255123369395733, -0.00076866301242262125, 0.000584927445743233, 1.3999999761581421],
64
+ "ModelType": "CALIBRATION_LensDistortionModelRational6KT"
65
+ },
66
+ "Location": "CALIBRATION_CameraLocationDO1",
67
+ "Purpose": "CALIBRATION_CameraPurposeDisplayObserver",
68
+ "MetricRadius": 1.3999999761581421,
69
+ "Rt": {
70
+ "Rotation": [0.99999630451202393, 0.0025376041885465384, -0.00095876428531482816, -0.0025385897606611252, 0.99999624490737915, -0.0010279536945745349, 0.00095615215832367539, 0.0010303838644176722, 0.99999898672103882],
71
+ "Translation": [-0.0659172385931015, 7.41809417377226e-05, -0.00013815540296491235]
72
+ },
73
+ "SensorHeight": 2048,
74
+ "SensorWidth": 2448,
75
+ "Shutter": "CALIBRATION_ShutterTypeUndefined",
76
+ "ThermalAdjustmentParams": {
77
+ "Params": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
+ }],
80
+ "Displays": [{
81
+ "Affine": [907.99212646484375, -0.55761176347732544, 785.1776123046875, -0, 908.129150390625, 796.96160888671875, 0, 0, 1],
82
+ "AssignedEye": "CALIBRATION_DisplayEyeLeft",
83
+ "DisplayHeight": 1600,
84
+ "DisplayWidth": 2880,
85
+ "DistortionRed": {
86
+ "ModelParameterCount": 5,
87
+ "ModelParameters": [787.31629583849372, 795.24291853725526, 3.9138434409665894e-07, 2.8758159734654908e-13, 4.9106499642880268e-19],
88
+ "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
89
+ },
90
+ "DistortionGreen": {
91
+ "ModelParameterCount": 5,
92
+ "ModelParameters": [786.6702072553893, 794.69238050015588, 4.2007202329361826e-07, 1.8878438698927907e-13, 7.0250600169383861e-19],
93
+ "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
94
+ },
95
+ "DistortionBlue": {
96
+ "ModelParameterCount": 5,
97
+ "ModelParameters": [785.89252155554175, 797.67656573162583, 5.0202131325863806e-07, -1.2813487061581019e-13, 1.2345214819185544e-18],
98
+ "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
99
+ },
100
+ "EyePositionCorrectionModel": {
101
+ "ModelParameterCount": 0,
102
+ "ModelParameters": [],
103
+ "ModelType": "CALIBRATION_EyePositionCorrectionModelIpdTranslational"
104
+ },
105
+ "HorizontalFieldOfView": 0,
106
+ "VerticalFieldOfView": 0,
107
+ "VisibleAreaCenter": {
108
+ "X": 785.1776315693005,
109
+ "Y": 796.96162857569425
110
+ },
111
+ "VisibleAreaRadius": 820,
112
+ "VBlankToPhotonLatency": 0,
113
+ "Rt": {
114
+ "Rotation": [0.915799617767334, 0.0045000603422522545, -0.40161022543907166, 0.13639208674430847, 0.93702936172485352, 0.32151702046394348, 0.377767413854599, -0.3492216169834137, 0.85751736164093018],
115
+ "Translation": [-0.021123100072145462, 0.018961008638143539, 0.079663842916488647]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
+ }, {
118
+ "Affine": [907.9639892578125, -0.49046245217323303, 2103.386474609375, -0, 907.97808837890625, 801.86834716796875, 0, 0, 1],
119
+ "AssignedEye": "CALIBRATION_DisplayEyeRight",
120
+ "DisplayHeight": 1600,
121
+ "DisplayWidth": 2880,
122
+ "DistortionRed": {
123
+ "ModelParameterCount": 5,
124
+ "ModelParameters": [2101.5711896433636, 800.96838064339022, 3.9383231143483177e-07, 2.4224056018878508e-13, 5.8448606879296118e-19],
125
+ "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
126
+ },
127
+ "DistortionGreen": {
128
+ "ModelParameterCount": 5,
129
+ "ModelParameters": [2101.1059339164444, 799.96334797691441, 4.2454822843541872e-07, 1.412440585952293e-13, 7.9387878585863295e-19],
130
+ "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
131
+ },
132
+ "DistortionBlue": {
133
+ "ModelParameterCount": 5,
134
+ "ModelParameters": [2100.8534549194974, 802.57825131804134, 5.1161917803099739e-07, -1.9534633908166077e-13, 1.3528407038619122e-18],
135
+ "ModelType": "CALIBRATION_DisplayDistortionModelPolynomial3K"
136
+ },
137
+ "EyePositionCorrectionModel": {
138
+ "ModelParameterCount": 0,
139
+ "ModelParameters": [],
140
+ "ModelType": "CALIBRATION_EyePositionCorrectionModelIpdTranslational"
141
+ },
142
+ "HorizontalFieldOfView": 0,
143
+ "VerticalFieldOfView": 0,
144
+ "VisibleAreaCenter": {
145
+ "X": 2103.3864389371893,
146
+ "Y": 801.86837363199038
147
+ },
148
+ "VisibleAreaRadius": 820,
149
+ "VBlankToPhotonLatency": 0,
150
+ "Rt": {
151
+ "Rotation": [0.9165765643119812, 0.0027716662734746933, -0.39984956383705139, 0.13801105320453644, 0.93633246421813965, 0.322853684425354, 0.37528696656227112, -0.35110378265380859, 0.85783785581588745],
152
+ "Translation": [-0.086859606206417084, 0.018304631114006042, 0.080222859978675842]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
+ }],
155
+ "InertialSensors": [{
156
+ "BiasTemperatureModel": [0.016492774710059166, 0, 0, 0, -0.01642640121281147, 0, 0, 0, -0.0045625129714608192, 0, 0, 0],
157
+ "BiasUncertainty": [9.9999997473787516e-05, 9.9999997473787516e-05, 9.9999997473787516e-05],
158
+ "Id": "CALIBRATION_InertialSensorId_ICM20602",
159
+ "MixingMatrixTemperatureModel": [1.0000957250595093, 0, 0, 0, -0.00082343036774545908, 0, 0, 0, -0.0015050634974613786, 0, 0, 0, -0.00082384591223672032, 0, 0, 0, 0.99958902597427368, 0, 0, 0, -4.7339185584860388e-06, 0, 0, 0, -0.0015064212493598461, 0, 0, 0, -4.7357993935293052e-06, 0, 0, 0, 0.99919366836547852, 0, 0, 0],
160
+ "ModelTypeMask": 16,
161
+ "Noise": [0.00095000001601874828, 0.00095000001601874828, 0.00095000001601874828, 0, 0, 0],
162
+ "Rt": {
163
+ "Rotation": [0.91831707954406738, 0.0026458536740392447, -0.39583677053451538, 0.13994280993938446, 0.93323278427124023, 0.33089667558670044, 0.3702833354473114, -0.35926258563995361, 0.85663330554962158],
164
+ "Translation": [0, 0, 0]
165
+ },
166
+ "SecondOrderScaling": [0, 0, 0, 0, 0, 0, 0, 0, 0],
167
+ "SensorType": "CALIBRATION_InertialSensorType_Gyro",
168
+ "TemperatureBounds": [5, 60],
169
+ "TemperatureC": 0
170
+ }, {
171
+ "BiasTemperatureModel": [-0.18563582003116608, 0, 0, 0, 0.057621683925390244, 0, 0, 0, -0.13435612618923187, 0, 0, 0],
172
+ "BiasUncertainty": [0.0099999997764825821, 0.0099999997764825821, 0.0099999997764825821],
173
+ "Id": "CALIBRATION_InertialSensorId_ICM20602",
174
+ "MixingMatrixTemperatureModel": [0.99813401699066162, 0, 0, 0, 0.00030715670436620712, 0, 0, 0, -0.00016754241369199008, 0, 0, 0, 0.00030630044057033956, 0, 0, 0, 1.0009244680404663, 0, 0, 0, 0.00029482797253876925, 0, 0, 0, -0.0001675997773418203, 0, 0, 0, 0.000295753387035802, 0, 0, 0, 0.99779242277145386, 0, 0, 0],
175
+ "ModelTypeMask": 56,
176
+ "Noise": [0.010700000450015068, 0.010700000450015068, 0.010700000450015068, 0, 0, 0],
177
+ "Rt": {
178
+ "Rotation": [0.918566882610321, 0.0016602915711700916, -0.39526209235191345, 0.13899369537830353, 0.93476790189743042, 0.32693997025489807, 0.37002113461494446, -0.35525518655776978, 0.85841602087020874],
179
+ "Translation": [-0.083942756056785583, -0.0025952591095119715, 0.0026445253752171993]
180
+ },
181
+ "SecondOrderScaling": [0, 0, 0, 0, 0, 0, 0, 0, 0],
182
+ "SensorType": "CALIBRATION_InertialSensorType_Accelerometer",
183
+ "TemperatureBounds": [5, 60],
184
+ "TemperatureC": 0
185
+ }, {
186
+ "BiasTemperatureModel": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
187
+ "BiasUncertainty": [0, 0, 0],
188
+ "Id": "CALIBRATION_InertialSensorId_AK09916",
189
+ "MixingMatrixTemperatureModel": [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
190
+ "ModelTypeMask": 0,
191
+ "Noise": [0.699999988079071, 0.699999988079071, 0.699999988079071, 0, 0, 0],
192
+ "Rt": {
193
+ "Rotation": [0.918566882610321, 0.0016602915711700916, -0.39526209235191345, 0.13899369537830353, 0.93476790189743042, 0.32693997025489807, 0.37002113461494446, -0.35525518655776978, 0.85841602087020874],
194
+ "Translation": [0, 0, 0]
195
+ },
196
+ "SecondOrderScaling": [0, 0, 0, 0, 0, 0, 0, 0, 0],
197
+ "SensorType": "CALIBRATION_InertialSensorType_Magnetometer",
198
+ "TemperatureBounds": [0, 0],
199
+ "TemperatureC": 0
200
+ }],
201
+ "Metadata": {
202
+ "SerialId": "XQ8198CM61077ZA",
203
+ "FactoryCalDate": "6/24/2019 6:38:33 AM GMT",
204
+ "Version": {
205
+ "Major": 1,
206
+ "Minor": 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  },
208
+ "DeviceName": "GOERTEK-BUILD-MP"
209
  },
210
+ "TemperatureData": {
211
+ "ACCEL_0": {
212
+ "Average": 36.477929875996843,
213
+ "Min": 34.54,
214
+ "Max": 37.92
215
  },
216
+ "GYRO_0": {
217
+ "Average": 36.477925294725082,
218
+ "Min": 34.54,
219
+ "Max": 37.92
220
  }
221
  }
222
  }
M_monado_datasets/extras/wmr2bslt_calib.py ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+
3
+ # Converts Windows Mixed Reality (Reverb G2 and Odyssey+) calibrations in to
4
+ # basalt calibrations.
5
+
6
+ # Run with ./wmr2bslt_calib.py your_wmrcalib.json > your_calib.json
7
+
8
+ import json
9
+ import argparse
10
+ import numpy as np
11
+ from numpy.linalg import inv
12
+
13
+ from math import sqrt
14
+
15
+
16
+ def get(j, name):
17
+ assert name in ["HT0", "HT1", "Gyro", "Accelerometer"]
18
+ is_imu = name in ["Gyro", "Accelerometer"]
19
+ calib = j["CalibrationInformation"]
20
+ sensors = calib["InertialSensors" if is_imu else "Cameras"]
21
+ name_key = "SensorType" if is_imu else "Location"
22
+ sensor = next(filter(lambda s: s[name_key].endswith(name), sensors))
23
+ return sensor
24
+
25
+
26
+ def rt2mat(rt):
27
+ R33 = np.array(rt["Rotation"]).reshape(3, 3)
28
+ t31 = np.array(rt["Translation"]).reshape(3, 1)
29
+ T34 = np.hstack((R33, t31))
30
+ T44 = np.vstack((T34, [0, 0, 0, 1]))
31
+ return T44
32
+
33
+
34
+ def rmat2quat(r):
35
+ w = sqrt(1 + r[0, 0] + r[1, 1] + r[2, 2]) / 2
36
+ w4 = 4 * w
37
+ x = (r[2, 1] - r[1, 2]) / w4
38
+ y = (r[0, 2] - r[2, 0]) / w4
39
+ z = (r[1, 0] - r[0, 1]) / w4
40
+ return np.array([x, y, z, w])
41
+
42
+
43
+ def project(intrinsics, x, y, z):
44
+ fx, fy, cx, cy, k1, k2, k3, k4, k5, k6, p1, p2 = (
45
+ intrinsics["fx"],
46
+ intrinsics["fy"],
47
+ intrinsics["cx"],
48
+ intrinsics["cy"],
49
+ intrinsics["k1"],
50
+ intrinsics["k2"],
51
+ intrinsics["k3"],
52
+ intrinsics["k4"],
53
+ intrinsics["k5"],
54
+ intrinsics["k6"],
55
+ intrinsics["p1"],
56
+ intrinsics["p2"],
57
+ )
58
+
59
+ xp = x / z
60
+ yp = y / z
61
+ r2 = xp * xp + yp * yp
62
+ cdist = (1 + r2 * (k1 + r2 * (k2 + r2 * k3))) / (
63
+ 1 + r2 * (k4 + r2 * (k5 + r2 * k6))
64
+ )
65
+ deltaX = 2 * p1 * xp * yp + p2 * (r2 + 2 * xp * xp)
66
+ deltaY = 2 * p2 * xp * yp + p1 * (r2 + 2 * yp * yp)
67
+ xpp = xp * cdist + deltaX
68
+ ypp = yp * cdist + deltaY
69
+ u = fx * xpp + cx
70
+ v = fy * ypp + cy
71
+ return u, v
72
+
73
+
74
+ def extrinsics(j, cam):
75
+ # NOTE: The `Rt` field seems to be a transform from the sensor to HT0 (i.e.,
76
+ # from HT0 space to sensor space). For basalt we need the transforms
77
+ # expressed w.r.t IMU origin.
78
+
79
+ # NOTE: The gyro and magnetometer translations are 0, probably because an
80
+ # HMD is a rigid body. Therefore the accelerometer is considered as the IMU
81
+ # origin.
82
+
83
+ imu = get(j, "Accelerometer")
84
+ T_i_c0 = rt2mat(imu["Rt"])
85
+
86
+ T = None
87
+ if cam == "HT0":
88
+ T = T_i_c0
89
+ elif cam == "HT1":
90
+ cam1 = get(j, "HT1")
91
+ T_c1_c0 = rt2mat(cam1["Rt"])
92
+ T_c0_c1 = inv(T_c1_c0)
93
+ T_i_c1 = T_i_c0 @ T_c0_c1
94
+ T = T_i_c1
95
+ else:
96
+ assert False
97
+
98
+ q = rmat2quat(T[0:3, 0:3])
99
+ p = T[0:3, 3]
100
+ return {
101
+ "px": p[0],
102
+ "py": p[1],
103
+ "pz": p[2],
104
+ "qx": q[0],
105
+ "qy": q[1],
106
+ "qz": q[2],
107
+ "qw": q[3],
108
+ }
109
+
110
+
111
+ def resolution(j, cam):
112
+ camera = get(j, cam)
113
+ width = camera["SensorWidth"]
114
+ height = camera["SensorHeight"]
115
+ return [width, height]
116
+
117
+
118
+ def intrinsics(j, cam):
119
+ # https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/2feb3425259bf803749065bb6d628c6c180f8e77/include/k4a/k4atypes.h#L1024-L1046
120
+ camera = get(j, cam)
121
+ model_params = camera["Intrinsics"]["ModelParameters"]
122
+ assert (
123
+ camera["Intrinsics"]["ModelType"]
124
+ == "CALIBRATION_LensDistortionModelRational6KT"
125
+ )
126
+ width = camera["SensorWidth"]
127
+ height = camera["SensorHeight"]
128
+ return {
129
+ "camera_type": "pinhole-radtan8",
130
+ "intrinsics": {
131
+ "fx": model_params[2] * width,
132
+ "fy": model_params[3] * height,
133
+ "cx": model_params[0] * width,
134
+ "cy": model_params[1] * height,
135
+ "k1": model_params[4],
136
+ "k2": model_params[5],
137
+ "p1": model_params[13],
138
+ "p2": model_params[12],
139
+ "k3": model_params[6],
140
+ "k4": model_params[7],
141
+ "k5": model_params[8],
142
+ "k6": model_params[9],
143
+ "rpmax": model_params[14],
144
+ },
145
+ }
146
+
147
+
148
+ def view_offset(j):
149
+ """
150
+ This is a very rough offset in pixels between the two cameras. Originally we
151
+ needed to manually estimate it like explained and shown here
152
+ https://youtu.be/jyQKjyRVMS4?t=670.
153
+ With this calculation we get a similar number without the need to open Gimp.
154
+
155
+ In reality this offset changes based on distance to the point, nonetheless
156
+ it helps to get some features tracked in the right camera.
157
+ """
158
+
159
+ # Rough approximation of how far from the cameras features will likely be in your room
160
+ DISTANCE_TO_WALL = 2 # In meters
161
+
162
+ cam1 = get(j, "HT1")
163
+ width = cam1["SensorWidth"]
164
+ height = cam1["SensorHeight"]
165
+ cam1_intrinsics = intrinsics(j, "HT1")["intrinsics"]
166
+ T_c1_c0 = rt2mat(cam1["Rt"]) # Maps a point in c0 space to c1 space
167
+ p = np.array([0, 0, DISTANCE_TO_WALL, 1]) # Fron tof c0, in homogeneous coords
168
+ p_in_c1 = T_c1_c0 @ p # Point in c1 coordinates
169
+ u, v = project(cam1_intrinsics, *p_in_c1[0:3])
170
+ view_offset = [width / 2 - u, height / 2 - v] # We used a point in the middle of c0
171
+ return view_offset
172
+
173
+
174
+ def calib_accel_bias(j):
175
+ # https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/2feb3425259bf803749065bb6d628c6c180f8e77/include/k4ainternal/calibration.h#L48-L77
176
+ # https://vladyslavusenko.gitlab.io/basalt-headers/classbasalt_1_1CalibAccelBias.html#details
177
+ # https://gitlab.com/VladyslavUsenko/basalt-headers/-/issues/8
178
+ accel = get(j, "Accelerometer")
179
+ bias = accel["BiasTemperatureModel"]
180
+ align = accel["MixingMatrixTemperatureModel"]
181
+ return [
182
+ -bias[0 * 4],
183
+ -bias[1 * 4],
184
+ -bias[2 * 4],
185
+ align[0 * 4] - 1, # [0, 0]
186
+ align[3 * 4], # [1, 0]
187
+ align[6 * 4], # [2, 0]
188
+ align[4 * 4] - 1, # [1, 1]
189
+ align[7 * 4], # [2, 1]
190
+ align[8 * 4] - 1, # [2, 2]
191
+ ]
192
+
193
+
194
+ def calib_gyro_bias(j):
195
+ # https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/2feb3425259bf803749065bb6d628c6c180f8e77/include/k4ainternal/calibration.h#L48-L77
196
+ # https://vladyslavusenko.gitlab.io/basalt-headers/classbasalt_1_1CalibGyroBias.html#details
197
+ gyro = get(j, "Gyro")
198
+ bias = gyro["BiasTemperatureModel"]
199
+ align = gyro["MixingMatrixTemperatureModel"]
200
+ return [
201
+ -bias[0 * 4],
202
+ -bias[1 * 4],
203
+ -bias[2 * 4],
204
+ align[0 * 4] - 1, # [0, 0]
205
+ align[3 * 4], # [1, 0]
206
+ align[6 * 4], # [2, 0]
207
+ align[1 * 4], # [0, 1]
208
+ align[4 * 4] - 1, # [1, 1]
209
+ align[7 * 4], # [2, 1]
210
+ align[2 * 4], # [0, 2]
211
+ align[5 * 4], # [1, 2]
212
+ align[8 * 4] - 1, # [2, 2]
213
+ ]
214
+
215
+
216
+ def noise_std(j, name):
217
+ imu = get(j, name)
218
+ return imu["Noise"][0:3]
219
+
220
+
221
+ def bias_std(j, name):
222
+ imu = get(j, name)
223
+ return list(map(sqrt, imu["BiasUncertainty"]))
224
+
225
+
226
+ def main():
227
+ parser = argparse.ArgumentParser()
228
+ parser.add_argument("wmr_json_file", help="Input WMR json calibration file")
229
+ args = parser.parse_args()
230
+ in_fn = args.wmr_json_file
231
+
232
+ with open(in_fn) as f:
233
+ j = json.load(f)
234
+
235
+ # We get 250 packets with 4 samples each per second, totalling 1000 samples per second.
236
+ # But in monado we just average those 4 samples to reduce the noise. So we have 250hz.
237
+ IMU_UPDATE_RATE = 250
238
+
239
+ out_calib = {
240
+ "value0": {
241
+ "T_imu_cam": [extrinsics(j, "HT0"), extrinsics(j, "HT1")],
242
+ "intrinsics": [intrinsics(j, "HT0"), intrinsics(j, "HT1")],
243
+ "resolution": [resolution(j, "HT0"), resolution(j, "HT1")],
244
+ "calib_accel_bias": calib_accel_bias(j),
245
+ "calib_gyro_bias": calib_gyro_bias(j),
246
+ "imu_update_rate": IMU_UPDATE_RATE,
247
+ "accel_noise_std": noise_std(j, "Accelerometer"),
248
+ "gyro_noise_std": noise_std(j, "Gyro"),
249
+ "accel_bias_std": bias_std(j, "Accelerometer"),
250
+ "gyro_bias_std": bias_std(j, "Gyro"),
251
+ "cam_time_offset_ns": 0,
252
+ # "view_offset": view_offset(j),
253
+ "vignette": [],
254
+ }
255
+ }
256
+
257
+ print(json.dumps(out_calib, indent=4))
258
+
259
+
260
+ if __name__ == "__main__":
261
+ main()