maliput
maliput Namespace Reference

Detailed Description

Code in this file is inspired by: https://github.com/RobotLocomotion/drake/blob/master/common/text_logging.h.

Maliput uses the hash_append pattern as described by N3980.

Drake's license follows:

All components of Drake are licensed under the BSD 3-Clause License shown below. Where noted in the source code, some portions may be subject to other permissive, non-viral licenses.

Copyright 2012-2016 Robot Locomotion Group @ CSAIL All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Massachusetts Institute of Technology nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

For a full treatment of the hash_append pattern, refer to: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3980.html

Providing hash_append support within a class

Maliput types may implement a hash_append function. The function appends every hash-relevant member field into the hasher:

class MyValue {
public:
...
/// Implements the @ref hash_append concept.
template <class HashAlgorithm>
friend void hash_append(
HashAlgorithm& hasher, const MyValue& item) noexcept {
hash_append(hasher, item.my_data_);
}
...
private:
std::string my_data_;
};

Checklist for reviewing a hash_append implementation:

  • The function cites @ref hash_append in its Doxygen comment.
  • The function is marked noexcept.

Using hashable types

Types that implement this pattern may be used in unordered collections:

std::unordered_set<MyValue, maliput::common::DefaultHash> foo;

Some Maliput types may also choose to specialize std::hash<MyValue> to use DefaultHash, so that the second template argument to std::unordered_set can be omitted.

Namespaces

 api
 
 common
 
 geometry_base
 
 math
 Namespace to group basic mathematical and geometric support to maliput.
 
 plugin
 
 routing
 
 utility
 

Classes

struct  DiscreteValueRuleConstants
 Constants to identify attributes of api::rules::DiscreteValueRule Types. More...
 
class  Intersection
 A concrete implementation of the api::Intersection abstract interface. More...
 
class  IntersectionBook
 A concrete implementation of the api::IntersectionBook abstract interface. More...
 
class  ManualDiscreteValueRuleStateProvider
 An implementation of a manual api::rules::DiscreteValueRuleStateProvider. More...
 
class  ManualPhaseProvider
 A concrete implementation of the api::rules::PhaseProvider abstract interface that allows the current phase to be manually set. More...
 
class  ManualPhaseRingBook
 A simple concrete implementation of the api::rules::PhaseRingBook abstract interface that enables manual addition and removal of api::rules::PhaseRing instances. More...
 
class  ManualRangeValueRuleStateProvider
 An implementation of a manual api::rules::RangeValueRuleStateProvider. More...
 
class  ManualRulebook
 ManualRulebook is a simple concrete implementation of the api::rules::RoadRulebook abstract interface. More...
 
class  PhasedDiscreteRuleStateProvider
 Provides the state of Right-Of-Way api::rules::DiscreteValueRule instances based on the current api::rules::Phase. More...
 
struct  RangeValueRuleConstants
 Constants to identify attributes of api::rules::RangeValueRule Types. More...
 
struct  RelatedRulesKeys
 Defines keys used in api::rules::Rule::RelatedRules. More...
 
struct  RelatedUniqueIdsKeys
 Defines keys used in api::rules::Rule::RelatedUniqueIds. More...
 
struct  RuleConstants
 Constants to identify attributes used in both api::rules::DiscreteValueRules and api::rules::RangeValueRules Types. More...
 
struct  RuleTypeFilter
 Functor to filter by api::rules::Rule::TypeId. More...
 
class  SimplePhaseRingBook
 A simple concrete implementation of the api::rules::PhaseRingBook abstract interface. More...
 
class  SimpleRulebook
 SimpleRulebook is a simple concrete implementation of the api::rules::RoadRulebook abstract interface. More...
 
class  TrafficLightBook
 A concrete implementation of the api::rules::TrafficLightBook abstract interface. More...
 

Typedefs

using DiscreteValueRuleFilter = std::function< bool(const api::rules::DiscreteValueRule &)>
 Convenient alias of a functor to filter api::rules::DiscreteValueRules based on arbitrary criteria from a api::rules::RoadRulebook::QueryResult. More...
 
using RangeValueRuleFilter = std::function< bool(const api::rules::RangeValueRule &)>
 Convenient alias of a functor to filter api::rules::RangeValueRule based on arbitrary criteria from a api::rules::RoadRulebook::QueryResult. More...
 
using QueryResults = api::rules::RoadRulebook::QueryResults
 

