Loading...
Loading...
Design a Rerun blueprint from the data, then iterate on it from headless screenshots. Read this when laying out a recording or dataset in the viewer, designing a default blueprint, or deciding which views show which entities. Covers archetype-to-view mapping, layout reasoning, the rrb construction API, the contents grammar, and the screenshot loop.
npx skill4agent add rerun-io/rerun rerun-blueprintdir(rrb)help(rrb.Spatial3DView)import rerun.blueprint as rrb(entity_path, archetype)rerun-catalog-queriesfor c in dataset.schema().component_columns():
print(c.entity_path, c.archetype, c.component_name)RrdReaderentity_pathrerun-chunk-processing| Archetype family | View |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| tabular / catalog data | |
DataframeViewTransform3DSpatial3DViewPinholeSpatial2DViewScalarsTimeSeriesViewcolumn_sharesrow_sharesGridHorizontalVerticalTabsGridTabsoriginnameorigin/blueprint = rrb.Blueprint(
rrb.Horizontal(
rrb.Spatial3DView(origin="/world", name="Scene"),
rrb.Vertical(
rrb.Spatial2DView(origin="/world/camera", name="Camera"),
rrb.TimeSeriesView(origin="/sensors", name="Sensors"),
),
column_shares=[3, 2],
),
rrb.TextLogView(origin="/logs", name="Logs"),
collapse_panels=True,
)contents"$origin/**"contents=["+ $origin/**", "- $origin/internal/**"]/**Transform3DPinholeoriginCoordinateFrame(frame=...)spatial_information=rrb.SpatialInformation(target_frame="<frame>")<frame>origin="/"tf#/CoordinateFrame:frame.rrdrecording_idimport time
import rerun as rr
import rerun.blueprint as rrb
from rerun.experimental import ViewerClient, RrdReader
store = RrdReader("segment.rrd").recordings()[0] # the rrd's application id + recording id
with ViewerClient.spawn(headless=True, port=9879) as viewer:
rec = rr.RecordingStream(store.application_id, recording_id=store.recording_id)
rec.connect_grpc(url=viewer.url)
rec.log_file_from_path("segment.rrd")
def shot(blueprint, path):
rec.send_blueprint(blueprint, make_active=True, make_default=True)
time.sleep(2) # let the import finish and a frame render; bump if a view is blank
viewer.save_screenshot(path) # view_id=view.id for a single view
shot(blueprint_v1, "bp_v1.png")
# Read bp_v1.png, revise, send the next one into the same viewer.
shot(blueprint_v2, "bp_v2.png")default_blueprint=rr.initspawnconnect_grpcsaveblueprint=notebook_showDataframeViewquery=rrb.archetypes.DataframeQuery(timeline="<timeline>", apply_latest_at=True)rrb.TimePanel(play_state=rrb.components.PlayState.Following)rrbViewerClientrerun.experimentalhelp()rerun-data-modelrerun-catalog-queries