scenario_simulator_v2 C++ API
speed_profile_action.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__SPEED_PROFILE_ACTION_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__SPEED_PROFILE_ACTION_HPP_
17 
24 #include <pugixml.hpp>
25 
27 {
28 inline namespace syntax
29 {
30 /* ---- SpeedProfileAction 1.2 -------------------------------------------------
31  *
32  * <xsd:complexType name="SpeedProfileAction">
33  * <xsd:sequence>
34  * <xsd:element name="DynamicConstraints" type="DynamicConstraints" minOccurs="0"/>
35  * <xsd:element name="SpeedProfileEntry" type="SpeedProfileEntry" maxOccurs="unbounded"/>
36  * </xsd:sequence>
37  * <xsd:attribute name="entityRef" type="String"/>
38  * <xsd:attribute name="followingMode" type="FollowingMode" use="required"/>
39  * </xsd:complexType>
40  *
41  * -------------------------------------------------------------------------- */
42 struct SpeedProfileAction : private Scope, // NOTE: Required for access to actors
45 {
46  /*
47  Reference entity. If set, the speed values will be interpreted as relative
48  delta to the speed of the referenced entity.
49  */
51 
52  /*
53  Defines whether to apply strictly linear interpolation between speed
54  target values (mode=position), or to apply jerk (change rate of
55  acceleration/deceleration) and other optional constraints of the
56  Performance class of a Vehicle entity resulting in a smoother speed
57  profile curve (mode=follow). For mode=follow the acceleration is zero at
58  the start and end of the profile.
59  */
61 
62  /*
63  Defines limitations to the action in terms of acceleration, deceleration,
64  speed and/or jerk. These settings has precedence over any Performance
65  settings (applies to vehicles only).
66  */
68 
69  const std::list<SpeedProfileEntry> speed_profile_entry; // Defines a series of speed targets.
70 
71  std::unordered_map<String, std::list<SpeedProfileEntry>::const_iterator> accomplishments;
72 
73  explicit SpeedProfileAction(const pugi::xml_node &, Scope &);
74 
75  auto accomplished() -> bool;
76 
77  auto apply(const EntityRef &, const SpeedProfileEntry &) -> void;
78 
79  auto endsImmediately() const -> bool;
80 
81  auto run() -> void;
82 
83  auto start() -> void;
84 };
85 } // namespace syntax
86 } // namespace openscenario_interpreter
87 
88 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__SPEED_PROFILE_ACTION_HPP_
Definition: scope.hpp:154
Definition: escape_sequence.hpp:22
Definition: dynamic_constraints.hpp:44
Definition: entity_ref.hpp:35
Definition: following_mode.hpp:42
Definition: speed_profile_action.hpp:45
auto apply(const EntityRef &, const SpeedProfileEntry &) -> void
Definition: speed_profile_action.cpp:34
const FollowingMode following_mode
Definition: speed_profile_action.hpp:60
const std::list< SpeedProfileEntry > speed_profile_entry
Definition: speed_profile_action.hpp:69
const EntityRef entity_ref
Definition: speed_profile_action.hpp:50
SpeedProfileAction(const pugi::xml_node &, Scope &)
Definition: speed_profile_action.cpp:24
auto run() -> void
Definition: speed_profile_action.cpp:98
auto endsImmediately() const -> bool
Definition: speed_profile_action.cpp:96
auto start() -> void
Definition: speed_profile_action.cpp:118
const DynamicConstraints dynamic_constraints
Definition: speed_profile_action.hpp:67
auto accomplished() -> bool
Definition: speed_profile_action.cpp:87
std::unordered_map< String, std::list< SpeedProfileEntry >::const_iterator > accomplishments
Definition: speed_profile_action.hpp:71
Definition: speed_profile_entry.hpp:35