Enumerations

enum  RuleType { kDiscreteValueRuleType, kRangeValueRuleType, kUnknownRuleType }
 Label to identify rule type. More...
 

Functions

std::unique_ptr< api::IntersectionBookLoadIntersectionBook (const std::string &input, const api::rules::RoadRulebook &road_rulebook, const api::rules::PhaseRingBook &phase_ring_book, const api::RoadGeometry *road_geometry, ManualPhaseProvider *phase_provider)
 Instantiates and returns an api::IntersectionBook instance based on the specified input document. More...
 
std::unique_ptr< api::IntersectionBookLoadIntersectionBookFromFile (const std::string &filename, const api::rules::RoadRulebook &road_rulebook, const api::rules::PhaseRingBook &phase_ring_book, const api::RoadGeometry *road_geometry, ManualPhaseProvider *phase_provider)
 Instantiates and returns an api::IntersectionBook instance based on the specified filename. More...
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBookOldRules (const api::rules::RoadRulebook *rulebook, const api::rules::TrafficLightBook *traffic_light_book, const std::string &input)
 Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and input YAML string. More...
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBookFromFileOldRules (const api::rules::RoadRulebook *rulebook, const api::rules::TrafficLightBook *traffic_light_book, const std::string &filename)
 Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and filename. More...
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBook (const api::rules::RoadRulebook *rulebook, const api::rules::TrafficLightBook *traffic_light_book, const std::string &input)
 Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and input document. More...
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBookFromFile (const api::rules::RoadRulebook *rulebook, const api::rules::TrafficLightBook *traffic_light_book, const std::string &filename)
 Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and filename. More...
 
std::unique_ptr< api::rules::RoadRulebookLoadRoadRulebook (const api::RoadGeometry *road_geometry, const std::string &input)
 Instantiates an api::rules::RoadRulebook based on the specified road_geometry and input. More...
 
std::unique_ptr< api::rules::RoadRulebookLoadRoadRulebookFromFile (const api::RoadGeometry *road_geometry, const std::string &filename)
 Instantiates an api::rules::RoadRulebook based on the specified road_geometry and filename. More...
 
std::unique_ptr< api::rules::RoadRulebookLoadRoadRulebook (const api::RoadGeometry *road_geometry, const std::string &input, const api::rules::RuleRegistry &rule_registry)
 Instantiates an api::rules::RoadRulebook based on the specified road_geometry, input and rule_registry. More...
 
std::unique_ptr< api::rules::RoadRulebookLoadRoadRulebookFromFile (const api::RoadGeometry *road_geometry, const std::string &filename, const api::rules::RuleRegistry &rule_registry)
 Instantiates an api::rules::RoadRulebook based on the specified road_geometry, filename and rule_registry. More...
 
api::rules::RoadRulebook::QueryResults FilterRules (const api::rules::RoadRulebook::QueryResults &rules, const std::vector< DiscreteValueRuleFilter > &discrete_value_rules_filters, const std::vector< RangeValueRuleFilter > &range_value_rules_filters)
 Returns rules after the application of discrete_value_rules_filters and range_value_rules_filters. More...
 
api::rules::Rule::TypeId DirectionUsageRuleTypeId ()
 Returns a Rule::TypeId whose string representation is "Direction-Usage Rule Type". More...
 
api::rules::DiscreteValueRuleTypeAndValues BuildDirectionUsageRuleType ()
 Returns a direction usage rule type and its possible discrete values. More...
 
api::rules::Rule::TypeId RightOfWayRuleTypeId ()
 Returns a Rule::TypeId whose string representation is "Right-Of-Way Rule Type". More...
 
api::rules::DiscreteValueRuleTypeAndValues BuildRightOfWayRuleType ()
 Returns a right-of-way rule type and its possible discrete values. More...
 
api::rules::Rule::TypeId VehicleStopInZoneBehaviorRuleTypeId ()
 Returns a Rule::TypeId whose string representation is "Vehicle-Stop-In-Zone-Behavior Rule Type". More...
 
api::rules::DiscreteValueRuleTypeAndValues BuildVehicleStopInZoneBehaviorRuleType ()
 Returns a vehicle stop in zone behavior rule type and its possible discrete values. More...
 
api::rules::Rule::TypeId SpeedLimitRuleTypeId ()
 Returns a maliput::api::rules::Rule::TypeId initialized with "Speed-Limit Rule Type". More...
 
