maliput_malidrive
RoadRuleBookBuilder Class Reference

Detailed Description

Functor to build a RoadRulebook.

The rules API is composed of:

The building procedure is based on top a loader method provided by maliput: RoadRulebook loader with rule registry

The following rules are created and added programatically on top what the RoadRulebook YAML file describes.

  • Speed limits: maliput::api::rules::RangeValueRule whose type is "Speed-Limit Rule Type" are created.
  • Direction usage: maliput::api::rules::DiscretValueRule whose type is "Direction-Usage Rule Type" are created.
  • Vehicle exclusive: maliput::api::rules::DiscretValueRule whose type is "Vehicle-Exclusive Rule Type" are created.
  • Vehicle usage: maliput::api::rules::DiscretValueRule whose type is "Vehicle-Usage Rule Type" are created.

#include <src/maliput_malidrive/builder/road_rulebook_builder.h>

Public Member Functions

 RoadRuleBookBuilder (const maliput::api::RoadGeometry *rg, const maliput::api::rules::RuleRegistry *rule_registry, const std::optional< std::string > &road_rulebook_file_path)
 Constructs a RoadRuleBook. More...
 
 RoadRuleBookBuilder ()=delete
 
std::unique_ptr< const maliput::api::rules::RoadRulebookoperator() ()
 Builds a ManualRulebook. More...
 

Static Public Member Functions

static void AddsXODRBasedRulesToRulebook (const maliput::api::RoadGeometry *rg, const maliput::api::rules::RuleRegistry *rule_registry, maliput::ManualRulebook *rulebook)
 Populates RoadRulebook using rule types previously defined in the RuleRegistry. More...
 

Constructor & Destructor Documentation

◆ RoadRuleBookBuilder() [1/2]

RoadRuleBookBuilder ( const maliput::api::RoadGeometry rg,
const maliput::api::rules::RuleRegistry rule_registry,
const std::optional< std::string > &  road_rulebook_file_path 
)

Constructs a RoadRuleBook.

Parameters
rgis the pointer to the RoadGeometry. It must not be nullptr.
rule_registryis the pointer to the RuleRegistry. It must not be nullptr.
road_rulebook_file_pathto the yaml file to load the RoadRulebook.
Exceptions
maliput::assertion_errorWhen rg or rule_registry are nullptr.

◆ RoadRuleBookBuilder() [2/2]

RoadRuleBookBuilder ( )
delete

Member Function Documentation

◆ AddsXODRBasedRulesToRulebook()

void AddsXODRBasedRulesToRulebook ( const maliput::api::RoadGeometry rg,
const maliput::api::rules::RuleRegistry rule_registry,
maliput::ManualRulebook rulebook 
)
static

Populates RoadRulebook using rule types previously defined in the RuleRegistry.

These rules' values are obtained from the XODR file description. They are of type:

  • Vehicle-Usage Rule Type
  • Vehicle-Exclusive Rule Type
  • Speed-Limit Rule Type
  • Direction-Usage Rule Type

See malidrive::builder::RuleRegistryBuilder for further information.

◆ operator()()

std::unique_ptr< const maliput::api::rules::RoadRulebook > operator() ( )

Builds a ManualRulebook.


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