"""Build K1 observation layouts with the repository's pinned Rerun SDK. These assets contain renderer configuration only, never captured device data. Run with .venv/bin/python scripts/build_observation_blueprints.py. """ from pathlib import Path import rerun as rr from rerun import blueprint as rrb from k1link.viewer.rerun_bridge import _live_time_panel destination = Path(__file__).resolve().parents[1] / "plugins/xgrids-k1/frontend/src/sensors" for mode, position, up in ( ("3d", [16.0, -16.0, 18.0], [0.0, 0.0, 1.0]), ("plan", [0.0, 0.0, 30.0], [0.0, 1.0, 0.0]), ): view = rrb.Spatial3DView( origin="/world", contents=["/world/**"], name="K1 ยท " + mode, eye_controls=rrb.EyeControls3D.from_fields( kind=rrb.Eye3DKind.Orbital, position=position, look_target=[0.0, 0.0, 0.0], eye_up=up, tracking_entity="/world/sensor_pose", ), time_ranges=[rr.VisibleTimeRange("stream_time", start=rr.TimeRangeBoundary.cursor_relative(seconds=-12), end=rr.TimeRangeBoundary.cursor_relative())], ) rrb.Blueprint(view, _live_time_panel(), auto_layout=False, auto_views=False, collapse_panels=True).save( "nodedc_mission_core_spatial", destination / f"observation-{mode}.rbl" )