std::unique_ptr< api::rules::RuleRegistryLoadRuleRegistry (const std::string &input)
 Instantiates an api::rules::RuleRegistry based on the specified input. More...
 
std::unique_ptr< api::rules::RuleRegistryLoadRuleRegistryFromFile (const std::string &filename)
 Instantiates an api::rules::RuleRegistry based on the specified filename. More...
 
std::vector< maliput::api::rules::Rule::IdGetYieldGroup (const maliput::api::rules::DiscreteValueRule::DiscreteValue &discrete_value)
 Returns a vector of Rule::Ids that represents the yield group of a Right-Of-Way rule state. More...
 
std::vector< maliput::api::rules::Rule::IdGetCurrentYieldGroup (const maliput::api::rules::DiscreteValueRule &discrete_value_rule, const maliput::api::rules::DiscreteValueRuleStateProvider *state_provider)
 Returns the current yield group of discrete_value_rule. More...
 
std::vector< maliput::api::UniqueIdGetBulbGroup (const maliput::api::rules::DiscreteValueRule::DiscreteValue &discrete_value)
 Returns a vector of maliput::api::UniqueIds that represents the bulb group of a Right-Of-Way rule state. More...
 
std::vector< maliput::api::UniqueIdGetCurrentBulbGroup (const maliput::api::rules::DiscreteValueRule &discrete_value_rule, const maliput::api::rules::DiscreteValueRuleStateProvider *state_provider)
 Returns the current bulb group of discrete_value_rule. More...
 
std::unique_ptr< api::rules::TrafficLightBookLoadTrafficLightBook (const std::string &input)
 Instantiates and returns an api::rules::TrafficLightBook instance based on the specified input document. More...
 
std::unique_ptr< api::rules::TrafficLightBookLoadTrafficLightBookFromFile (const std::string &filename)
 Instantiates and returns an api::rules::TrafficLightBook instance based on the specified filename. More...
 
bool IsDiscreteValue (const YAML::Node &rule_node)
 Determines whether the rule_node corresponds to a api::rules::DiscreteValueRule::DiscreteValue description. More...
 
bool IsRangeValue (const YAML::Node &rule_node)
 Determines whether the rule_node corresponds to a api::rules::RangeValueRule::Range description. More...
 
int GetSeverityFromYamlNode (const YAML::Node &node)
 Returns the severity field value from the node. More...
 
std::pair< double, doubleGetRangeMinMaxValuesFromYamlNode (const YAML::Node &node)
 Get min and max values from the yaml node. More...
 
std::string GetValueFromYamlNode (const YAML::Node &node)
 Get the value of a api::rules::DiscreteValueRule::DiscreteValue from a yaml node. More...
 
std::string GetDescriptionFromYamlNode (const YAML::Node &node)
 Get the description of a api::rules::RangeValueRule::Range from a yaml node. More...
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBook (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &input)
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBookFromFile (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &filename)
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBookOldRules (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &input)
 
std::unique_ptr< api::rules::PhaseRingBookLoadPhaseRingBookFromFileOldRules (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &filename)
 
common::Loggerlog ()
 

Typedef Documentation

◆ DiscreteValueRuleFilter

using DiscreteValueRuleFilter = std::function<bool(const api::rules::DiscreteValueRule&)>

Convenient alias of a functor to filter api::rules::DiscreteValueRules based on arbitrary criteria from a api::rules::RoadRulebook::QueryResult.

See also
FilterRules() for further information.

◆ QueryResults

◆ RangeValueRuleFilter

using RangeValueRuleFilter = std::function<bool(const api::rules::RangeValueRule&)>

Convenient alias of a functor to filter api::rules::RangeValueRule based on arbitrary criteria from a api::rules::RoadRulebook::QueryResult.

See also
FilterRules() for further information.

Enumeration Type Documentation

◆ RuleType

enum RuleType
strong

Label to identify rule type.

Enumerator
kDiscreteValueRuleType 

Label for a DiscreteValueRule Type.

kRangeValueRuleType 

Label for a RangeValueRule Type.

kUnknownRuleType 

Label for an unidentified rule type.

Function Documentation

◆ BuildDirectionUsageRuleType()

api::rules::DiscreteValueRuleTypeAndValues BuildDirectionUsageRuleType ( )

Returns a direction usage rule type and its possible discrete values.

