scenic.simulators.metadrive.utils
Summary of Module Members
Functions
Compute film_size (width, height) in pixels for MetaDrive's top-down renderer. |
|
Extracts the net offset and boundary from the given SUMO map file. |
|
Return the (x, y) translation from the OpenDRIVE <header><offset> element. |
|
Retrieve the map parameters. |
|
Converts MetaDrive heading to Scenic heading by subtracting π/2 (90 degrees). |
|
Converts MetaDrive position to Scenic position using map parameters. |
|
Converts Scenic heading to MetaDrive heading by adding π/2 (90 degrees). |
|
Converts Scenic position to MetaDrive position using map parameters. |
Classes
|
Member Details
- calculateFilmSize(sumo_map_boundary, scaling=5, margin_factor=1.1, min_extent=200.0)[source]
Compute film_size (width, height) in pixels for MetaDrive’s top-down renderer.
The SUMO convBoundary gives the map extent (xmin, ymin, xmax, ymax) in meters. If one dimension is zero (e.g. a single straight road), clamp it to min_extent to avoid a zero-width/height film size.
- extractNetOffsetAndBoundary(sumo_map_path)[source]
Extracts the net offset and boundary from the given SUMO map file.
- extractXODROffset(xodr_map_path)[source]
Return the (x, y) translation from the OpenDRIVE <header><offset> element.
If the file has no <header> or no <offset>, returns (0.0, 0.0).
- metadriveToScenicPosition(loc, scenic_offset)[source]
Converts MetaDrive position to Scenic position using map parameters.
- scenicToMetaDrivePosition(vec, scenic_offset)[source]
Converts Scenic position to MetaDrive position using map parameters.