Public Types | Public Member Functions | Private Attributes | List of all members
lanelet::traffic_rules::TrafficRules Class Referenceabstract

Class for inferring traffic rules for lanelets and areas. More...

#include <TrafficRules.h>

Inheritance diagram for lanelet::traffic_rules::TrafficRules:
Inheritance graph
[legend]

Public Types

using Configuration = std::map< std::string, Attribute >
 

Public Member Functions

virtual bool canChangeLane (const ConstLanelet &from, const ConstLanelet &to) const =0
 determines if a lane change can be made between two lanelets More...
 
virtual bool canPass (const ConstArea &area) const =0
 returns whether it is allowed to pass/drive on this area More...
 
virtual bool canPass (const ConstArea &from, const ConstArea &to) const =0
 
virtual bool canPass (const ConstArea &from, const ConstLanelet &to) const =0
 
virtual bool canPass (const ConstLanelet &from, const ConstArea &to) const =0
 
virtual bool canPass (const ConstLanelet &from, const ConstLanelet &to) const =0
 returns whether it is allowed to pass/drive from a lanelet to another lanelet. More...
 
virtual bool canPass (const ConstLanelet &lanelet) const =0
 returns whether it is allowed to pass/drive on this lanelet More...
 
const Configurationconfiguration () const
 configuration for this traffic rules object More...
 
virtual bool hasDynamicRules (const ConstLanelet &lanelet) const =0
 returns whether dynamic traffic rules apply to this lanelet. More...
 
virtual bool isOneWay (const ConstLanelet &lanelet) const =0
 returns whether a lanelet can be driven in one direction only More...
 
const std::string & location () const
 the the location the rules are valid for More...
 
const std::string & participant () const
 the traffic participant the rules are valid for (e.g. vehicle, car, pedestrian, etc) More...
 
virtual SpeedLimitInformation speedLimit (const ConstArea &area) const =0
 returns speed limit on this area. More...
 
virtual SpeedLimitInformation speedLimit (const ConstLanelet &lanelet) const =0
 returns speed limit on this lanelet. More...
 
 TrafficRules (Configuration config=Configuration())
 Constructor. More...
 
virtual ~TrafficRules ()
 

Private Attributes

Configuration config_
 

Detailed Description

Class for inferring traffic rules for lanelets and areas.

Definition at line 18 of file TrafficRules.h.

Member Typedef Documentation

◆ Configuration

Definition at line 20 of file TrafficRules.h.

Constructor & Destructor Documentation

◆ TrafficRules()

lanelet::traffic_rules::TrafficRules::TrafficRules ( Configuration  config = Configuration())
inlineexplicit

Constructor.

Parameters
configa configuration for traffic rules. This can be necessary for very specialized rule objects (ie considering the time of day or the weather). The config must have at least two entries: participant and location.

Definition at line 28 of file TrafficRules.h.

◆ ~TrafficRules()

TrafficRules::~TrafficRules ( )
virtualdefault

Member Function Documentation

◆ canChangeLane()

virtual bool lanelet::traffic_rules::TrafficRules::canChangeLane ( const ConstLanelet from,
const ConstLanelet to 
) const
pure virtual

determines if a lane change can be made between two lanelets

The orientation of the lanelets is important here as well.

Implemented in lanelet::traffic_rules::GenericTrafficRules.

◆ canPass() [1/6]

virtual bool lanelet::traffic_rules::TrafficRules::canPass ( const ConstArea area) const
pure virtual

returns whether it is allowed to pass/drive on this area

Implemented in lanelet::traffic_rules::GenericTrafficRules, and lanelet::traffic_rules::GermanVehicle.

◆ canPass() [2/6]

virtual bool lanelet::traffic_rules::TrafficRules::canPass ( const ConstArea from,
const ConstArea to 
) const
pure virtual

◆ canPass() [3/6]

virtual bool lanelet::traffic_rules::TrafficRules::canPass ( const ConstArea from,
const ConstLanelet to 
) const
pure virtual

◆ canPass() [4/6]

virtual bool lanelet::traffic_rules::TrafficRules::canPass ( const ConstLanelet from,
const ConstArea to 
) const
pure virtual

◆ canPass() [5/6]

virtual bool lanelet::traffic_rules::TrafficRules::canPass ( const ConstLanelet from,
const ConstLanelet to 
) const
pure virtual

returns whether it is allowed to pass/drive from a lanelet to another lanelet.

The orientation of the lanelets is important. The function first checks if lanelets are direcly adjacent, then checks if both lanelets are passable and finally checks if any traffic rule prevents to pass between the lanelets.

Implemented in lanelet::traffic_rules::GenericTrafficRules.

◆ canPass() [6/6]

virtual bool lanelet::traffic_rules::TrafficRules::canPass ( const ConstLanelet lanelet) const
pure virtual

returns whether it is allowed to pass/drive on this lanelet

The result can differ by the type of the traffic participant. A sidewalk lanelet is passable for a pedestrian but not for a vehicle. Orientation is important. It is not possible to pass an inverted oneWay Lanelet.

Implemented in lanelet::traffic_rules::GenericTrafficRules.

◆ configuration()

const Configuration& lanelet::traffic_rules::TrafficRules::configuration ( ) const
inline

configuration for this traffic rules object

Definition at line 86 of file TrafficRules.h.

◆ hasDynamicRules()

virtual bool lanelet::traffic_rules::TrafficRules::hasDynamicRules ( const ConstLanelet lanelet) const
pure virtual

returns whether dynamic traffic rules apply to this lanelet.

This can be a case if e.g. a speed limit is controlled by digital signs. If this returns true, additional handling must be done to find which rules are dynamic and how to handle them. This makes the values returned by the other functions unreliable. Handling of dynamic rules is not covered here.

Implemented in lanelet::traffic_rules::GenericTrafficRules.

◆ isOneWay()

virtual bool lanelet::traffic_rules::TrafficRules::isOneWay ( const ConstLanelet lanelet) const
pure virtual

returns whether a lanelet can be driven in one direction only

Implemented in lanelet::traffic_rules::GenericTrafficRules.

◆ location()

const std::string & TrafficRules::location ( ) const

the the location the rules are valid for

Should be ISO country code

Definition at line 325 of file GenericTrafficRules.cpp.

◆ participant()

const std::string & TrafficRules::participant ( ) const

the traffic participant the rules are valid for (e.g. vehicle, car, pedestrian, etc)

Definition at line 323 of file GenericTrafficRules.cpp.

◆ speedLimit() [1/2]

virtual SpeedLimitInformation lanelet::traffic_rules::TrafficRules::speedLimit ( const ConstArea area) const
pure virtual

returns speed limit on this area.

Implemented in lanelet::traffic_rules::GenericTrafficRules.

◆ speedLimit() [2/2]

virtual SpeedLimitInformation lanelet::traffic_rules::TrafficRules::speedLimit ( const ConstLanelet lanelet) const
pure virtual

returns speed limit on this lanelet.

Implemented in lanelet::traffic_rules::GenericTrafficRules.

Member Data Documentation

◆ config_

Configuration lanelet::traffic_rules::TrafficRules::config_
private

Definition at line 102 of file TrafficRules.h.


The documentation for this class was generated from the following files:


lanelet2_traffic_rules
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:26:07