Rule::TypeId is initialized via DirectionUsageRuleTypeId(). Values:

  • WithS: travel should proceed in the direction of the +S axis.
  • AgainstS: travel should proceed opposite the +S axis direction.
  • Bidirectional: travel is allowed both with the lane direction(+S) or against it.
  • BidirectionalTurnOnly: travel is allowed both with the lane direction(+S) or against it but should be limited in duration, e.g. when approaching turns.
  • NoUse: Travel on this lane is prohibited.
  • Parking: This lane is used to define a parking area.
  • Undefined: There is no defined direction of travel on this lane.

With api::rules::Rule::State::kStrict strictness level. RelatedRules are empty.

◆ BuildRightOfWayRuleType()

api::rules::DiscreteValueRuleTypeAndValues BuildRightOfWayRuleType ( )

Returns a right-of-way rule type and its possible discrete values.

Rule::TypeId is initialized via RightOfWayRuleTypeId(). Discrete values are the combination of values and two strictness levels. Values:

  • Go: the vehicle has right-of-way and may proceed across the rule's zone.
  • Stop: the vehicle does not have right-of-way and must stop prior to entering the rule's zone.
  • StopThenGo: the vehicle must come to complete stop before entering controlled zone, but may then proceed if safe.

Strictness levels are:

RelatedRules are empty.

◆ BuildVehicleStopInZoneBehaviorRuleType()

api::rules::DiscreteValueRuleTypeAndValues BuildVehicleStopInZoneBehaviorRuleType ( )

Returns a vehicle stop in zone behavior rule type and its possible discrete values.

Rule::TypeId is initialized via VehicleStopInZoneBehaviorRuleTypeId(). Values:

  • DoNotStop: the vehicle is not allowed to stop.
  • 5MinuteStop: the vehicle is not allowed to park for more than five minutes.
  • 30MinuteStop: the vehicle is not allowed to park for more than five thirty minutes.
  • 45MinuteStop: the vehicle is not allowed to park for more than five forty-five minutes.
  • 1HourStop: the vehicle is not allowed to park for more than five one hour.
  • 2HourStop: the vehicle is not allowed to park for more than five two hours.
  • 4HourStop: the vehicles is not allowed to park for more than five four hours.
  • UnrestrictedParking: vehicles are allowed to park without any duration restriction.

With api::rules::Rule::State::kStrict strictness level. RelatedRules are empty.

◆ DirectionUsageRuleTypeId()

api::rules::Rule::TypeId DirectionUsageRuleTypeId ( )

Returns a Rule::TypeId whose string representation is "Direction-Usage Rule Type".

◆ FilterRules()

api::rules::RoadRulebook::QueryResults FilterRules ( const api::rules::RoadRulebook::QueryResults rules,
const std::vector< DiscreteValueRuleFilter > &  discrete_value_rules_filters,
const std::vector< RangeValueRuleFilter > &  range_value_rules_filters 
)

Returns rules after the application of discrete_value_rules_filters and range_value_rules_filters.

Whether a rule is preserved or not is derived from applying each functor in discrete_value_rules_filters and range_value_rules_filters to their respective rules map (by type) as a chain of logic ands.

◆ GetBulbGroup()

std::vector< maliput::api::UniqueId > GetBulbGroup ( const maliput::api::rules::DiscreteValueRule::DiscreteValue discrete_value)

Returns a vector of maliput::api::UniqueIds that represents the bulb group of a Right-Of-Way rule state.

Exceptions
common::assertion_errorWhen discrete_value.related_unique_ids does not have RelatedUniqueIdsKeys::kBulbGroup key.

◆ GetCurrentBulbGroup()

std::vector< maliput::api::UniqueId > GetCurrentBulbGroup ( const maliput::api::rules::DiscreteValueRule discrete_value_rule,
const maliput::api::rules::DiscreteValueRuleStateProvider state_provider 
)

Returns the current bulb group of discrete_value_rule.

Parameters
discrete_value_ruleA Right-Of-Way Rule Type rule.
state_providerA state provider to retrieve current discrete_value_rule state. It must not be nullptr.
Exceptions
common::assertion_errorWhen discrete_value_rule.type_id() is not RightOfWayRuleTypeId().
common::assertion_errorWhen state_provider is nullptr.
common::assertion_errorWhen state_provider does not hold any state for discrete_value_rule.

◆ GetCurrentYieldGroup()

