Drake
RightOfWayRule Class Referencefinal

Rule describing right-of-way, a.k.a. More...

#include <drake/automotive/maliput/api/rules/right_of_way_rule.h>

Classes

class  State
 Semantic state of a RightOfWayRule. More...
 

Public Types

enum  ZoneType { kStopExcluded, kStopAllowed }
 Description of stopping properties of the zone. More...
 
using Id = TypeSpecificIdentifier< class RightOfWayRule >
 Unique identifier for a RightOfWayRule. More...
 

Public Member Functions

 RightOfWayRule (const Id &id, const LaneSRoute &zone, ZoneType zone_type, const std::vector< State > &states)
 Constructs a RightOfWayRule. More...
 
const Idid () const
 Returns the rule's identifier. More...
 
const LaneSRoutezone () const
 Returns the zone controlled by the rule. More...
 
ZoneType zone_type () const
 Returns the zone's type. More...
 
const std::unordered_map< State::Id, State > & states () const
 Returns the catalog of possible States. More...
 
bool is_static () const
 Returns true if the rule is static, i.e., has no dynamic state, otherwise false. More...
 
const Statestatic_state () const
 Returns the static state of the rule. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 RightOfWayRule (const RightOfWayRule &)=default
 
RightOfWayRuleoperator= (const RightOfWayRule &)=default
 
 RightOfWayRule (RightOfWayRule &&)=default
 
RightOfWayRuleoperator= (RightOfWayRule &&)=default
 

Detailed Description

Rule describing right-of-way, a.k.a.

priority.

Right-of-way rules cover things like stop signs, yield signs, and traffic lights: in other words, control over how competing traffic flows take turns traversing regions of the road network.

Each rule instance comprises:

  • a zone (a LaneSRoute) which specifies a contiguous longitudinal lane-wise section of the road network to which the rule instance applies;
  • a ZoneType describing whether or not stopping within the zone is allowed;
  • a catalog of one or more States, each of which indicate the possible right-of-way semantics for a vehicle traversing the zone.

The zone is directed; the rule applies to vehicles traveling forward through the zone.

A rule instance with a single State is considered "static", and has fixed semantics. A rule instance with multiple States is considered "dynamic" and determination of the active rule State at any given time is delegated to a RightOfWayStateProvider agent, linked by the rule's Id.

Member Typedef Documentation

Unique identifier for a RightOfWayRule.

Member Enumeration Documentation

enum ZoneType
strong

Description of stopping properties of the zone.

Enumerator
kStopExcluded 

Vehicles should not stop within the zone; vehicles should avoid entering the zone if traffic conditions may cause them to stop within the zone.

Vehicles already in the zone when a kStop state occurs should exit the zone.

kStopAllowed 

Vehicles are allowed to stop within the zone.

Constructor & Destructor Documentation

RightOfWayRule ( const RightOfWayRule )
default
RightOfWayRule ( RightOfWayRule &&  )
default
RightOfWayRule ( const Id id,
const LaneSRoute zone,
ZoneType  zone_type,
const std::vector< State > &  states 
)
inline

Constructs a RightOfWayRule.

Parameters
idthe unique ID of this rule (in the RoadRulebook)
controlled_zoneLaneSRoute to which this rule applies
typethe static semantics of this rule

Throws a std::exception if states is empty or if states contains duplicate State::Id's.

Member Function Documentation

const Id& id ( ) const
inline

Returns the rule's identifier.

bool is_static ( ) const
inline

Returns true if the rule is static, i.e., has no dynamic state, otherwise false.

This is true if and only if the rule has a single state.

RightOfWayRule& operator= ( RightOfWayRule &&  )
default
RightOfWayRule& operator= ( const RightOfWayRule )
default
const std::unordered_map<State::Id, State>& states ( ) const
inline

Returns the catalog of possible States.

const State& static_state ( ) const
inline

Returns the static state of the rule.

This is a convenience function for returning a static rule's single state.

Throws a std::exception if is_static() is false.

const LaneSRoute& zone ( ) const
inline

Returns the zone controlled by the rule.

ZoneType zone_type ( ) const
inline

Returns the zone's type.


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