scenario_simulator_v2 C++ API
weather.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__WEATHER_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__WEATHER_HPP_
17 
26 #include <pugixml.hpp>
27 
29 {
30 inline namespace syntax
31 {
32 /*
33  Weather (OpenSCENARIO XML 1.3.1)
34 
35  Defines the environment conditions of a scenario, e.g. time of day, weather and road condition. If one of the conditions is missing it means that it doesn't change.
36 
37  <xsd:complexType name="Weather">
38  <xsd:all>
39  <xsd:element name="Sun" type="Sun" minOccurs="0"/>
40  <xsd:element name="Fog" type="Fog" minOccurs="0"/>
41  <xsd:element name="Precipitation" type="Precipitation" minOccurs="0"/>
42  <xsd:element name="Wind" type="Wind" minOccurs="0"/>
43  <xsd:element name="DomeImage" type="DomeImage" minOccurs="0"/>
44  </xsd:all>
45  <xsd:attribute name="cloudState" type="CloudState">
46  <xsd:annotation>
47  <xsd:appinfo>
48  deprecated
49  </xsd:appinfo>
50  </xsd:annotation>
51  </xsd:attribute>
52  <xsd:attribute name="atmosphericPressure" type="Double"/>
53  <xsd:attribute name="temperature" type="Double"/>
54  <xsd:attribute name="fractionalCloudCover" type="FractionalCloudCover"/>
55  </xsd:complexType>
56 */
57 struct Weather
58 {
59  /*
60  * Warn: Model specification(ref) has following statement.
61  * > If one of the conditions is missing it means that it doesn't change.
62  * However, current implementation does not represent that condition is missing.
63  * Instead, conditions are filled with its default state (from default constructor).
64  * This difference may cause unspecified behavior.
65  * TODO: Follow the model specification as described above.
66  *
67  * ref:
68  * https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/Weather.html
69  */
70  const Double atmospheric_pressure; // Reference atmospheric pressure at z=0.0 in world coordinate
71  // system. Unit: [Pa]. Range: [80000..120000]. The actual
72  // atmospheric pressure around the entities of the scenario
73  // has to be calculated depending on their z position. See
74  // also the Standard Atmosphere as defined in ISO2533.
75 
76  const Double
77  temperature; // Definition of the cloud state, i.e. cloud state and sky visualization settings.
78 
79  const FractionalCloudCover fractional_cloud_cover; // Definition of cloud states using the
80  // fractional cloud cover in oktas.
81  const Sun sun; // Definition of the sun, i.e. position and intensity.
82 
83  const Fog fog; // Definition of fog, i.e. visual range and bounding box.
84 
85  const Precipitation precipitation; // Definition of precipitation, i.e. type and
86  // intensity.
87 
88  const Wind wind; // Definition of the wind: direction and speed.
89 
90  const DomeImage dome_image; // Image reference to represent the sky. Mutually exclusive
91  // with "fractionalCloudCover". If the image also contains lighting
92  // information (HDRi) it is also mutually exclusive with "sun".
93 
94  Weather() = default;
95 
96  explicit Weather(const pugi::xml_node &, Scope &);
97 };
98 
99 } // namespace syntax
100 } // namespace openscenario_interpreter
101 
102 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__WEATHER_HPP_
Definition: scope.hpp:158
Definition: hypot.hpp:22
Definition: dome_image.hpp:40
Definition: fractional_cloud_cover.hpp:52
Definition: precipitation.hpp:46
const Precipitation precipitation
Definition: weather.hpp:85
const Fog fog
Definition: weather.hpp:83
const DomeImage dome_image
Definition: weather.hpp:90
const Double temperature
Definition: weather.hpp:77
const Wind wind
Definition: weather.hpp:88
const FractionalCloudCover fractional_cloud_cover
Definition: weather.hpp:79
const Double atmospheric_pressure
Definition: weather.hpp:70
const Sun sun
Definition: weather.hpp:81