std::vector< maliput::api::rules::Rule::Id > GetCurrentYieldGroup ( const maliput::api::rules::DiscreteValueRule discrete_value_rule,
const maliput::api::rules::DiscreteValueRuleStateProvider state_provider 
)

Returns the current yield group of discrete_value_rule.

Parameters
discrete_value_ruleA Right-Of-Way Rule Type rule.
state_providerA state provider to retrieve current discrete_value_rule state. It must not be nullptr.
Exceptions
common::assertion_errorWhen discrete_value_rule.type_id() is not RightOfWayRuleTypeId().
common::assertion_errorWhen state_provider is nullptr.
common::assertion_errorWhen state_provider does not hold any state for discrete_value_rule.

◆ GetDescriptionFromYamlNode()

std::string GetDescriptionFromYamlNode ( const YAML::Node &  node)

Get the description of a api::rules::RangeValueRule::Range from a yaml node.

Parameters
nodeA YAML::Node that contains the description of the api::rules::DiscreteValueRule::Range.
Returns
A std::string contained in the description field value from the node.
Exceptions
maliput::common::assertion_errorwhen the description is ill-defined.

◆ GetRangeMinMaxValuesFromYamlNode()

std::pair< double, double > GetRangeMinMaxValuesFromYamlNode ( const YAML::Node &  node)

Get min and max values from the yaml node.

Parameters
nodeA YAML::Node that contains the range of the api::rules::RangeValueRule::Range.
Returns
The min and max values contained in the range from the node.
Exceptions
maliput::common::assertion_errorwhen the range is ill-defined.
maliput::common::assertion_errorwhen the min value is greater than max value.

◆ GetSeverityFromYamlNode()

int GetSeverityFromYamlNode ( const YAML::Node &  node)

Returns the severity field value from the node.

When severity is undefined, it will return api::rules::Rule::State::kStrict value.

Parameters
nodeA YAML::Node that contains severity of the api::rules::Rule::State.
Returns
A value indicating severityness. 0 is the strictest.
Exceptions
maliput::common::assertion_errorwhen the severity is negative.

◆ GetValueFromYamlNode()

std::string GetValueFromYamlNode ( const YAML::Node &  node)

Get the value of a api::rules::DiscreteValueRule::DiscreteValue from a yaml node.

Parameters
nodeA YAML::Node that contains the value of the api::rules::DiscreteValueRule::DiscreteValue.
Returns
A std::string contained in the value from the node.
Exceptions
maliput::common::assertion_errorwhen the value is ill-defined.

◆ GetYieldGroup()

std::vector< maliput::api::rules::Rule::Id > GetYieldGroup ( const maliput::api::rules::DiscreteValueRule::DiscreteValue discrete_value)

Returns a vector of Rule::Ids that represents the yield group of a Right-Of-Way rule state.

Exceptions
common::assertion_errorWhen discrete_value.related_rules does not have RelatedRulesKeys::kYieldGroup key.

◆ IsDiscreteValue()

bool IsDiscreteValue ( const YAML::Node &  rule_node)

Determines whether the rule_node corresponds to a api::rules::DiscreteValueRule::DiscreteValue description.

Parameters
rule_nodeA YAML::Node that contains information of a api::rules::DiscreteValueRule::DiscreteValue.
Returns
True when a api::rules::DiscreteValueRule::DiscreteValue is contained in rule_node.

◆ IsRangeValue()

bool IsRangeValue ( const YAML::Node &  rule_node)

Determines whether the rule_node corresponds to a api::rules::RangeValueRule::Range description.

Parameters
rule_nodeA YAML::Node that contains information of a api::rules::RangeValueRule::Range.
Returns
True when a api::rules::RangeValueRule::Range is contained in rule_node.

◆ LoadIntersectionBook()

std::unique_ptr< api::IntersectionBook > LoadIntersectionBook ( const std::string &  input,
const api::rules::RoadRulebook road_rulebook,
const api::rules::PhaseRingBook phase_ring_book,
const api::RoadGeometry road_geometry,
ManualPhaseProvider phase_provider 
)

Instantiates and returns an api::IntersectionBook instance based on the specified input document.

Parameters
inputThe YAML Intersections document.
road_rulebookThe book containing the road rules.
phase_ring_bookThe book containing the phase rings.
phase_providerThe phase provider. Adds PhaseRings and sets their initial states.
Returns
The newly created api::IntersectionBook instance.

◆ LoadIntersectionBookFromFile()

