|
23 | 23 | from projectaria_tools.core import data_provider |
24 | 24 |
|
25 | 25 | import rerun as rr |
| 26 | +from projectaria_tools.core.calibration import DeviceVersion |
26 | 27 | from projectaria_tools.core.sensor_data import SensorDataType, TimeDomain, TimeSyncMode |
27 | 28 | from projectaria_tools.tools.aria_rerun_viewer.aria_data_plotter import ( |
28 | 29 | AriaDataViewer, |
29 | 30 | AriaDataViewerConfig, |
30 | 31 | ) |
31 | 32 | from tqdm import tqdm |
32 | 33 |
|
33 | | -# TODO: add support for other streams |
34 | | -ALL_STREAM_LABELS = [ |
35 | | - # Gen2 |
| 34 | +ALL_STREAM_LABELS_GEN2 = [ |
36 | 35 | "camera-rgb", |
37 | 36 | "slam-front-left", |
38 | 37 | "slam-front-right", |
|
50 | 49 | "eyegaze", |
51 | 50 | "vio", |
52 | 51 | "vio_high_frequency", |
53 | | - # Gen1 |
| 52 | +] |
| 53 | +ALL_STREAM_LABELS_GEN1 = [ |
54 | 54 | "camera-slam-left", |
55 | 55 | "camera-slam-right", |
56 | 56 | "camera-et", |
| 57 | + "camera-rgb", |
| 58 | + "imu-left", |
| 59 | + "imu-right", |
| 60 | + "mic", |
| 61 | + "baro0", |
| 62 | + "mag0", |
| 63 | + "gps", |
57 | 64 | ] |
58 | 65 |
|
59 | 66 |
|
@@ -102,7 +109,7 @@ def parse_args(): |
102 | 109 | parser.add_argument( |
103 | 110 | "--enabled-streams", |
104 | 111 | nargs="*", |
105 | | - choices=ALL_STREAM_LABELS, |
| 112 | + choices=ALL_STREAM_LABELS_GEN2 + ALL_STREAM_LABELS_GEN1, |
106 | 113 | help="Enable specific viewers by their labels, e.g. `camera-rgb eyegaze`, Use space-separated pairs. (default: all)", |
107 | 114 | ) |
108 | 115 | parser.add_argument( |
@@ -137,8 +144,6 @@ def get_deliver_option( |
137 | 144 | Configured deliver options object |
138 | 145 | """ |
139 | 146 | # Use defaults if not provided |
140 | | - if enabled_stream_labels is None: |
141 | | - enabled_stream_labels = ALL_STREAM_LABELS |
142 | 147 | if subsample_rates is None: |
143 | 148 | subsample_rates = {} |
144 | 149 |
|
@@ -279,19 +284,26 @@ def main(): |
279 | 284 |
|
280 | 285 | # Step 2: Extract device_calibration from vrs_data_provider |
281 | 286 | 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}") |
282 | 294 |
|
283 | 295 | # Step 3: Create config |
284 | 296 | viewer_config = AriaDataViewerConfig() |
285 | 297 |
|
286 | 298 | # Step 4: Get configured deliver options |
287 | 299 | parsed_subsample_rates = ( |
288 | | - parse_subsample_rates(args.subsample_rates, ALL_STREAM_LABELS) |
| 300 | + parse_subsample_rates(args.subsample_rates, all_stream_labels) |
289 | 301 | if args.subsample_rates |
290 | 302 | else {} |
291 | 303 | ) |
292 | 304 | deliver_options = get_deliver_option( |
293 | 305 | 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, |
295 | 307 | subsample_rates=parsed_subsample_rates, |
296 | 308 | viewer_config=viewer_config, |
297 | 309 | skip_begin_sec=args.skip_begin_sec, |
|
0 commit comments