l5kit.rasterization.render_context module

class l5kit.rasterization.render_context.RenderContext(raster_size_px: numpy.ndarray, pixel_size_m: numpy.ndarray, center_in_raster_ratio: numpy.ndarray, set_origin_to_bottom: bool)

Bases: object

raster_from_world(position_m: numpy.ndarray, angle_rad: float) numpy.ndarray

Return a matrix to convert a pose in world coordinates into raster coordinates

Parameters
  • render_context (RenderContext) – the context for rasterisation

  • position_m (np.ndarray) – XY position in world coordinates

  • angle_rad (float) – rotation angle in world coordinates

Returns

a transformation matrix from world coordinates to raster coordinates

Return type

(np.ndarray)