std::unique_ptr< api::IntersectionBook > LoadIntersectionBookFromFile ( const std::string &  filename,
const api::rules::RoadRulebook road_rulebook,
const api::rules::PhaseRingBook phase_ring_book,
const api::RoadGeometry road_geometry,
ManualPhaseProvider phase_provider 
)

Instantiates and returns an api::IntersectionBook instance based on the specified filename.

Parameters
filenameThe YAML file that contains a Intersections document.
road_rulebookThe book containing the road rules.
phase_ring_bookThe book containing the phase rings.
phase_providerThe phase provider. Adds PhaseRings and sets their initial states.
Returns
The newly created api::IntersectionBook instance.

◆ LoadPhaseRingBook() [1/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBook ( const api::rules::RoadRulebook rulebook,
const api::rules::TrafficLightBook traffic_light_book,
const std::string &  input 
)

Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and input document.

Parameters
rulebookContains the rules.
traffic_light_bookContains the traffic lights.
inputThe YAML PhaseRings document.
Returns
The newly created api::rules::PhaseRingBook instance.

◆ LoadPhaseRingBook() [2/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBook ( const RoadRulebook *  rulebook,
const TrafficLightBook traffic_light_book,
const std::string &  input 
)

◆ LoadPhaseRingBookFromFile() [1/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookFromFile ( const api::rules::RoadRulebook rulebook,
const api::rules::TrafficLightBook traffic_light_book,
const std::string &  filename 
)

Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and filename.

Parameters
rulebookContains the rules.
traffic_light_bookContains the traffic lights.
filenameThe YAML file that contains a PhaseRings document.
Returns
The newly created api::rules::PhaseRingBook instance.

◆ LoadPhaseRingBookFromFile() [2/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookFromFile ( const RoadRulebook *  rulebook,
const TrafficLightBook traffic_light_book,
const std::string &  filename 
)

◆ LoadPhaseRingBookFromFileOldRules() [1/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookFromFileOldRules ( const api::rules::RoadRulebook rulebook,
const api::rules::TrafficLightBook traffic_light_book,
const std::string &  filename 
)

Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and filename.

Based on old rule API.

Parameters
rulebookContains the rules.
traffic_light_bookContains the traffic lights.
filenameThe YAML file that contains a PhaseRings document.
Returns
The newly created api::rules::PhaseRingBook instance.

◆ LoadPhaseRingBookFromFileOldRules() [2/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookFromFileOldRules ( const RoadRulebook *  rulebook,
const TrafficLightBook traffic_light_book,
const std::string &  filename 
)

◆ LoadPhaseRingBookOldRules() [1/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookOldRules ( const api::rules::RoadRulebook rulebook,
const api::rules::TrafficLightBook traffic_light_book,
const std::string &  input 
)

Instantiates and returns an api::rules::PhaseRingBook instance based on the specified rulebook, and input YAML string.

Based on old rule API.

Parameters
rulebookContains the rules.
traffic_light_bookContains the traffic lights.
inputThe YAML string which describes the PhaseRings.
Returns
The newly created api::rules::PhaseRingBook instance.

◆ LoadPhaseRingBookOldRules() [2/2]

std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookOldRules ( const RoadRulebook *  rulebook,
const TrafficLightBook traffic_light_book,
const std::string &  input 
)

◆ LoadRoadRulebook() [1/2]

std::unique_ptr< api::rules::RoadRulebook > LoadRoadRulebook ( const api::RoadGeometry road_geometry,
const std::string &  input 
)

Instantiates an api::rules::RoadRulebook based on the specified road_geometry and input.

Parameters
road_geometryThe road geometry to which the api::rules::RoadRulebook to be loaded applies.
inputThe YAML RoadRulebook document.
Returns
An api::rules::RoadRulebook containing the rules specified in input.
Exceptions
std::exceptionif the YAML document within input is invalid, or an api::rules::RightOfWayRule within input has an invalid state or zone type.

◆ LoadRoadRulebook() [2/2]

std::unique_ptr< api::rules::RoadRulebook > LoadRoadRulebook ( const api::RoadGeometry road_geometry,
const std::string &  input,
const api::rules::RuleRegistry rule_registry 
)

Instantiates an api::rules::RoadRulebook based on the specified road_geometry, input and rule_registry.

Parameters
road_geometryThe road geometry to which the api::rules::RoadRulebook to be loaded applies. It must not be nullptr.
inputThe YAML RoadRulebook document.
rule_registryAn api::rules::RuleRegistry for creating allowed rule types.
Returns
An api::rules::RoadRulebook containing the rules specified in input.
Exceptions
std::exceptionif the YAML document in input is invalid.

◆ LoadRoadRulebookFromFile() [1/2]

std::unique_ptr< api::rules::RoadRulebook > LoadRoadRulebookFromFile ( const api::RoadGeometry road_geometry,
const std::string &  filename 
)

Instantiates an api::rules::RoadRulebook based on the specified road_geometry and filename.

Parameters
road_geometryThe road geometry to which the api::rules::RoadRulebook to be loaded applies.
filenameThe path to the YAML RoadRulebook document.
Returns
An api::rules::RoadRulebook containing the rules specified in input.
Exceptions
std::exceptionif the YAML document in filename is invalid, or an api::rules::RightOfWayRule within that document has an invalid state or zone type.

◆ LoadRoadRulebookFromFile() [2/2]

std::unique_ptr< api::rules::RoadRulebook > LoadRoadRulebookFromFile ( const api::RoadGeometry road_geometry,
const std::string &  filename,
const api::rules::RuleRegistry rule_registry 
)

Instantiates an api::rules::RoadRulebook based on the specified road_geometry, filename and rule_registry.

Parameters
road_geometryThe road geometry to which the api::rules::RoadRulebook to be loaded applies. It must not be nullptr.
filenameThe path to the YAML RoadRulebook document.
rule_registryAn api::rules::RuleRegistry for creating allowed rule types.
Returns
An api::rules::RoadRulebook containing the rules specified in input.
Exceptions
std::exceptionif the YAML document in filename is invalid.

◆ LoadRuleRegistry()

std::unique_ptr< api::rules::RuleRegistry > LoadRuleRegistry ( const std::string &  input)

Instantiates an api::rules::RuleRegistry based on the specified input.

Parameters
inputThe YAML RuleRegistry document.
Returns
An api::rules::RuleRegistry containing the rule types for DiscreteValueRule and RangeValueRule Types specified in input.
Exceptions
std::exceptionif the YAML document within input is invalid.

◆ LoadRuleRegistryFromFile()

std::unique_ptr< api::rules::RuleRegistry > LoadRuleRegistryFromFile ( const std::string &  filename)

Instantiates an api::rules::RuleRegistry based on the specified filename.

Parameters
filenameThe path to the YAML RuleRegistry document.
Returns
An api::rules::RuleRegistry containing the rule types for DiscreteValueRule and RangeValueRule Types specified in the file.
Exceptions
std::exceptionif the YAML document referred by filename is invalid.

◆ LoadTrafficLightBook()

std::unique_ptr< api::rules::TrafficLightBook > LoadTrafficLightBook ( const std::string &  input)

Instantiates and returns an api::rules::TrafficLightBook instance based on the specified input document.

Parameters
inputThe YAML TrafficLights document.
Returns
The newly created api::rules::TrafficLightBook instance.

◆ LoadTrafficLightBookFromFile()

std::unique_ptr< api::rules::TrafficLightBook > LoadTrafficLightBookFromFile ( const std::string &  filename)

Instantiates and returns an api::rules::TrafficLightBook instance based on the specified filename.

Parameters
filenameThe YAML file that contains a TrafficLights document.
Returns
The newly created api::rules::TrafficLightBook instance.

◆ log()

common::Logger* maliput::log ( )
related

◆ RightOfWayRuleTypeId()

api::rules::Rule::TypeId RightOfWayRuleTypeId ( )

Returns a Rule::TypeId whose string representation is "Right-Of-Way Rule Type".

◆ SpeedLimitRuleTypeId()

api::rules::Rule::TypeId SpeedLimitRuleTypeId ( )

Returns a maliput::api::rules::Rule::TypeId initialized with "Speed-Limit Rule Type".

◆ VehicleStopInZoneBehaviorRuleTypeId()

api::rules::Rule::TypeId VehicleStopInZoneBehaviorRuleTypeId ( )

Returns a Rule::TypeId whose string representation is "Vehicle-Stop-In-Zone-Behavior Rule Type".

maliput::common::hash_append
std::enable_if_t< std::is_integral< T >::value > hash_append(HashAlgorithm &hasher, const T &item) noexcept
Provides hash_append for integral constants.
Definition: maliput_hash.h:131