Visualizer
Rerun-based per-frame visualizer for Stera sessions. Drives the blueprint, static map geometry, IMU traces, frustum, and overlays.
class Visualizer:
def __init__(
self,
session,
output: Optional[str] = None,
app_id: str = "stera",
max_viz: bool = False,
overlay_size: tuple[int, int] | None = None,
jpeg_quality: int = 50,
trail_len: int = 30,
frustum_depth: float = 0.15,
live_pc_max: int = 50_000,
live_pc_radius: float = 0.005,
max_map_points: int = 200_000,
dense_map: bool = False,
dense_every_n: int = 10,
dense_cam_exclude: float = 1.0,
dense_voxel_size: float = 0.02,
map_3d: str = "auto",
mesh_refine: bool | dict = False,
)Visualizer was previously called RerunVisualizer. The old name is preserved as an alias — existing scripts keep working — but new code should use Visualizer.
See the Visualization guide for what gets logged and the blueprint layout.
Constructor
| Param | Default | Notes |
|---|---|---|
session | required | MCAPReader instance. |
output | auto temp | Path to write the .rrd. If None, a tempfile is created and .export() promotes it. |
app_id | "stera" | Rerun application id. |
map_3d | "auto" | "auto" / "mesh" / "mesh_cloud" / "point_cloud" / "both" / "none". See below. |
mesh_refine | False | Run the mesh through MeshRefiner before logging. True for defaults or a dict of MeshRefiner kwargs. Used when map_3d ∈ {"auto","mesh","both"}. |
max_viz | False | Per-frame live RGB-D point cloud. |
dense_map | False | Build dense depth-derived cloud at setup. |
dense_every_n | 10 | |
dense_voxel_size | 0.02 | |
dense_cam_exclude | 1.0 | |
max_map_points | 200_000 | Subsample cap for any logged cloud. |
live_pc_max | 50_000 | |
live_pc_radius | 0.005 | metres. |
overlay_size | None | Resize RGB before logging. |
jpeg_quality | 50 | |
trail_len | 30 | |
frustum_depth | 0.15 | metres. |
Raises ValueError if map_3d is not in the allowed set.
map_3d modes
| Value | Behavior |
|---|---|
"auto" | Triangle mesh if /map/mesh is present, otherwise the point-cloud fallback chain. |
"mesh" | Triangle mesh only; skipped if missing. |
"mesh_cloud" | Accumulated point cloud from /map/mesh_cloud only. |
"point_cloud" | Raw point cloud from /map/point_cloud only. |
"both" | Both the mesh AND the point cloud. PC is logged but hidden by default in the blueprint (eye-icon toggle to reveal). |
"none" | Skip the 3D map entirely. |
Whenever a mesh is logged (auto / mesh / both), the raw, unrefined mesh from /map/mesh is also logged to world/mesh_raw and starts hidden in the blueprint. Kept around as an A/B reference against the refined mesh — toggle from the entity tree.
Methods
setup
def setup(self) -> NoneInitialise Rerun, send the blueprint, log static data (3D map, optical-frame transform, IMU traces). Called lazily on the first log_frame.
log_frame
def log_frame(
self,
frame, # SyncedFrame
hands: list[HandPose] | None = None,
skeleton: SkeletonFrame | None = None,
enable_pointcloud: bool | None = None,
) -> NoneStream a single synchronised frame to Rerun. If setup hasn't run, it runs on the first call.
export
def export(self, path: str) -> strFlush pending logs and copy the backing .rrd to path. Returns the destination string.
show
def show(self, block: bool = False) -> NoneSpawn the Rerun viewer on the saved file. block=True waits for it to exit.
See also
- Visualization guide, what gets logged and the blueprint.
MeshRefinerAPI, all the knobs for themesh_refine={...}dict.MCAPReader.export(visualizer=...), promotes the.rrdinto the episode directory.