Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2022 Intel Corporation 5 : : * 6 : : * SPDX-License-Identifier: LGPL-2.1-only 7 : : * 8 : : * ----------------- END LICENSE BLOCK ----------------------------------- 9 : : */ 10 : : 11 : : /** 12 : : * Generated file 13 : : * @file 14 : : * 15 : : * Generator Version : 11.0.0-2046 16 : : */ 17 : : 18 : : #pragma once 19 : : 20 : : #include <iostream> 21 : : #include <limits> 22 : : #include <memory> 23 : : #include <sstream> 24 : : #include "ad/physics/Distance.hpp" 25 : : #include "ad/physics/Duration.hpp" 26 : : #include "ad/physics/Speed.hpp" 27 : : #include "ad/rss/world/LateralRssAccelerationValues.hpp" 28 : : #include "ad/rss/world/LongitudinalRssAccelerationValues.hpp" 29 : : #include "ad/rss/world/UnstructuredSettings.hpp" 30 : : /*! 31 : : * @brief namespace ad 32 : : */ 33 : : namespace ad { 34 : : /*! 35 : : * @brief namespace rss 36 : : */ 37 : : namespace rss { 38 : : /*! 39 : : * @brief namespace world 40 : : */ 41 : : namespace world { 42 : : 43 : : /*! 44 : : * \brief DataType RssDynamics 45 : : * 46 : : * Describes the RSS dynamics values to be applied for an object within the metric world frame. The dynamics consist of 47 : : * a longitudinal component, a lateral component and a lateral fluctuation margin to be taken into account to compensate 48 : : * for lateral fluctuations. 49 : : */ 50 : : struct RssDynamics 51 : : { 52 : : /*! 53 : : * \brief Smart pointer on RssDynamics 54 : : */ 55 : : typedef std::shared_ptr<RssDynamics> Ptr; 56 : : 57 : : /*! 58 : : * \brief Smart pointer on constant RssDynamics 59 : : */ 60 : : typedef std::shared_ptr<RssDynamics const> ConstPtr; 61 : : 62 : : /*! 63 : : * \brief standard constructor 64 : : */ 65 : 25402 : RssDynamics() = default; 66 : : 67 : : /*! 68 : : * \brief standard destructor 69 : : */ 70 : : ~RssDynamics() = default; 71 : : 72 : : /*! 73 : : * \brief standard copy constructor 74 : : */ 75 : : RssDynamics(const RssDynamics &other) = default; 76 : : 77 : : /*! 78 : : * \brief standard move constructor 79 : : */ 80 : : RssDynamics(RssDynamics &&other) = default; 81 : : 82 : : /** 83 : : * \brief standard assignment operator 84 : : * 85 : : * \param[in] other Other RssDynamics 86 : : * 87 : : * \returns Reference to this RssDynamics. 88 : : */ 89 : : RssDynamics &operator=(const RssDynamics &other) = default; 90 : : 91 : : /** 92 : : * \brief standard move operator 93 : : * 94 : : * \param[in] other Other RssDynamics 95 : : * 96 : : * \returns Reference to this RssDynamics. 97 : : */ 98 : : RssDynamics &operator=(RssDynamics &&other) = default; 99 : : 100 : : /** 101 : : * \brief standard comparison operator 102 : : * 103 : : * \param[in] other Other RssDynamics 104 : : * 105 : : * \returns \c true if both RssDynamics are equal 106 : : */ 107 : 138 : bool operator==(const RssDynamics &other) const 108 : : { 109 [ + + ]: 262 : return (alpha_lon == other.alpha_lon) && (alpha_lat == other.alpha_lat) 110 [ + + + + ]: 122 : && (lateral_fluctuation_margin == other.lateral_fluctuation_margin) && (response_time == other.response_time) 111 [ + + ]: 118 : && (max_speed_on_acceleration == other.max_speed_on_acceleration) 112 [ + + ]: 116 : && (unstructured_settings == other.unstructured_settings) 113 [ + + + + ]: 262 : && (min_longitudinal_safety_distance == other.min_longitudinal_safety_distance); 114 : : } 115 : : 116 : : /** 117 : : * \brief standard comparison operator 118 : : * 119 : : * \param[in] other Other RssDynamics. 120 : : * 121 : : * \returns \c true if both RssDynamics are different 122 : : */ 123 : 8 : bool operator!=(const RssDynamics &other) const 124 : : { 125 : 8 : return !operator==(other); 126 : : } 127 : : 128 : : /*! 129 : : * RSS dynamics values along longitudinal coordinate system axis. 130 : : */ 131 : : ::ad::rss::world::LongitudinalRssAccelerationValues alpha_lon; 132 : : 133 : : /*! 134 : : * RSS dynamics values along lateral coordinate system axis. 135 : : */ 136 : : ::ad::rss::world::LateralRssAccelerationValues alpha_lat; 137 : : 138 : : /*! 139 : : * Defines the lateral fluctuation margin to be taken into account. 140 : : */ 141 : : ::ad::physics::Distance lateral_fluctuation_margin{0.0}; 142 : : 143 : : /*! 144 : : * Defines the response time of the object to be considered. 145 : : */ 146 : : ::ad::physics::Duration response_time; 147 : : 148 : : /*! 149 : : * Defines the maximum speed of the object to be considered while acceleration within 150 : : * the response time. The acceleration will be stopped if this speed limit is reached. 151 : : * In case the speed before the acceleration is already higher or equal to this value, 152 : : * no further acceleration will take place during the response time (in this case 153 : : * speed before response time == speed after response time). 154 : : */ 155 : : ::ad::physics::Speed max_speed_on_acceleration{100}; 156 : : 157 : : /*! 158 : : * Settings to be considered for evaluation in unstructured mode. 159 : : */ 160 : : ::ad::rss::world::UnstructuredSettings unstructured_settings; 161 : : 162 : : /*! 163 : : * The minimum longitudinal safety distance to be applied (defaults 0.) 164 : : * In structured case after the rss_longitudinal_safe_distance is calculated according 165 : : * to RSS formulas, this parameter value is added to the resulting safe distance: 166 : : * safe_distance += min_longitudinal_safety_distance, 167 : : * in unstructured case the ego vehicle is expanded by that distance towards the front 168 : : * before the trajectory sets are calculated. 169 : : * Therefore, this parameter value ensures the ego to be able to brake and keep a distance 170 : : * of min_longitudinal_safety_distance to the dangerous object or intersection area. 171 : : */ 172 : : ::ad::physics::Distance min_longitudinal_safety_distance{0.0}; 173 : : }; 174 : : 175 : : } // namespace world 176 : : } // namespace rss 177 : : } // namespace ad 178 : : 179 : : /*! 180 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 181 : : */ 182 : : #ifndef GEN_GUARD_AD_RSS_WORLD_RSSDYNAMICS 183 : : #define GEN_GUARD_AD_RSS_WORLD_RSSDYNAMICS 184 : : /*! 185 : : * @brief namespace ad 186 : : */ 187 : : namespace ad { 188 : : /*! 189 : : * @brief namespace rss 190 : : */ 191 : : namespace rss { 192 : : /*! 193 : : * @brief namespace world 194 : : */ 195 : : namespace world { 196 : : 197 : : /** 198 : : * \brief standard ostream operator 199 : : * 200 : : * \param[in] os The output stream to write to 201 : : * \param[in] _value RssDynamics value 202 : : * 203 : : * \returns The stream object. 204 : : * 205 : : */ 206 : 26 : inline std::ostream &operator<<(std::ostream &os, RssDynamics const &_value) 207 : : { 208 : 26 : os << "RssDynamics("; 209 : 26 : os << "alpha_lon:"; 210 : 26 : os << _value.alpha_lon; 211 : 26 : os << ","; 212 : 26 : os << "alpha_lat:"; 213 : 26 : os << _value.alpha_lat; 214 : 26 : os << ","; 215 : 26 : os << "lateral_fluctuation_margin:"; 216 : 26 : os << _value.lateral_fluctuation_margin; 217 : 26 : os << ","; 218 : 26 : os << "response_time:"; 219 : 26 : os << _value.response_time; 220 : 26 : os << ","; 221 : 26 : os << "max_speed_on_acceleration:"; 222 : 26 : os << _value.max_speed_on_acceleration; 223 : 26 : os << ","; 224 : 26 : os << "unstructured_settings:"; 225 : 26 : os << _value.unstructured_settings; 226 : 26 : os << ","; 227 : 26 : os << "min_longitudinal_safety_distance:"; 228 : 26 : os << _value.min_longitudinal_safety_distance; 229 : 26 : os << ")"; 230 : 26 : return os; 231 : : } 232 : : 233 : : } // namespace world 234 : : } // namespace rss 235 : : } // namespace ad 236 : : 237 : : namespace std { 238 : : /*! 239 : : * \brief overload of the std::to_string for RssDynamics 240 : : */ 241 : 1 : inline std::string to_string(::ad::rss::world::RssDynamics const &value) 242 : : { 243 [ + - ]: 1 : stringstream sstream; 244 [ + - ]: 1 : sstream << value; 245 [ + - ]: 2 : return sstream.str(); 246 : 1 : } 247 : : } // namespace std 248 : : 249 : : /*! 250 : : * \brief overload of fmt::formatter calling std::to_string 251 : : */ 252 : : template <> struct fmt::formatter<::ad::rss::world::RssDynamics> : formatter<string_view> 253 : : { 254 : 0 : template <typename FormatContext> auto format(::ad::rss::world::RssDynamics const &value, FormatContext &ctx) 255 : : { 256 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 257 : : } 258 : : }; 259 : : 260 : : #endif // GEN_GUARD_AD_RSS_WORLD_RSSDYNAMICS