Public Types | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
lanelet::SpeedLimit Class Reference

Represents a speed limit that affects a lanelet. More...

#include <BasicRegulatoryElements.h>

Inheritance diagram for lanelet::SpeedLimit:
Inheritance graph
[legend]

Public Types

using Ptr = std::shared_ptr< SpeedLimit >
 
- Public Types inherited from lanelet::TrafficSign
using Ptr = std::shared_ptr< TrafficSign >
 
- Public Types inherited from lanelet::RegulatoryElement
using Category = traits::RegulatoryElementTag
 
using const_iterator = RuleParameterMap::const_iterator
 
using ConstType = RegulatoryElement
 
using iterator = RuleParameterMap::iterator
 
using MutableType = GenericRegulatoryElement
 
using ThreeDType = RegulatoryElement
 
using TwoDType = RegulatoryElement
 
- Public Types inherited from lanelet::ConstPrimitive< RegulatoryElementData >
using DataType = RegulatoryElementData
 

Static Public Member Functions

static Ptr make (Id id, AttributeMap attributes, const std::string &signType, const LineStrings3d &refLines={}, const LineStrings3d &cancelLines={})
 Create a speed limit regulatory element only from a type or speed limit without actual sign. More...
 
static Ptr make (Id id, const AttributeMap &attributes, const TrafficSignsWithType &trafficSigns, const TrafficSignsWithType &cancellingTrafficSigns={}, const LineStrings3d &refLines={}, const LineStrings3d &cancelLines={})
 Create a speed limit regulatory element. Similar to a traffic sign. More...
 
- Static Public Member Functions inherited from lanelet::TrafficSign
static Ptr make (Id id, const AttributeMap &attributes, const TrafficSignsWithType &trafficSigns, const TrafficSignsWithType &cancellingTrafficSigns={}, const LineStrings3d &refLines={}, const LineStrings3d &cancelLines={})
 Create a valid TrafficSign object. More...
 

Static Public Attributes

static constexpr char RuleName [] = "speed_limit"
 
- Static Public Attributes inherited from lanelet::TrafficSign
static constexpr char RuleName [] = "traffic_sign"
 
- Static Public Attributes inherited from lanelet::RegulatoryElement
static constexpr char RuleName [] = "basic_regulatory_element"
 
- Static Public Attributes inherited from lanelet::ConstPrimitive< RegulatoryElementData >
static constexpr bool IsConst
 

Protected Member Functions

 SpeedLimit (const RegulatoryElementDataPtr &data)
 
 SpeedLimit (Id id, const AttributeMap &attributes, const TrafficSignsWithType &trafficSigns, const TrafficSignsWithType &cancellingTrafficSigns={}, const LineStrings3d &refLines={}, const LineStrings3d &cancelLines={})
 
- Protected Member Functions inherited from lanelet::TrafficSign
 TrafficSign (const RegulatoryElementDataPtr &data)
 
 TrafficSign (Id id, const AttributeMap &attributes, const TrafficSignsWithType &trafficSigns, const TrafficSignsWithType &cancellingTrafficSigns={}, const LineStrings3d &refLines={}, const LineStrings3d &cancelLines={})
 
- Protected Member Functions inherited from lanelet::RegulatoryElement
void applyVisitor (internal::MutableParameterVisitor &visitor) const
 
const_iterator begin () const
 
RegulatoryElementDataPtr data ()
 
const_iterator end () const
 
template<typename T >
std::vector< T > getParameters (RoleName role)
 
RuleParameterMapparameters ()
 
const RuleParameterMapparameters () const
 
 RegulatoryElement (const RegulatoryElementDataPtr &data)
 
 RegulatoryElement (Id id=InvalId, const RuleParameterMap &members=RuleParameterMap(), const AttributeMap &attributes=AttributeMap())
 
- Protected Member Functions inherited from lanelet::ConstPrimitive< RegulatoryElementData >
 ConstPrimitive (const ConstPrimitive &rhs)=default
 
 ConstPrimitive (ConstPrimitive &&rhs) noexcept=default
 
ConstPrimitiveoperator= (const ConstPrimitive &rhs)=default
 
ConstPrimitiveoperator= (ConstPrimitive &&rhs) noexcept=default
 
 ~ConstPrimitive () noexcept=default
 

Friends

class RegisterRegulatoryElement< SpeedLimit >
 

Additional Inherited Members

- Public Member Functions inherited from lanelet::TrafficSign
void addCancellingRefLine (const LineString3d &line)
 Add a new line from where the sign becomes inactive. More...
 
void addCancellingTrafficSign (const TrafficSignsWithType &signs)
 Add new cancelling traffic sign. More...
 
void addRefLine (const LineString3d &line)
 Add a new reference line. More...
 
void addTrafficSign (const LineStringOrPolygon3d &sign)
 Adds another traffic sign. More...
 
LineStrings3d cancelLines ()
 
ConstLineStrings3d cancelLines () const
 gets the line(s) from which a sign becomes invalid. More...
 
LineStringsOrPolygons3d cancellingTrafficSigns ()
 
ConstLineStringsOrPolygons3d cancellingTrafficSigns () const
 get list of cancellingTrafficSigns, if existing More...
 
std::vector< std::string > cancelTypes () const
 Types of the cancelling traffic signs if they exist. More...
 
LineStrings3d refLines ()
 
ConstLineStrings3d refLines () const
 gets the line(s) from which a sign becomes valid. More...
 
bool removeCancellingRefLine (const LineString3d &line)
 Remove a cancelling line. Returns true on success. More...
 
