Class TrafficLight

Inheritance Relationships

Base Type

Class Documentation

class TrafficLight : public lanelet::RegulatoryElement

Represents a traffic light restriction on the lanelet.

Public Types

using Ptr = std::shared_ptr<TrafficLight>

Public Functions

Optional<ConstLineString3d> stopLine() const

get the stop line for the traffic light

Returns:

the stop line as LineString

Optional<LineString3d> stopLine()
ConstLineStringsOrPolygons3d trafficLights() const

get the relevant traffic lights

There might be multiple traffic lights but they are required to show the same signal.

Returns:

the traffic lights

LineStringsOrPolygons3d trafficLights()
void addTrafficLight(const LineStringOrPolygon3d &primitive)

add a new traffic light

Traffic lights are represented as linestrings that start at the left edge of a traffic light and end at the right edge.

Parameters:

primitive – the traffic light to add

bool removeTrafficLight(const LineStringOrPolygon3d &primitive)

remove a traffic light

Parameters:

primitive – the primitive

Returns:

true if the traffic light existed and was removed

void setStopLine(const LineString3d &stopLine)

set a new stop line, overwrite the old one

Parameters:

stopLine – new stop line

void removeStopLine()

Deletes the stop line.

Public Static Functions

static inline Ptr make(Id id, const AttributeMap &attributes, const LineStringsOrPolygons3d &trafficLights, const Optional<LineString3d> &stopLine = {})

Directly construct a stop line from its required rule parameters. Might modify the input data in oder to get correct tags.

Public Static Attributes

static constexpr char RuleName[] = "traffic_light"

Protected Functions

TrafficLight(Id id, const AttributeMap &attributes, const LineStringsOrPolygons3d &trafficLights, const Optional<LineString3d> &stopLine)
explicit TrafficLight(const RegulatoryElementDataPtr &data)

Friends

friend class RegisterRegulatoryElement< TrafficLight >