maliput
|
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
Maliput types may implement a hash_append
function. The function appends every hash-relevant member field into the hasher:
Checklist for reviewing a hash_append
implementation:
@ref hash_append
in its Doxygen comment.noexcept
.Types that implement this pattern may be used in unordered collections:
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 | |
drake | |
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::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. More... | |
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 . More... | |
std::unique_ptr< api::rules::PhaseRingBook > | 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. More... | |
std::unique_ptr< api::rules::PhaseRingBook > | 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 . More... | |
std::unique_ptr< api::rules::PhaseRingBook > | 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. More... | |
std::unique_ptr< api::rules::PhaseRingBook > | 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 . More... | |
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 . More... | |
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 . More... | |
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 . More... | |
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 . 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::RuleRegistry > | LoadRuleRegistry (const std::string &input) |
Instantiates an api::rules::RuleRegistry based on the specified input . More... | |
std::unique_ptr< api::rules::RuleRegistry > | LoadRuleRegistryFromFile (const std::string &filename) |
Instantiates an api::rules::RuleRegistry based on the specified filename . More... | |
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. More... | |
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 . More... | |
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. More... | |
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 . More... | |
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. More... | |
std::unique_ptr< api::rules::TrafficLightBook > | LoadTrafficLightBookFromFile (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, double > | GetRangeMinMaxValuesFromYamlNode (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::PhaseRingBook > | LoadPhaseRingBook (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &input) |
std::unique_ptr< api::rules::PhaseRingBook > | LoadPhaseRingBookFromFile (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &filename) |
std::unique_ptr< api::rules::PhaseRingBook > | LoadPhaseRingBookOldRules (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &input) |
std::unique_ptr< api::rules::PhaseRingBook > | LoadPhaseRingBookFromFileOldRules (const RoadRulebook *rulebook, const TrafficLightBook *traffic_light_book, const std::string &filename) |
common::Logger * | log () |
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.
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.
|
strong |
api::rules::DiscreteValueRuleTypeAndValues BuildDirectionUsageRuleType | ( | ) |
Returns a direction usage rule type and its possible discrete values.
Rule::TypeId is initialized via DirectionUsageRuleTypeId(). Values:
With api::rules::Rule::State::kStrict strictness level. RelatedRules are empty.
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:
Strictness levels are:
RelatedRules are empty.
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:
With api::rules::Rule::State::kStrict strictness level. RelatedRules are empty.
api::rules::Rule::TypeId DirectionUsageRuleTypeId | ( | ) |
Returns a Rule::TypeId whose string representation is "Direction-Usage Rule Type".
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.
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.
common::assertion_error | When discrete_value.related_unique_ids does not have RelatedUniqueIdsKeys::kBulbGroup key. |
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
.
discrete_value_rule | A Right-Of-Way Rule Type rule. |
state_provider | A state provider to retrieve current discrete_value_rule state. It must not be nullptr. |
common::assertion_error | When discrete_value_rule.type_id() is not RightOfWayRuleTypeId(). |
common::assertion_error | When state_provider is nullptr. |
common::assertion_error | When state_provider does not hold any state for discrete_value_rule . |
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
.
discrete_value_rule | A Right-Of-Way Rule Type rule. |
state_provider | A state provider to retrieve current discrete_value_rule state. It must not be nullptr. |
common::assertion_error | When discrete_value_rule.type_id() is not RightOfWayRuleTypeId(). |
common::assertion_error | When state_provider is nullptr. |
common::assertion_error | When state_provider does not hold any state for discrete_value_rule . |
std::string GetDescriptionFromYamlNode | ( | const YAML::Node & | node | ) |
Get the description of a api::rules::RangeValueRule::Range from a yaml node.
node | A YAML::Node that contains the description of the api::rules::DiscreteValueRule::Range. |
node
.maliput::common::assertion_error | when the description is ill-defined. |
Get min and max values from the yaml node.
node | A YAML::Node that contains the range of the api::rules::RangeValueRule::Range. |
maliput::common::assertion_error | when the range is ill-defined. |
maliput::common::assertion_error | when the min value is greater than max value. |
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.
node | A YAML::Node that contains severity of the api::rules::Rule::State. |
maliput::common::assertion_error | when the severity is negative. |
std::string GetValueFromYamlNode | ( | const YAML::Node & | node | ) |
Get the value of a api::rules::DiscreteValueRule::DiscreteValue from a yaml node.
node | A YAML::Node that contains the value of the api::rules::DiscreteValueRule::DiscreteValue. |
node
.maliput::common::assertion_error | when the value is ill-defined. |
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.
common::assertion_error | When discrete_value.related_rules does not have RelatedRulesKeys::kYieldGroup key. |
bool IsDiscreteValue | ( | const YAML::Node & | rule_node | ) |
Determines whether the rule_node
corresponds to a api::rules::DiscreteValueRule::DiscreteValue description.
rule_node | A YAML::Node that contains information of a api::rules::DiscreteValueRule::DiscreteValue. |
rule_node
. bool IsRangeValue | ( | const YAML::Node & | rule_node | ) |
Determines whether the rule_node
corresponds to a api::rules::RangeValueRule::Range description.
rule_node | A YAML::Node that contains information of a api::rules::RangeValueRule::Range. |
rule_node
. 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.
input | The YAML Intersections document. |
road_rulebook | The book containing the road rules. |
phase_ring_book | The book containing the phase rings. |
phase_provider | The phase provider. Adds PhaseRings and sets their initial states. |
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
.
filename | The YAML file that contains a Intersections document. |
road_rulebook | The book containing the road rules. |
phase_ring_book | The book containing the phase rings. |
phase_provider | The phase provider. Adds PhaseRings and sets their initial states. |
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.
rulebook | Contains the rules. |
traffic_light_book | Contains the traffic lights. |
input | The YAML PhaseRings document. |
std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBook | ( | const RoadRulebook * | rulebook, |
const TrafficLightBook * | traffic_light_book, | ||
const std::string & | input | ||
) |
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
.
rulebook | Contains the rules. |
traffic_light_book | Contains the traffic lights. |
filename | The YAML file that contains a PhaseRings document. |
std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookFromFile | ( | const RoadRulebook * | rulebook, |
const TrafficLightBook * | traffic_light_book, | ||
const std::string & | filename | ||
) |
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.
rulebook | Contains the rules. |
traffic_light_book | Contains the traffic lights. |
filename | The YAML file that contains a PhaseRings document. |
std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookFromFileOldRules | ( | const RoadRulebook * | rulebook, |
const TrafficLightBook * | traffic_light_book, | ||
const std::string & | filename | ||
) |
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.
rulebook | Contains the rules. |
traffic_light_book | Contains the traffic lights. |
input | The YAML string which describes the PhaseRings. |
std::unique_ptr<api::rules::PhaseRingBook> maliput::LoadPhaseRingBookOldRules | ( | const RoadRulebook * | rulebook, |
const TrafficLightBook * | traffic_light_book, | ||
const std::string & | input | ||
) |
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
.
road_geometry | The road geometry to which the api::rules::RoadRulebook to be loaded applies. |
input | The YAML RoadRulebook document. |
input
.std::exception | if the YAML document within input is invalid, or an api::rules::RightOfWayRule within input has an invalid state or zone type. |
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
.
road_geometry | The road geometry to which the api::rules::RoadRulebook to be loaded applies. It must not be nullptr. |
input | The YAML RoadRulebook document. |
rule_registry | An api::rules::RuleRegistry for creating allowed rule types. |
input
.std::exception | if the YAML document in input is invalid. |
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
.
road_geometry | The road geometry to which the api::rules::RoadRulebook to be loaded applies. |
filename | The path to the YAML RoadRulebook document. |
input
.std::exception | if the YAML document in filename is invalid, or an api::rules::RightOfWayRule within that document has an invalid state or zone type. |
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
.
road_geometry | The road geometry to which the api::rules::RoadRulebook to be loaded applies. It must not be nullptr. |
filename | The path to the YAML RoadRulebook document. |
rule_registry | An api::rules::RuleRegistry for creating allowed rule types. |
input
.std::exception | if the YAML document in filename is invalid. |
std::unique_ptr< api::rules::RuleRegistry > LoadRuleRegistry | ( | const std::string & | input | ) |
Instantiates an api::rules::RuleRegistry based on the specified input
.
input | The YAML RuleRegistry document. |
input
.std::exception | if the YAML document within input is invalid. |
std::unique_ptr< api::rules::RuleRegistry > LoadRuleRegistryFromFile | ( | const std::string & | filename | ) |
Instantiates an api::rules::RuleRegistry based on the specified filename
.
filename | The path to the YAML RuleRegistry document. |
std::exception | if the YAML document referred by filename is invalid. |
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.
input | The YAML TrafficLights document. |
std::unique_ptr< api::rules::TrafficLightBook > LoadTrafficLightBookFromFile | ( | const std::string & | filename | ) |
Instantiates and returns an api::rules::TrafficLightBook instance based on the specified filename
.
filename | The YAML file that contains a TrafficLights document. |
|
related |
api::rules::Rule::TypeId RightOfWayRuleTypeId | ( | ) |
Returns a Rule::TypeId whose string representation is "Right-Of-Way Rule Type".
api::rules::Rule::TypeId SpeedLimitRuleTypeId | ( | ) |
Returns a maliput::api::rules::Rule::TypeId initialized with "Speed-Limit Rule Type".
api::rules::Rule::TypeId VehicleStopInZoneBehaviorRuleTypeId | ( | ) |
Returns a Rule::TypeId whose string representation is "Vehicle-Stop-In-Zone-Behavior Rule Type".