simulation.utils.road package

Submodules

simulation.utils.road.config module

Classes:

Config()

class Config[source]

Bases: object

Attributes:

road_width

TURN_SF_MARK_WIDTH

TURN_SF_MARK_LENGTH

ROAD_MARKING_DISTANCE

PRIORITY_SIGN_DISTANCE_INTERVALL

TURN_SIGN_DISTANCE_INTERVALL

SURFACE_MARKING_DISTANCE_INTERVALL

SIGN_ROAD_PADDING_INTERVALL

Methods:

get_prio_sign_dist([rand])

get_turn_sign_dist([rand])

get_surface_mark_dist([rand])

get_sign_road_padding([rand])

road_width = 0.4
TURN_SF_MARK_WIDTH = 0.072
TURN_SF_MARK_LENGTH = 0.5
ROAD_MARKING_DISTANCE = 0.2
PRIORITY_SIGN_DISTANCE_INTERVALL = (0.3, 0.5)
TURN_SIGN_DISTANCE_INTERVALL = (0.15, 0.25)
SURFACE_MARKING_DISTANCE_INTERVALL = (0.05, 0.25)
SIGN_ROAD_PADDING_INTERVALL = (0.075, 0.125)
static get_prio_sign_dist(rand=0.5)[source]
static get_turn_sign_dist(rand=0.5)[source]
static get_surface_mark_dist(rand=0.5)[source]
static get_sign_road_padding(rand=0.5)[source]

simulation.utils.road.road module

Road class used to define roads as a python class.

A simulated road can be defined through an object of type Road. It contains all sections of that road as a list.

Classes:

Road(use_seed, sections, length)

Container object for roads.

Functions:

_get_module(name)

load(road_name[, seed])

Load road object from file.

class Road(use_seed: bool = True, sections: List[simulation.utils.road.sections.road_section.RoadSection] = <factory>, length: float = 0)[source]

Bases: object

Container object for roads.

A road consists of multiple road sections that are concatenated. The sections attribute contains these sections in the correct order.

Attributes:

_name

Name of the road.

_seed

Seed used when generating the road.

use_seed

Use a default seed if none is provided.

sections

All sections of the road.

length

Length of road.

Methods:

append(section)

Append a road section.

close_loop([p_curvature])

Append a road section that connects the last section to the beginning.

_name: str = None

Name of the road.

The name attribute is determined by the name of the file. It is filled in when the road is generated.

_seed: str = None

Seed used when generating the road.

Determined when generating the road.

use_seed: bool = True

Use a default seed if none is provided.

By default the use_seed attribute is true and a seed is set before creating the road. If use_seed is set to False, the seed is invalidated and there will be different random values every time the road is created.

sections: List[simulation.utils.road.sections.road_section.RoadSection]

All sections of the road.

length: float = 0

Length of road.

append(section: simulation.utils.road.sections.road_section.RoadSection)[source]

Append a road section. Determine id of the section.

Parameters

section – New road section.

close_loop(p_curvature: float = 2)[source]

Append a road section that connects the last section to the beginning.

The road’s beginning and it’s end are connected using a cubic bezier curve.

Parameters

p_curvature – Scale the curvature of the resulting loop.

_get_module(name: str)[source]
load(road_name: str, seed: str = 'KITCAR')simulation.utils.road.road.Road[source]

Load road object from file.

Parameters
  • road_name – Name of the file containing the road definition.

  • seed – Predetermine random values.

Module contents

Definition of the road module package.

The road module package contains a number of modules and subpackages that are used to create and render roads as Gazebo worlds.