Skip to content

Commit 9568f39

Browse files
YLouWashUfacebook-github-bot
authored andcommitted
{BugFix} Remove wrong error message on unfound sensor labels.
Summary: This diff removes some false alert on sensor labels not found. Reviewed By: PiotrBrzyski Differential Revision: D82930953 fbshipit-source-id: 9d9c2db07a071bfa85472b7696380fd8b675f9b9
1 parent 626f480 commit 9568f39

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

projectaria_tools/tools/aria_rerun_viewer/aria_rerun_viewer.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@
2323
from projectaria_tools.core import data_provider
2424

2525
import rerun as rr
26+
from projectaria_tools.core.calibration import DeviceVersion
2627
from projectaria_tools.core.sensor_data import SensorDataType, TimeDomain, TimeSyncMode
2728
from projectaria_tools.tools.aria_rerun_viewer.aria_data_plotter import (
2829
AriaDataViewer,
2930
AriaDataViewerConfig,
3031
)
3132
from tqdm import tqdm
3233

33-
# TODO: add support for other streams
34-
ALL_STREAM_LABELS = [
35-
# Gen2
34+
ALL_STREAM_LABELS_GEN2 = [
3635
"camera-rgb",
3736
"slam-front-left",
3837
"slam-front-right",
@@ -50,10 +49,18 @@
5049
"eyegaze",
5150
"vio",
5251
"vio_high_frequency",
53-
# Gen1
52+
]
53+
ALL_STREAM_LABELS_GEN1 = [
5454
"camera-slam-left",
5555
"camera-slam-right",
5656
"camera-et",
57+
"camera-rgb",
58+
"imu-left",
59+
"imu-right",
60+
"mic",
61+
"baro0",
62+
"mag0",
63+
"gps",
5764
]
5865

5966

@@ -102,7 +109,7 @@ def parse_args():
102109
parser.add_argument(
103110
"--enabled-streams",
104111
nargs="*",
105-
choices=ALL_STREAM_LABELS,
112+
choices=ALL_STREAM_LABELS_GEN2 + ALL_STREAM_LABELS_GEN1,
106113
help="Enable specific viewers by their labels, e.g. `camera-rgb eyegaze`, Use space-separated pairs. (default: all)",
107114
)
108115
parser.add_argument(
@@ -137,8 +144,6 @@ def get_deliver_option(
137144
Configured deliver options object
138145
"""
139146
# Use defaults if not provided
140-
if enabled_stream_labels is None:
141-
enabled_stream_labels = ALL_STREAM_LABELS
142147
if subsample_rates is None:
143148
subsample_rates = {}
144149

@@ -279,19 +284,26 @@ def main():
279284

280285
# Step 2: Extract device_calibration from vrs_data_provider
281286
device_calibration = vrs_data_provider.get_device_calibration()
287+
device_version = device_calibration.get_device_version()
288+
if device_version == DeviceVersion.Gen1:
289+
all_stream_labels = ALL_STREAM_LABELS_GEN1
290+
elif device_version == DeviceVersion.Gen2:
291+
all_stream_labels = ALL_STREAM_LABELS_GEN2
292+
else:
293+
raise ValueError(f" Unsupported Aria device version: {device_version}")
282294

283295
# Step 3: Create config
284296
viewer_config = AriaDataViewerConfig()
285297

286298
# Step 4: Get configured deliver options
287299
parsed_subsample_rates = (
288-
parse_subsample_rates(args.subsample_rates, ALL_STREAM_LABELS)
300+
parse_subsample_rates(args.subsample_rates, all_stream_labels)
289301
if args.subsample_rates
290302
else {}
291303
)
292304
deliver_options = get_deliver_option(
293305
vrs_data_provider=vrs_data_provider,
294-
enabled_stream_labels=args.enabled_streams or ALL_STREAM_LABELS,
306+
enabled_stream_labels=args.enabled_streams or all_stream_labels,
295307
subsample_rates=parsed_subsample_rates,
296308
viewer_config=viewer_config,
297309
skip_begin_sec=args.skip_begin_sec,

0 commit comments

Comments
 (0)