RightOfWayRule Class Referencefinal

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

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


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.


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

◆ Id

Unique identifier for a RightOfWayRule.

Member Enumeration Documentation

◆ ZoneType

enum ZoneType

Description of stopping properties of the zone.


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.


Vehicles are allowed to stop within the zone.

Constructor & Destructor Documentation

◆ RightOfWayRule() [1/3]

RightOfWayRule ( const RightOfWayRule )

◆ RightOfWayRule() [2/3]

RightOfWayRule ( RightOfWayRule &&  )

◆ RightOfWayRule() [3/3]

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

Constructs a RightOfWayRule.

idthe unique ID of this rule (in the RoadRulebook)
controlled_zoneLaneSRoute to which this rule applies
typethe static semantics of this rule
std::exceptionif states is empty or if states contains duplicate State::Id's.

Member Function Documentation

◆ id()

const Id& id ( ) const

Returns the rule's identifier.

◆ is_static()

bool is_static ( ) const

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.

◆ operator=() [1/2]

RightOfWayRule& operator= ( RightOfWayRule &&  )

◆ operator=() [2/2]

RightOfWayRule& operator= ( const RightOfWayRule )

◆ states()

const std::unordered_map<State::Id, State>& states ( ) const

Returns the catalog of possible States.

◆ static_state()

const State& static_state ( ) const

Returns the static state of the rule.

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

std::exceptionif is_static() is false.

◆ zone()

const LaneSRoute& zone ( ) const

Returns the zone controlled by the rule.

◆ zone_type()

ZoneType zone_type ( ) const

Returns the zone's type.

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