simulation.utils.road.renderer.tile module

Summary

Classes:

Tile

Piece of the groundplane with lines used to display road lines on the ground.

Reference

class Tile(index: Tuple[int, int], size: simulation.utils.geometry.vector.Vector, resolution: simulation.utils.geometry.vector.Vector, road_folder_name: Optional[str] = None, sections: Dict[int, simulation.utils.road.sections.road_section.RoadSection] = <factory>, id: Optional[str] = None, already_rendered: bool = False)[source]

Bases: object

Piece of the groundplane with lines used to display road lines on the ground.

The groundplane in simulation is made out of many rectangular tiles. Each tile displays an image on the ground.

COUNTER = 0

Static variable used to generate unique model names in Gazebo.

To ensure that Gazebo doesn’t get confused with multiple tiles that have the same name, e.g. when reloading, the counter is increased every time a model name is generated.

index: Tuple[int, int]

Position within the lattice of tiles on the groundplane.

size: simulation.utils.geometry.vector.Vector

Size of the tile.

resolution: simulation.utils.geometry.vector.Vector

Resolution of the tile’s image.

road_folder_name: str = None

Name of the folder in which all tiles of the current road are.

(Not the complete path, just the name of the folder!)

sections: Dict[int, simulation.utils.road.sections.road_section.RoadSection]

All sections that are (atleast partly) on this tile.

id: str = None

ID of the tile.

Automatically generated when rendering.

already_rendered: bool = False

Indicate whether the tile has been rendered before.

property name

Name of the tile’s model when spawned in Gazebo.

Type

str

property transform

Transform to the center of the tile.

Type

Transform

property frame

Frame of the tile.

Type

Polygon

get_material_string() → str[source]

Content of the tile’s material file.

See: http://gazebosim.org/tutorials?tut=color_model

get_model_string() → str[source]

Get a model string that can be spawned in Gazebo.

render_to_file(roads_path: str)[source]

Render an image of the tile and save it to a file.

Parameters

roads_path – Directory in which all roads are located.