LidarBEVAdapter

class standard_e2e.caching.adapters.LidarBEVAdapter(min_x=-32.0, max_x=32.0, min_y=-32.0, max_y=32.0, pixels_per_meter=4.0, max_height=100.0, split_height=0.2, use_ground_plane=False, count_cap=5)[source]

Bases: AbstractAdapter

Top-down 2-D histogram of lidar points in vehicle frame.

Implements the Transfuser / CARLA-Garage BEV recipe: drop points above max_height, optionally split into ground / obstacle channels at split_height, then 2-D bin into a regular grid over [min_x, max_x] x [min_y, max_y] at pixels_per_meter. Each channel is the per-cell point count, clipped at count_cap and divided into [0, 1].

Output (Modality.LIDAR_BEV): np.float32 array of shape (C, H, W) where C = 2 if use_ground_plane else 1. Axis order matches np.histogramdd((x, y), ...) so H is the number of x-bins and W the number of y-bins; with the ground plane channel order is (below, above).

Parameters:
  • min_x (float) – BEV x extent in meters (vehicle x is forward).

  • max_x (float) – BEV x extent in meters (vehicle x is forward).

  • min_y (float) – BEV y extent in meters (vehicle y is left).

  • max_y (float) – BEV y extent in meters (vehicle y is left).

  • pixels_per_meter (float) – grid resolution; cast to int internally (matches Transfuser).

  • max_height (float) – drop points with z >= max_height.

  • split_height (float) – ground / obstacle threshold (z <= -> ground).

  • use_ground_plane (bool) – include the ground channel.

  • count_cap (int) – per-cell saturation; histogram clipped at this value before being divided into [0, 1].

property consumes_attrs: set[StandardFrameDataField]

StandardFrameData fields this adapter reads.

Used by source-dataset processors to skip building modalities that no adapter consumes (lazy-load). For example, an HDMapBEVAdapter returns {StandardFrameDataField.HD_MAP}; a processor whose adapter chain registers no HD-map adapter can then skip the (often expensive) _build_hd_map step entirely.

Returning an empty set means “this adapter does not gate any modality build” — appropriate for adapters that read optional aux_data keys (e.g. preference trajectories) which the processor populates unconditionally and cheaply.

property metadata: dict[str, Any]

Per-frame metadata this adapter contributes to aux_data.

Override in subclasses to surface adapter-side configuration that a downstream consumer needs to interpret the modality output (e.g. the ordered channel list of a BEV rasterizer). The default is an empty dict; the source dataset processor merges these into each frame’s aux_data so the .npz remains self-describing.

property name: str

Name of the adapter. Must be implemented by subclasses.

property output_shape: tuple[int, int, int]

Shape (C, H, W) of the BEV tensor this adapter emits.

transform(standard_frame_data)

Validate input frame and dispatch to subclass implementation.

Return type:

dict[Modality, Any]

Parameters:

standard_frame_data (StandardFrameData)