bool removeCancellingTrafficSign (const LineStringOrPolygon3d &sign)
 remove a cancelling traffic sign, returns true on success More...
 
bool removeRefLine (const LineString3d &line)
 Remove a reference line. Returns true on success. More...
 
bool removeTrafficSign (const LineStringOrPolygon3d &sign)
 remove a traffic sign and returns true on success More...
 
LineStringsOrPolygons3d trafficSigns ()
 
ConstLineStringsOrPolygons3d trafficSigns () const
 returns the traffic signs More...
 
std::string type () const
 get the id/number of the sign(s) More...
 
- Public Member Functions inherited from lanelet::RegulatoryElement
void applyVisitor (RuleParameterVisitor &visitor) const
 applies a visitor to every parameter in the regulatory element More...
 
bool empty () const
 returns true if this object contains no parameters More...
 
template<typename T >
Optional< T > find (Id id) const
 Finds a parameter by its id, independent of the role. More...
 
template<>
Optional< ConstRuleParameterfind (Id id) const
 
template<>
boost::optional< ConstLaneletfind (Id id) const
 
template<>
boost::optional< ConstAreafind (Id id) const
 
ConstRuleParameterMap getParameters () const
 Returns all parameters as const object (coversion overhead for const) More...
 
template<typename T >
std::vector< T > getParameters (const std::string &role) const
 Returns a vector of all RuleParameters that could be converted to T. More...
 
template<>
std::vector< ConstLaneletgetParameters (const std::string &role) const
 
template<typename T >
std::vector< T > getParameters (RoleName role) const
 
template<>
std::vector< ConstLaneletgetParameters (RoleName role) const
 
std::vector< std::string > roles () const
 returns all the roles this regulatory element has More...
 
void setId (Id id) noexcept
 
size_t size () const
 get the number of roles in this regulatoryElement More...
 
virtual ~RegulatoryElement ()
 
- Public Member Functions inherited from lanelet::ConstPrimitive< RegulatoryElementData >
const Attributeattribute (AttributeName name) const
 retrieve an attribute (enum version) More...
 
const Attributeattribute (const std::string &name) const
 retrieve an attribute More...
 
attributeOr (AttributeName name, T defaultVal) const
 retrieve an attribute (enum version) More...
 
attributeOr (const std::string &name, T defaultVal) const noexcept
 retrieve an attribute (string version) More...
 
const AttributeMapattributes () const
 get the attributes of this primitive More...
 
const std::shared_ptr< const RegulatoryElementData > & constData () const
 get the internal data of this primitive More...
 
 ConstPrimitive (const std::shared_ptr< const RegulatoryElementData > &data)
 Construct from a pointer to the data. More...
 
bool hasAttribute (AttributeName name) const noexcept
 check for an attribute (enum version) More...
 
bool hasAttribute (const std::string &name) const noexcept
 check whether this primitive has a specific attribute More...
 
Id id () const noexcept
 get the unique id of this primitive More...
 
bool operator!= (const ConstPrimitive &rhs) const
 
bool operator== (const ConstPrimitive &rhs) const
 

Detailed Description

Represents a speed limit that affects a lanelet.

A speed limit is defined by one ore more traffic signs and cancelled by one or more traffic signs. All lanelets affected by this refer to this traffic sign.

As an alternative, the type can also be specified using the sign_type tag of the regulatory element. However this is not recommended, because will make it hard to track where the speed limit originates.

Definition at line 336 of file BasicRegulatoryElements.h.

Member Typedef Documentation

◆ Ptr

using lanelet::SpeedLimit::Ptr = std::shared_ptr<SpeedLimit>

Definition at line 338 of file BasicRegulatoryElements.h.

Constructor & Destructor Documentation

◆ SpeedLimit() [1/2]

lanelet::SpeedLimit::SpeedLimit ( Id  id,
const AttributeMap attributes,
const TrafficSignsWithType trafficSigns,
const TrafficSignsWithType cancellingTrafficSigns = {},
const LineStrings3d refLines = {},
const LineStrings3d cancelLines = {} 
)
protected

Definition at line 328 of file BasicRegulatoryElements.cpp.

◆ SpeedLimit() [2/2]

lanelet::SpeedLimit::SpeedLimit ( const RegulatoryElementDataPtr data)
explicitprotected

Definition at line 334 of file BasicRegulatoryElements.cpp.

Member Function Documentation

◆ make() [1/2]

static Ptr lanelet::SpeedLimit::make ( Id  id,
AttributeMap  attributes,
const std::string &  signType,
const LineStrings3d refLines = {},
const LineStrings3d cancelLines = {} 
)
inlinestatic

Create a speed limit regulatory element only from a type or speed limit without actual sign.

Definition at line 349 of file BasicRegulatoryElements.h.

◆ make() [2/2]

static Ptr lanelet::SpeedLimit::make ( Id  id,
const AttributeMap attributes,
const TrafficSignsWithType trafficSigns,
const TrafficSignsWithType cancellingTrafficSigns = {},
const LineStrings3d refLines = {},
const LineStrings3d cancelLines = {} 
)
inlinestatic

Create a speed limit regulatory element. Similar to a traffic sign.

Definition at line 342 of file BasicRegulatoryElements.h.

Friends And Related Function Documentation

◆ RegisterRegulatoryElement< SpeedLimit >

friend class RegisterRegulatoryElement< SpeedLimit >
friend

Definition at line 356 of file BasicRegulatoryElements.h.

Member Data Documentation

◆ RuleName

constexpr char lanelet::SpeedLimit::RuleName = "speed_limit"
staticconstexpr

Definition at line 339 of file BasicRegulatoryElements.h.


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


lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:53