Drake
RightOfWayRule Class Reference

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

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

Public Types

enum  Type { kProceed = 0, kYield, kStopThenGo, kDynamic }
 Basic static semantics of the rule instance. More...
 
enum  DynamicState {
  kUncontrolled = 0, kGo, kPrepareToStop, kStop,
  kPrepareToGo, kProceedWithCaution, kYield, kStopThenGo
}
 Rule semantics which may be expressed via a dynamic agent. More...
 
using Id = TypeSpecificIdentifier< class RightOfWayRule >
 

Public Member Functions

 RightOfWayRule (const Id &id, const LaneSRoute &controlled_zone, Type type)
 Constructs a RightOfWayRule. More...
 
Id id () const
 Returns the persistent identifier. More...
 
const LaneSRoutecontrolled_zone () const
 Returns the rule's controlled zone. More...
 
Type type () const
 Returns the static rule semantic. 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 controlled_zone (a LaneSRoute) which specifies a contiguous longitudinal lane-wise section of the road network to which the instance applies;
  • a type (a Type) which indicates the right-of-way semantics for a vehicle traversing the controlled_zone. The type may be "dynamic", in which the semantic state is delegated to an RightOfWayStateProvider agent, linked by this rule's Id.

A RightOfWayRule instance determines whether or not a vehicle is allowed to enter the controlled_zone. Having entered, vehicles should not stop within a controlled_zone, and thus should not enter the controlled_zone if traffic conditions may cause them to stop within the zone.

Member Typedef Documentation

Member Enumeration Documentation

enum DynamicState
strong

Rule semantics which may be expressed via a dynamic agent.

Enumerator
kUncontrolled 

Signaling apparatus is non-functional (e.g., "dark mode").

kGo 

Vehicle has right-of-way.

kPrepareToStop 

Vehicle has right-of-way, but rule state will soon transition to kStop.

kStop 

Vehicle does not have right-of-way (and thus must not enter the controlled-zone).

kPrepareToGo 

Vehicle does not have right-of-way, but rule state will soon transition to kGo.

kProceedWithCaution 

Vehicle has right-of-way.

kYield 

Vehicles must yield to competing traffic.

kStopThenGo 

Vehicle must come to complete stop before entering controlled-zone, but may then proceed if safe;.

enum Type
strong

Basic static semantics of the rule instance.

Enumerator
kProceed 

No restriction on vehicle's right-of-way, but it must still avoid stopping within the controlled-zone.

kYield 

Vehicles must yield to competing traffic.

kStopThenGo 

Vehicles must come to a complete stop before entering the controlled-zone, but may then proceed if safe.

kDynamic 

Delegate semantics to a RightOfWayStateProvider, with state linked by the Id of this rule.

Constructor & Destructor Documentation

RightOfWayRule ( const RightOfWayRule )
default
RightOfWayRule ( RightOfWayRule &&  )
default
RightOfWayRule ( const Id id,
const LaneSRoute controlled_zone,
Type  type 
)
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

Member Function Documentation

const LaneSRoute& controlled_zone ( ) const
inline

Returns the rule's controlled zone.

Here is the caller graph for this function:

Id id ( ) const
inline

Returns the persistent identifier.

Here is the caller graph for this function:

RightOfWayRule& operator= ( RightOfWayRule &&  )
default
RightOfWayRule& operator= ( const RightOfWayRule )
default
Type type ( ) const
inline

Returns the static rule semantic.

Here is the caller graph for this function:


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