LCOV - code coverage report
Current view: top level - include/ad/rss/map - RssObjectAdapterData.hpp (source / functions) Hit Total Coverage
Test: ad_rss_map_integration Lines: 21 23 91.3 %
Date: 2025-07-22 06:56:19 Functions: 10 11 90.9 %
Branches: 0 0 -

           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/map/point/ENUHeading.hpp"
      25                 :            : #include "ad/map/point/ENUPoint.hpp"
      26                 :            : #include "ad/physics/Angle.hpp"
      27                 :            : #include "ad/physics/AngularVelocity.hpp"
      28                 :            : #include "ad/physics/Dimension2D.hpp"
      29                 :            : #include "ad/physics/Dimension3D.hpp"
      30                 :            : #include "ad/physics/Probability.hpp"
      31                 :            : #include "ad/physics/SpeedRange.hpp"
      32                 :            : #include "ad/rss/world/ObjectId.hpp"
      33                 :            : #include "ad/rss/world/ObjectType.hpp"
      34                 :            : 
      35                 :            : /*!
      36                 :            :  * @brief namespace ad
      37                 :            :  */
      38                 :            : namespace ad {
      39                 :            : /*!
      40                 :            :  * @brief namespace rss
      41                 :            :  */
      42                 :            : namespace rss {
      43                 :            : /*!
      44                 :            :  * @brief namespace map
      45                 :            :  */
      46                 :            : namespace map {
      47                 :            : 
      48                 :            : /*!
      49                 :            :  * \brief DataType RssObjectAdapterData
      50                 :            :  *
      51                 :            :  * struct describing the object data relevant to inject artificial objects
      52                 :            :  */
      53                 :            : struct RssObjectAdapterData
      54                 :            : {
      55                 :            :   /*!
      56                 :            :    * \brief Smart pointer on RssObjectAdapterData
      57                 :            :    */
      58                 :            :   typedef std::shared_ptr<RssObjectAdapterData> Ptr;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief Smart pointer on constant RssObjectAdapterData
      62                 :            :    */
      63                 :            :   typedef std::shared_ptr<RssObjectAdapterData const> ConstPtr;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard constructor
      67                 :            :    */
      68                 :        441 :   RssObjectAdapterData()
      69                 :        441 :   {
      70                 :            :     // initialize confidence to 'ground truth'  while 0.01 is the minimum what ETSI defines for smalles valid value
      71                 :            :     // SemiAxisLength in ETSI-ITS-CDD.asn standard message descriptions, a value of zero shall not be used
      72                 :        441 :     position_confidence_ellipse_half_axis_dimension.length = ad::physics::Distance(0.01);
      73                 :        441 :     position_confidence_ellipse_half_axis_dimension.width = ad::physics::Distance(0.01);
      74                 :        441 :     position_confidence_ellipse_confidence_level = ad::physics::Probability(1.);
      75                 :        441 :   }
      76                 :            : 
      77                 :            :   /*!
      78                 :            :    * \brief standard destructor
      79                 :            :    */
      80                 :        443 :   virtual ~RssObjectAdapterData() = default;
      81                 :            : 
      82                 :            :   /*!
      83                 :            :    * \brief standard copy constructor
      84                 :            :    */
      85                 :          2 :   RssObjectAdapterData(const RssObjectAdapterData &other) = default;
      86                 :            : 
      87                 :            :   /*!
      88                 :            :    * \brief standard move constructor
      89                 :            :    */
      90                 :            :   RssObjectAdapterData(RssObjectAdapterData &&other) = default;
      91                 :            : 
      92                 :            :   /**
      93                 :            :    * \brief standard assignment operator
      94                 :            :    *
      95                 :            :    * \param[in] other Other RssObjectAdapterData
      96                 :            :    *
      97                 :            :    * \returns Reference to this RssObjectAdapterData.
      98                 :            :    */
      99                 :          2 :   RssObjectAdapterData &operator=(const RssObjectAdapterData &other) = default;
     100                 :            : 
     101                 :            :   /**
     102                 :            :    * \brief standard move operator
     103                 :            :    *
     104                 :            :    * \param[in] other Other RssObjectAdapterData
     105                 :            :    *
     106                 :            :    * \returns Reference to this RssObjectAdapterData.
     107                 :            :    */
     108                 :            :   RssObjectAdapterData &operator=(RssObjectAdapterData &&other) = default;
     109                 :            : 
     110                 :            :   /**
     111                 :            :    * \brief standard comparison operator
     112                 :            :    *
     113                 :            :    * \param[in] other Other RssObjectAdapterData
     114                 :            :    *
     115                 :            :    * \returns \c true if both RssObjectAdapterData are equal
     116                 :            :    */
     117                 :            :   bool operator==(const RssObjectAdapterData &other) const
     118                 :            :   {
     119                 :            :     return (id == other.id) && (object_type == other.object_type) && (center_point == other.center_point)
     120                 :            :       && (position_confidence_ellipse_half_axis_dimension == other.position_confidence_ellipse_half_axis_dimension)
     121                 :            :       && (position_confidence_ellipse_confidence_level == other.position_confidence_ellipse_confidence_level)
     122                 :            :       && (heading == other.heading) && (dimension == other.dimension) && (speed_range == other.speed_range)
     123                 :            :       && (yaw_rate == other.yaw_rate) && (steering_angle == other.steering_angle);
     124                 :            :   }
     125                 :            : 
     126                 :            :   /**
     127                 :            :    * \brief standard comparison operator
     128                 :            :    *
     129                 :            :    * \param[in] other Other RssObjectAdapterData.
     130                 :            :    *
     131                 :            :    * \returns \c true if both RssObjectAdapterData are different
     132                 :            :    */
     133                 :            :   bool operator!=(const RssObjectAdapterData &other) const
     134                 :            :   {
     135                 :            :     return !operator==(other);
     136                 :            :   }
     137                 :            : 
     138                 :            :   /*! @brief get the id of the object
     139                 :            :    */
     140                 :        761 :   ::ad::rss::world::ObjectId getObjectId() const
     141                 :            :   {
     142                 :        761 :     return id;
     143                 :            :   }
     144                 :            : 
     145                 :            :   /*! @brief get the type of the object
     146                 :            :    */
     147                 :            :   ::ad::rss::world::ObjectType getObjectType() const
     148                 :            :   {
     149                 :            :     return object_type;
     150                 :            :   }
     151                 :            : 
     152                 :            :   /*! @brief get the center point of the object
     153                 :            :    */
     154                 :        607 :   ::ad::map::point::ENUPoint getCenterPoint() const
     155                 :            :   {
     156                 :        607 :     return center_point;
     157                 :            :   }
     158                 :            : 
     159                 :            :   /*! @brief get the position confidence of the center point
     160                 :            :    */
     161                 :            :   ::ad::physics::Dimension2D getPositionConfidence() const
     162                 :            :   {
     163                 :            :     return position_confidence_ellipse_half_axis_dimension;
     164                 :            :   }
     165                 :            : 
     166                 :            :   /*! @brief get the position confidence level of the center point
     167                 :            :    */
     168                 :            :   ::ad::physics::Probability getPositionConfidenceLevel() const
     169                 :            :   {
     170                 :            :     return position_confidence_ellipse_confidence_level;
     171                 :            :   }
     172                 :            : 
     173                 :            :   /*! @brief get the heading of the object
     174                 :            :    */
     175                 :        607 :   ::ad::map::point::ENUHeading getHeading() const
     176                 :            :   {
     177                 :        607 :     return heading;
     178                 :            :   }
     179                 :            : 
     180                 :            :   /*! @brief get the dimensions of the object to be considered
     181                 :            :    */
     182                 :          0 :   virtual ::ad::physics::Dimension3D getDimensions() const
     183                 :            :   {
     184                 :          0 :     return dimension;
     185                 :            :   }
     186                 :            : 
     187                 :            :   /*! @brief get the speed of the object
     188                 :            :    */
     189                 :        455 :   ::ad::physics::SpeedRange getSpeedRange() const
     190                 :            :   {
     191                 :        455 :     return speed_range;
     192                 :            :   }
     193                 :            : 
     194                 :            :   /*! @brief get the change of the heading (which is the yaw rate) of the object
     195                 :            :    */
     196                 :        455 :   ::ad::physics::AngularVelocity getYawRate() const
     197                 :            :   {
     198                 :        455 :     return yaw_rate;
     199                 :            :   }
     200                 :            : 
     201                 :            :   /*! @brief get the steering angle of the vehicle. Might be invalid if not available.
     202                 :            :    */
     203                 :        455 :   ::ad::physics::Angle getSteeringAngle() const
     204                 :            :   {
     205                 :        455 :     return steering_angle;
     206                 :            :   }
     207                 :            : 
     208                 :            :   /*!
     209                 :            :    * the object id
     210                 :            :    */
     211                 :            :   ::ad::rss::world::ObjectId id{0};
     212                 :            : 
     213                 :            :   /*!
     214                 :            :    * The objects type.
     215                 :            :    */
     216                 :            :   ::ad::rss::world::ObjectType object_type{::ad::rss::world::ObjectType::Invalid};
     217                 :            : 
     218                 :            :   /*!
     219                 :            :    * the object's position in ENU coordinates
     220                 :            :    */
     221                 :            :   ::ad::map::point::ENUPoint center_point;
     222                 :            : 
     223                 :            :   // Indicates the position confidence value which represents the estimated absolute position accuracy, in the
     224                 :            :   // respective axis direction as defined in a shape of ellipse with a confidence level of
     225                 :            :   // mPositionConfidenceEllipseConfidence. the value represents the half axis length and is added to the respective
     226                 :            :   // vehicle dimensions in RSS calcualation
     227                 :            :   ::ad::physics::Dimension2D position_confidence_ellipse_half_axis_dimension;
     228                 :            :   ::ad::physics::Probability position_confidence_ellipse_confidence_level;
     229                 :            : 
     230                 :            :   /*!
     231                 :            :    * The objects heading in ENU coordinate system as angle measured from East to North axis (yaw) in radians.
     232                 :            :    */
     233                 :            :   ::ad::map::point::ENUHeading heading{std::numeric_limits<double>::quiet_NaN()};
     234                 :            : 
     235                 :            :   /*!
     236                 :            :    * the dimension of the object
     237                 :            :    */
     238                 :            :   ::ad::physics::Dimension3D dimension;
     239                 :            : 
     240                 :            :   /*!
     241                 :            :    * the object's speed
     242                 :            :    */
     243                 :            :   ::ad::physics::SpeedRange speed_range;
     244                 :            : 
     245                 :            :   /*!
     246                 :            :    * the object's yaw rate
     247                 :            :    */
     248                 :            :   ::ad::physics::AngularVelocity yaw_rate;
     249                 :            : 
     250                 :            :   /*!
     251                 :            :    * the ego vehicles' steering angle, if available
     252                 :            :    *
     253                 :            :    * If the steering angle is not available, this field is left invalid. (see ::ad::physics::Angle::isValid())
     254                 :            :    *
     255                 :            :    * The steering angle is especially relevant for unstructured constellations to be able to decide if the steering
     256                 :            :    * angle of the ego vehicle is in the allowed range for drive away. Otherwise that cannot be decided.
     257                 :            :    */
     258                 :            :   ::ad::physics::Angle steering_angle{std::numeric_limits<double>::quiet_NaN()};
     259                 :            : };
     260                 :            : 
     261                 :            : } // namespace map
     262                 :            : } // namespace rss
     263                 :            : } // namespace ad
     264                 :            : 
     265                 :            : /*!
     266                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     267                 :            :  */
     268                 :            : #ifndef GEN_GUARD_AD_RSS_MAP_RSSObjectAdapterData
     269                 :            : #define GEN_GUARD_AD_RSS_MAP_RSSObjectAdapterData
     270                 :            : /*!
     271                 :            :  * @brief namespace ad
     272                 :            :  */
     273                 :            : namespace ad {
     274                 :            : /*!
     275                 :            :  * @brief namespace rss
     276                 :            :  */
     277                 :            : namespace rss {
     278                 :            : /*!
     279                 :            :  * @brief namespace map
     280                 :            :  */
     281                 :            : namespace map {
     282                 :            : 
     283                 :            : /**
     284                 :            :  * \brief standard ostream operator
     285                 :            :  *
     286                 :            :  * \param[in] os The output stream to write to
     287                 :            :  * \param[in] _value RssObjectAdapterData value
     288                 :            :  *
     289                 :            :  * \returns The stream object.
     290                 :            :  *
     291                 :            :  */
     292                 :            : inline std::ostream &operator<<(std::ostream &os, RssObjectAdapterData const &_value)
     293                 :            : {
     294                 :            :   os << "RssObjectAdapterData(";
     295                 :            :   os << "id:";
     296                 :            :   os << _value.id;
     297                 :            :   os << ",";
     298                 :            :   os << "object_type:";
     299                 :            :   os << _value.object_type;
     300                 :            :   os << ",";
     301                 :            :   os << "center_point:";
     302                 :            :   os << _value.center_point;
     303                 :            :   os << ",";
     304                 :            :   os << "center_point_confidence:";
     305                 :            :   os << _value.position_confidence_ellipse_half_axis_dimension;
     306                 :            :   os << ",";
     307                 :            :   os << "center_point_confidence_level:";
     308                 :            :   os << _value.position_confidence_ellipse_confidence_level;
     309                 :            :   os << ",";
     310                 :            :   os << "heading:";
     311                 :            :   os << _value.heading;
     312                 :            :   os << ",";
     313                 :            :   os << "dimension:";
     314                 :            :   os << _value.dimension;
     315                 :            :   os << ",";
     316                 :            :   os << "speed_range:";
     317                 :            :   os << _value.speed_range;
     318                 :            :   os << ",";
     319                 :            :   os << "yaw_rate:";
     320                 :            :   os << _value.yaw_rate;
     321                 :            :   os << ",";
     322                 :            :   os << "steering_angle:";
     323                 :            :   os << _value.steering_angle;
     324                 :            :   os << ")";
     325                 :            :   return os;
     326                 :            : }
     327                 :            : 
     328                 :            : } // namespace map
     329                 :            : } // namespace rss
     330                 :            : } // namespace ad
     331                 :            : 
     332                 :            : namespace std {
     333                 :            : /*!
     334                 :            :  * \brief overload of the std::to_string for RssObjectAdapterData
     335                 :            :  */
     336                 :            : inline std::string to_string(::ad::rss::map::RssObjectAdapterData const &value)
     337                 :            : {
     338                 :            :   stringstream sstream;
     339                 :            :   sstream << value;
     340                 :            :   return sstream.str();
     341                 :            : }
     342                 :            : } // namespace std
     343                 :            : 
     344                 :            : /*!
     345                 :            :  * \brief overload of fmt::formatter calling std::to_string
     346                 :            :  */
     347                 :            : template <> struct fmt::formatter<::ad::rss::map::RssObjectAdapterData> : formatter<string_view>
     348                 :            : {
     349                 :            :   template <typename FormatContext> auto format(::ad::rss::map::RssObjectAdapterData const &value, FormatContext &ctx)
     350                 :            :   {
     351                 :            :     return formatter<string_view>::format(std::to_string(value), ctx);
     352                 :            :   }
     353                 :            : };
     354                 :            : #endif // GEN_GUARD_AD_RSS_MAP_RSSObjectAdapterData

Generated by: LCOV version 1.14