RightOfWayRule::State Class Referencefinal

Semantic state of a RightOfWayRule. More...

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

Public Types

enum  Type { kGo = 0, kStop, kStopThenGo }
 Basic semantic type of a rule state. More...
using Id = TypeSpecificIdentifier< class State >
 Unique identifier for a State. More...
using YieldGroup = std::vector< RightOfWayRule::Id >
 List of RightOfWayRule::Id's of rules/zones with priority. More...

Public Member Functions

 State (Id id, Type type, const YieldGroup &yield_to)
 Constructs a State instance. More...
const Idid () const
 Returns the Id. More...
Type type () const
 Returns the Type. More...
const YieldGroupyield_to () const
 Returns the YieldGroup. More...
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 State (const State &)=default
Stateoperator= (const State &)=default
 State (State &&)=default
Stateoperator= (State &&)=default

Detailed Description

Semantic state of a RightOfWayRule.

A State describes the semantic state of a RightOfWayRule, basically "Go", "Stop", or "Stop, Then Go". A RightOfWayRule may have multiple possible States, in which case its States must have Id's which are unique within the context of that RightOfWayRule.

A State also describes the yield logic of a RightOfWayRule, via a list of Id's of other RightOfWayRules (and thus the zones which they control) which have priority over this rule. An empty list means that a rule in this State has priority over all other rules. Vehicles with lower priority (i.e., traveling on lower-priority paths) must yield to vehicles with higher priority.

Member Typedef Documentation

◆ Id

Unique identifier for a State.

◆ YieldGroup

List of RightOfWayRule::Id's of rules/zones with priority.

Member Enumeration Documentation

◆ Type

enum Type

Basic semantic type of a rule state.


Vehicle has right-of-way and may proceed if safe to do so.


Vehicle does not have right-of-way and must stop.


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

Constructor & Destructor Documentation

◆ State() [1/3]

State ( const State )

◆ State() [2/3]

State ( State &&  )

◆ State() [3/3]

State ( Id  id,
Type  type,
const YieldGroup yield_to 

Constructs a State instance.

idthe unique Id
typethe semantic Type
yield_tothe other paths/rules which must be yielded to

Member Function Documentation

◆ id()

const Id& id ( ) const

Returns the Id.

◆ operator=() [1/2]

State& operator= ( State &&  )

◆ operator=() [2/2]

State& operator= ( const State )

◆ type()

Type type ( ) const

Returns the Type.

◆ yield_to()

const YieldGroup& yield_to ( ) const

Returns the YieldGroup.

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