LCOV - code coverage report
Current view: top level - generated/include/ad/rss/map - RssObjectDataOnRoute.hpp (source / functions) Hit Total Coverage
Test: ad_rss_map_integration Lines: 84 84 100.0 %
Date: 2025-07-22 06:56:19 Functions: 6 6 100.0 %
Branches: 39 42 92.9 %

           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/Distance.hpp"
      28                 :            : #include "ad/physics/Speed.hpp"
      29                 :            : /*!
      30                 :            :  * @brief namespace ad
      31                 :            :  */
      32                 :            : namespace ad {
      33                 :            : /*!
      34                 :            :  * @brief namespace rss
      35                 :            :  */
      36                 :            : namespace rss {
      37                 :            : /*!
      38                 :            :  * @brief namespace map
      39                 :            :  */
      40                 :            : namespace map {
      41                 :            : 
      42                 :            : /*!
      43                 :            :  * \brief DataType RssObjectDataOnRoute
      44                 :            :  *
      45                 :            :  * Object Data in respect to the respective route.
      46                 :            :  * Especially the speed of the object is split into lateral and longitudinal components
      47                 :            :  * according to the objects projection onto the route
      48                 :            :  */
      49                 :            : struct RssObjectDataOnRoute
      50                 :            : {
      51                 :            :   /*!
      52                 :            :    * \brief Smart pointer on RssObjectDataOnRoute
      53                 :            :    */
      54                 :            :   typedef std::shared_ptr<RssObjectDataOnRoute> Ptr;
      55                 :            : 
      56                 :            :   /*!
      57                 :            :    * \brief Smart pointer on constant RssObjectDataOnRoute
      58                 :            :    */
      59                 :            :   typedef std::shared_ptr<RssObjectDataOnRoute const> ConstPtr;
      60                 :            : 
      61                 :            :   /*!
      62                 :            :    * \brief standard constructor
      63                 :            :    */
      64                 :        549 :   RssObjectDataOnRoute() = default;
      65                 :            : 
      66                 :            :   /*!
      67                 :            :    * \brief standard destructor
      68                 :            :    */
      69                 :            :   ~RssObjectDataOnRoute() = default;
      70                 :            : 
      71                 :            :   /*!
      72                 :            :    * \brief standard copy constructor
      73                 :            :    */
      74                 :            :   RssObjectDataOnRoute(const RssObjectDataOnRoute &other) = default;
      75                 :            : 
      76                 :            :   /*!
      77                 :            :    * \brief standard move constructor
      78                 :            :    */
      79                 :            :   RssObjectDataOnRoute(RssObjectDataOnRoute &&other) = default;
      80                 :            : 
      81                 :            :   /**
      82                 :            :    * \brief standard assignment operator
      83                 :            :    *
      84                 :            :    * \param[in] other Other RssObjectDataOnRoute
      85                 :            :    *
      86                 :            :    * \returns Reference to this RssObjectDataOnRoute.
      87                 :            :    */
      88                 :            :   RssObjectDataOnRoute &operator=(const RssObjectDataOnRoute &other) = default;
      89                 :            : 
      90                 :            :   /**
      91                 :            :    * \brief standard move operator
      92                 :            :    *
      93                 :            :    * \param[in] other Other RssObjectDataOnRoute
      94                 :            :    *
      95                 :            :    * \returns Reference to this RssObjectDataOnRoute.
      96                 :            :    */
      97                 :            :   RssObjectDataOnRoute &operator=(RssObjectDataOnRoute &&other) = default;
      98                 :            : 
      99                 :            :   /**
     100                 :            :    * \brief standard comparison operator
     101                 :            :    *
     102                 :            :    * \param[in] other Other RssObjectDataOnRoute
     103                 :            :    *
     104                 :            :    * \returns \c true if both RssObjectDataOnRoute are equal
     105                 :            :    */
     106                 :         74 :   bool operator==(const RssObjectDataOnRoute &other) const
     107                 :            :   {
     108         [ +  + ]:        144 :     return (route_heading == other.route_heading) && (route_radius == other.route_radius)
     109   [ +  +  +  + ]:         68 :       && (route_heading_delta == other.route_heading_delta) && (route_speed_lat == other.route_speed_lat)
     110   [ +  +  +  + ]:         64 :       && (route_speed_lon == other.route_speed_lon) && (object_center_within_route == other.object_center_within_route)
     111         [ +  + ]:         60 :       && (object_within_route == other.object_within_route)
     112         [ +  + ]:         58 :       && (object_center_position_projected_on_route == other.object_center_position_projected_on_route)
     113   [ +  +  +  + ]:         56 :       && (is_valid == other.is_valid) && (object_center_distance_to_route == other.object_center_distance_to_route)
     114                 :         52 :       && (object_center_position_projected_on_lane_in_nominal_route_direction
     115         [ +  + ]:         52 :           == other.object_center_position_projected_on_lane_in_nominal_route_direction)
     116         [ +  + ]:         50 :       && (object_center_distance_along_route == other.object_center_distance_along_route)
     117                 :         48 :       && (nominal_center_position_of_lane_in_nominal_route_direction
     118         [ +  + ]:         48 :           == other.nominal_center_position_of_lane_in_nominal_route_direction)
     119         [ +  + ]:         46 :       && (object_route_section_front_left == other.object_route_section_front_left)
     120         [ +  + ]:         44 :       && (object_route_section_front_right == other.object_route_section_front_right)
     121         [ +  + ]:         42 :       && (object_route_section_back_left == other.object_route_section_back_left)
     122         [ +  + ]:         40 :       && (object_route_section_back_right == other.object_route_section_back_right)
     123   [ +  +  +  + ]:        144 :       && (object_turning_center == other.object_turning_center);
     124                 :            :   }
     125                 :            : 
     126                 :            :   /**
     127                 :            :    * \brief standard comparison operator
     128                 :            :    *
     129                 :            :    * \param[in] other Other RssObjectDataOnRoute.
     130                 :            :    *
     131                 :            :    * \returns \c true if both RssObjectDataOnRoute are different
     132                 :            :    */
     133                 :         19 :   bool operator!=(const RssObjectDataOnRoute &other) const
     134                 :            :   {
     135                 :         19 :     return !operator==(other);
     136                 :            :   }
     137                 :            : 
     138                 :            :   /*!
     139                 :            :    * the considered heading of the route
     140                 :            :    */
     141                 :            :   ::ad::map::point::ENUHeading route_heading{6.28318530718};
     142                 :            : 
     143                 :            :   /*!
     144                 :            :    * The considered radius of the route.
     145                 :            :    */
     146                 :            :   ::ad::physics::Distance route_radius;
     147                 :            : 
     148                 :            :   /*!
     149                 :            :    * the considered heading delta of the object in respect to the route
     150                 :            :    */
     151                 :            :   ::ad::physics::Angle route_heading_delta{0.0};
     152                 :            : 
     153                 :            :   /*!
     154                 :            :    * The signed speed component in lateral route direction.
     155                 :            :    */
     156                 :            :   ::ad::physics::Speed route_speed_lat;
     157                 :            : 
     158                 :            :   /*!
     159                 :            :    * The signed speed component in longitudinal route direction.
     160                 :            :    * The speed component is negative if the object moves in counter direction of the
     161                 :            :    * route.
     162                 :            :    */
     163                 :            :   ::ad::physics::Speed route_speed_lon;
     164                 :            : 
     165                 :            :   /*!
     166                 :            :    * flag indicating if the object center is within the bounds of the route
     167                 :            :    */
     168                 :            :   bool object_center_within_route{false};
     169                 :            : 
     170                 :            :   /*!
     171                 :            :    * flag indicating if the object is within the bounds of the route
     172                 :            :    */
     173                 :            :   bool object_within_route{false};
     174                 :            : 
     175                 :            :   /*!
     176                 :            :    * The objects projected position onto the route.
     177                 :            :    */
     178                 :            :   ::ad::map::point::ENUPoint object_center_position_projected_on_route;
     179                 :            : 
     180                 :            :   /*!
     181                 :            :    * Is the data valid
     182                 :            :    */
     183                 :            :   bool is_valid{false};
     184                 :            : 
     185                 :            :   /*!
     186                 :            :    * The distance of the object center towards the route. This is zero if the object center is within the route.
     187                 :            :    */
     188                 :            :   ::ad::physics::Distance object_center_distance_to_route{0.0};
     189                 :            : 
     190                 :            :   /*!
     191                 :            :    * The objects center position projected onto a lane in nominal route direction of
     192                 :            :    * the route.
     193                 :            :    * If object_center_position_projected_on_route is on a lane in nominal route direction
     194                 :            :    * these two are equal.
     195                 :            :    */
     196                 :            :   ::ad::map::point::ENUPoint object_center_position_projected_on_lane_in_nominal_route_direction;
     197                 :            : 
     198                 :            :   /*!
     199                 :            :    * The distance along the route towards the projected object center position.
     200                 :            :    * Remark: This distance doesn't provide the actual distance along the route from an
     201                 :            :    * ego vehicle route towards an object:
     202                 :            :    * 1. The ego route ususally starts at the back of the ego vehicle
     203                 :            :    * 2. The object's center position is taken into account
     204                 :            :    */
     205                 :            :   ::ad::physics::Distance object_center_distance_along_route{0.0};
     206                 :            : 
     207                 :            :   /*!
     208                 :            :    * The nominal center point of the  lane  in nominal route direction of the route the objects center position is
     209                 :            :    * projected onto.
     210                 :            :    */
     211                 :            :   ::ad::map::point::ENUPoint nominal_center_position_of_lane_in_nominal_route_direction;
     212                 :            : 
     213                 :            :   /*!
     214                 :            :    * The front left point of the route section around the vehicle.
     215                 :            :    */
     216                 :            :   ::ad::map::point::ENUPoint object_route_section_front_left;
     217                 :            : 
     218                 :            :   /*!
     219                 :            :    * The front right point of the route section around the vehicle.
     220                 :            :    */
     221                 :            :   ::ad::map::point::ENUPoint object_route_section_front_right;
     222                 :            : 
     223                 :            :   /*!
     224                 :            :    * The back left point of the route section around the vehicle.
     225                 :            :    */
     226                 :            :   ::ad::map::point::ENUPoint object_route_section_back_left;
     227                 :            : 
     228                 :            :   /*!
     229                 :            :    * The back right point of the route section around the vehicle.
     230                 :            :    */
     231                 :            :   ::ad::map::point::ENUPoint object_route_section_back_right;
     232                 :            : 
     233                 :            :   /*!
     234                 :            :    * The center point of the virtual circle the object is driving
     235                 :            :    */
     236                 :            :   ::ad::map::point::ENUPoint object_turning_center;
     237                 :            : };
     238                 :            : 
     239                 :            : } // namespace map
     240                 :            : } // namespace rss
     241                 :            : } // namespace ad
     242                 :            : 
     243                 :            : /*!
     244                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     245                 :            :  */
     246                 :            : #ifndef GEN_GUARD_AD_RSS_MAP_RSSOBJECTDATAONROUTE
     247                 :            : #define GEN_GUARD_AD_RSS_MAP_RSSOBJECTDATAONROUTE
     248                 :            : /*!
     249                 :            :  * @brief namespace ad
     250                 :            :  */
     251                 :            : namespace ad {
     252                 :            : /*!
     253                 :            :  * @brief namespace rss
     254                 :            :  */
     255                 :            : namespace rss {
     256                 :            : /*!
     257                 :            :  * @brief namespace map
     258                 :            :  */
     259                 :            : namespace map {
     260                 :            : 
     261                 :            : /**
     262                 :            :  * \brief standard ostream operator
     263                 :            :  *
     264                 :            :  * \param[in] os The output stream to write to
     265                 :            :  * \param[in] _value RssObjectDataOnRoute value
     266                 :            :  *
     267                 :            :  * \returns The stream object.
     268                 :            :  *
     269                 :            :  */
     270                 :         80 : inline std::ostream &operator<<(std::ostream &os, RssObjectDataOnRoute const &_value)
     271                 :            : {
     272                 :         80 :   os << "RssObjectDataOnRoute(";
     273                 :         80 :   os << "route_heading:";
     274                 :         80 :   os << _value.route_heading;
     275                 :         80 :   os << ",";
     276                 :         80 :   os << "route_radius:";
     277                 :         80 :   os << _value.route_radius;
     278                 :         80 :   os << ",";
     279                 :         80 :   os << "route_heading_delta:";
     280                 :         80 :   os << _value.route_heading_delta;
     281                 :         80 :   os << ",";
     282                 :         80 :   os << "route_speed_lat:";
     283                 :         80 :   os << _value.route_speed_lat;
     284                 :         80 :   os << ",";
     285                 :         80 :   os << "route_speed_lon:";
     286                 :         80 :   os << _value.route_speed_lon;
     287                 :         80 :   os << ",";
     288                 :         80 :   os << "object_center_within_route:";
     289                 :         80 :   os << _value.object_center_within_route;
     290                 :         80 :   os << ",";
     291                 :         80 :   os << "object_within_route:";
     292                 :         80 :   os << _value.object_within_route;
     293                 :         80 :   os << ",";
     294                 :         80 :   os << "object_center_position_projected_on_route:";
     295                 :         80 :   os << _value.object_center_position_projected_on_route;
     296                 :         80 :   os << ",";
     297                 :         80 :   os << "is_valid:";
     298                 :         80 :   os << _value.is_valid;
     299                 :         80 :   os << ",";
     300                 :         80 :   os << "object_center_distance_to_route:";
     301                 :         80 :   os << _value.object_center_distance_to_route;
     302                 :         80 :   os << ",";
     303                 :         80 :   os << "object_center_position_projected_on_lane_in_nominal_route_direction:";
     304                 :         80 :   os << _value.object_center_position_projected_on_lane_in_nominal_route_direction;
     305                 :         80 :   os << ",";
     306                 :         80 :   os << "object_center_distance_along_route:";
     307                 :         80 :   os << _value.object_center_distance_along_route;
     308                 :         80 :   os << ",";
     309                 :         80 :   os << "nominal_center_position_of_lane_in_nominal_route_direction:";
     310                 :         80 :   os << _value.nominal_center_position_of_lane_in_nominal_route_direction;
     311                 :         80 :   os << ",";
     312                 :         80 :   os << "object_route_section_front_left:";
     313                 :         80 :   os << _value.object_route_section_front_left;
     314                 :         80 :   os << ",";
     315                 :         80 :   os << "object_route_section_front_right:";
     316                 :         80 :   os << _value.object_route_section_front_right;
     317                 :         80 :   os << ",";
     318                 :         80 :   os << "object_route_section_back_left:";
     319                 :         80 :   os << _value.object_route_section_back_left;
     320                 :         80 :   os << ",";
     321                 :         80 :   os << "object_route_section_back_right:";
     322                 :         80 :   os << _value.object_route_section_back_right;
     323                 :         80 :   os << ",";
     324                 :         80 :   os << "object_turning_center:";
     325                 :         80 :   os << _value.object_turning_center;
     326                 :         80 :   os << ")";
     327                 :         80 :   return os;
     328                 :            : }
     329                 :            : 
     330                 :            : } // namespace map
     331                 :            : } // namespace rss
     332                 :            : } // namespace ad
     333                 :            : 
     334                 :            : namespace std {
     335                 :            : /*!
     336                 :            :  * \brief overload of the std::to_string for RssObjectDataOnRoute
     337                 :            :  */
     338                 :         40 : inline std::string to_string(::ad::rss::map::RssObjectDataOnRoute const &value)
     339                 :            : {
     340         [ +  - ]:         40 :   stringstream sstream;
     341         [ +  - ]:         40 :   sstream << value;
     342         [ +  - ]:         80 :   return sstream.str();
     343                 :         40 : }
     344                 :            : } // namespace std
     345                 :            : 
     346                 :            : /*!
     347                 :            :  * \brief overload of fmt::formatter calling std::to_string
     348                 :            :  */
     349                 :            : template <> struct fmt::formatter<::ad::rss::map::RssObjectDataOnRoute> : formatter<string_view>
     350                 :            : {
     351                 :         39 :   template <typename FormatContext> auto format(::ad::rss::map::RssObjectDataOnRoute const &value, FormatContext &ctx)
     352                 :            :   {
     353                 :         78 :     return formatter<string_view>::format(std::to_string(value), ctx);
     354                 :            :   }
     355                 :            : };
     356                 :            : 
     357                 :            : #endif // GEN_GUARD_AD_RSS_MAP_RSSOBJECTDATAONROUTE

Generated by: LCOV version 1.14