scenario_simulator_v2 C++ API
relative_clearance_condition.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef OPENSCENARIO_INTERPRETER__SYNTAX__RELATIVE_CLEARANCE_CONDITION_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__RELATIVE_CLEARANCE_CONDITION_HPP_
17 
23 #include <pugixml.hpp>
24 
26 {
27 inline namespace syntax
28 {
29 /*
30  RelativeClearanceCondition (OpenSCENARIO XML 1.3)
31 
32  <xsd:complexType name="RelativeClearanceCondition">
33  <xsd:sequence>
34  <xsd:element name="RelativeLaneRange" type="RelativeLaneRange" minOccurs="0" maxOccurs="unbounded"/>
35  <xsd:element name="EntityRef" type="EntityRef" minOccurs="0" maxOccurs="unbounded"/>
36  </xsd:sequence>
37  <xsd:attribute name="oppositeLanes" type="Boolean" use="required"/>
38  <xsd:attribute name="distanceForward" type="Double"/>
39  <xsd:attribute name="distanceBackward" type="Double"/>
40  <xsd:attribute name="freeSpace" type="Boolean" use="required"/>
41  </xsd:complexType>
42 */
46 {
47  /*
48  Longitudinal distance behind reference point of the entity to be checked along lane centerline of the current lane of the triggering entity. Orientation of entity towards lane determines backward direction. Velocity of entity is irrelevant. Unit: [m]. Range: [0..inf[. Default if omitted: 0
49  */
51 
52  /*
53  Longitudinal distance in front of reference point of the entity to be checked along lane centerline of the current lane of the triggering entity. Orientation of entity towards lane determines forward direction. Velocity of entity is irrelevant. Unit: [m]. Range: [0..inf[. Default if omitted: 0
54  */
56 
57  /*
58  If false, then entityRefs are only considered to be on the lane if their reference point is within the checked area; otherwise the whole bounding box is considered.
59  */
61 
62  /*
63  If true, then also lanes in the opposite direction are considered; otherwise only lanes in the same direction are considered.
64  */
66 
67  /*
68  The lanes to be checked to left and right of the triggering entity (positive to the y-axis). If omitted: all lanes are checked.
69  */
70  const std::list<RelativeLaneRange> relative_lane_range;
71 
72  /*
73  Constraint to check only specific entities. If it is not used then all entities are considered.
74  */
75  const std::list<Entity> entity_refs;
76 
78 
79  explicit RelativeClearanceCondition(const pugi::xml_node &, Scope &, const TriggeringEntities &);
80 
81  auto description() const -> String;
82 
83  auto evaluate() -> Object;
84 };
85 } // namespace syntax
86 } // namespace openscenario_interpreter
87 
88 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__RELATIVE_CLEARANCE_CONDITION_HPP_
Definition: scope.hpp:154
std::string String
Definition: string.hpp:24
Definition: escape_sequence.hpp:22
Definition: relative_clearance_condition.hpp:46
auto evaluate() -> Object
Definition: relative_clearance_condition.cpp:83
const std::list< Entity > entity_refs
Definition: relative_clearance_condition.hpp:75
RelativeClearanceCondition(const pugi::xml_node &, Scope &, const TriggeringEntities &)
Definition: relative_clearance_condition.cpp:29
const std::list< RelativeLaneRange > relative_lane_range
Definition: relative_clearance_condition.hpp:70
const Double distance_backward
Definition: relative_clearance_condition.hpp:50
const Boolean free_space
Definition: relative_clearance_condition.hpp:60
const Double distance_forward
Definition: relative_clearance_condition.hpp:55
const Boolean opposite_lanes
Definition: relative_clearance_condition.hpp:65
auto description() const -> String
Definition: relative_clearance_condition.cpp:42
const TriggeringEntities triggering_entities
Definition: relative_clearance_condition.hpp:77
Definition: triggering_entities.hpp:40