Commit 61eecda
{BugFix} Visualization - Show optional viewer panels only when recorded
Summary:
Explanation:
`aria_rerun_viewer` always rendered the Neural Band tabs (EMG, EMG volts, accel, gyro)
and the GPS map view for Gen2 recordings, even for files that contain neither sensor.
The panels stayed empty for the whole session while still consuming layout space.
Two causes, both in `tools/aria_rerun_viewer/aria_rerun_viewer.py`:
- `enable_neural_band_batch` was derived from `get_stream_id_from_label("emg")`, which is
not a presence check. For Gen2 the label mapper answers from a mostly-static
device-model table, so it returns an id for every label the glasses *could* record
(`emg` -> 241-1, `gps` -> 281-2, ...) whether or not the file has that stream. The
condition was therefore true for every Gen2 recording.
- `enable_gps` was hardcoded to `True`.
Adds `get_recorded_stream_id()`, which resolves a label only when the recording really
carries that sensor: the label must map to a stream id, the id must appear in
`get_all_streams()`, and the stream must hold at least one data record. The last check
also covers streams that are declared in the file but never written to. Both optional
panels are now driven by it, and the Neural Band calibration lookup reuses the resolved
id instead of querying the label a second time.
Only blueprint composition changes. Stream delivery already filtered against
`DeliverQueuedOptions.get_stream_ids()`, so no sensor data was ever plotted for absent
streams and playback behavior is unchanged.
Reproducibility:
Verified on a Gen2 recording with no Neural Band stream by dumping the blueprint with
`--rrd-output-path` before and after the change: the four Neural Band views disappear
while the GPS view is retained, since that recording does contain GPS. Unit tests cover
a recorded stream, a label that maps to an absent stream, a stream with zero data
records, and the GPS variants.
___
Differential Revision: D115492740
fbshipit-source-id: e843378fb840be533ce8d1c76e4d832941d75d361 parent 5f3dd47 commit 61eecda
2 files changed
Lines changed: 161 additions & 37 deletions
File tree
- projectaria_tools/tools/aria_rerun_viewer
- tests
Lines changed: 43 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
140 | 162 | | |
141 | 163 | | |
142 | 164 | | |
| |||
339 | 361 | | |
340 | 362 | | |
341 | 363 | | |
342 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
343 | 367 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
348 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
349 | 375 | | |
350 | 376 | | |
351 | 377 | | |
| |||
370 | 396 | | |
371 | 397 | | |
372 | 398 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
389 | 411 | | |
390 | 412 | | |
391 | 413 | | |
| |||
Lines changed: 118 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
161 | 203 | | |
162 | 204 | | |
163 | 205 | | |
| |||
578 | 620 | | |
579 | 621 | | |
580 | 622 | | |
| 623 | + | |
| 624 | + | |
581 | 625 | | |
582 | 626 | | |
583 | 627 | | |
584 | 628 | | |
585 | 629 | | |
586 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
587 | 636 | | |
588 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
589 | 641 | | |
590 | | - | |
| 642 | + | |
| 643 | + | |
591 | 644 | | |
| 645 | + | |
592 | 646 | | |
593 | 647 | | |
594 | 648 | | |
| |||
597 | 651 | | |
598 | 652 | | |
599 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
600 | 659 | | |
601 | 660 | | |
602 | | - | |
603 | | - | |
604 | | - | |
| 661 | + | |
605 | 662 | | |
606 | 663 | | |
607 | 664 | | |
| |||
686 | 743 | | |
687 | 744 | | |
688 | 745 | | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
| 746 | + | |
| 747 | + | |
697 | 748 | | |
698 | | - | |
699 | | - | |
| 749 | + | |
700 | 750 | | |
701 | | - | |
702 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
703 | 805 | | |
704 | 806 | | |
705 | 807 | | |
| |||
0 commit comments