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