ad_rss_map_integration
RssObjectConversion.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2018-2021 Intel Corporation
4 //
5 // SPDX-License-Identifier: LGPL-2.1-only
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
15 
16 #include <ad/map/route/FullRoute.hpp>
17 #include <memory>
18 
22 namespace ad {
26 namespace rss {
30 namespace map {
31 
36 {
37 public:
41  using Ptr = std::shared_ptr<RssObjectConversion>;
42 
46  using ConstPtr = std::shared_ptr<RssObjectConversion const>;
47 
53  explicit RssObjectConversion(RssObjectData const &objectData);
54 
61  RssObjectConversion(RssObjectData const &objectData,
62  ::ad::rss::world::OccupiedRegionVector const &objectOccupiedRegions);
63 
67  RssObjectConversion(const RssObjectConversion &other) = default;
68 
72  RssObjectConversion(RssObjectConversion &&other) = default;
73 
77  ~RssObjectConversion() = default;
78 
82  RssObjectConversion &operator=(const RssObjectConversion &other) = delete;
83 
88 
94  ::ad::rss::world::RssDynamics getRssDynamics() const;
95 
101  ::ad::rss::world::Object const &getRssObject() const;
102 
104  ::ad::rss::world::ObjectId getId() const;
105 
110  bool calculateMinStoppingDistance(::ad::physics::Distance &minStoppingDistance) const;
111 
114  void updateSpeedLimit(::ad::physics::Speed const &maxSpeedOnAcceleration);
115 
118  void laneIntervalAdded(::ad::map::route::LaneInterval const &laneInterval);
119 
122  void updateVelocityOnRoute(::ad::map::route::FullRoute const &route);
123 
126  ::ad::map::match::Object const *getObjectMapMatchedPosition() const
127  {
128  return mObjectMapMatchedPosition;
129  }
130 
148  bool isOriginalSpeedAcceptable(::ad::physics::Speed const acceptableNegativeSpeed = ::ad::physics::Speed(-0.5)) const;
149 
153  ::ad::physics::Speed const &getOriginalObjectSpeed() const
154  {
155  return mOriginalObjectSpeed;
156  }
157 
158 private:
159  ::ad::rss::world::Object mRssObject;
160  ::ad::map::match::Object const *mObjectMapMatchedPosition;
161  ::ad::physics::Speed mMaxSpeedOnAcceleration;
162  ::ad::physics::Speed const mOriginalObjectSpeed;
163  ::ad::rss::world::RssDynamics const &mRssDynamics;
164 
165  void initializeRssObject(::ad::rss::world::ObjectId const &objectId,
166  ::ad::rss::world::ObjectType const &objectType,
167  ::ad::rss::world::OccupiedRegionVector const &objectOccupiedRegions,
168  ::ad::map::match::ENUObjectPosition const &objectEnuPosition,
169  ::ad::physics::Speed const &objectSpeed,
170  ::ad::physics::AngularVelocity const &objectYawRate,
171  ::ad::physics::Angle const &objectSteeringAngle);
172 
173  void addRestrictedOccupiedRegion(::ad::map::match::LaneOccupiedRegion const &laneOccupiedRegion,
174  ::ad::map::route::LaneInterval const &laneInterval);
175 };
176 
177 } // namespace map
178 } // namespace rss
179 } // namespace ad
ad
namespace ad
Definition: Logging.hpp:19
ad::rss::map::RssObjectConversion::updateVelocityOnRoute
void updateVelocityOnRoute(::ad::map::route::FullRoute const &route)
update the objects current velocity on the route
ad::rss::map::RssObjectConversion::getRssObject
const ::ad::rss::world::Object & getRssObject() const
ad::rss::map::RssObjectConversion
class providing support to convert ad::map objects into ad::rss objects
Definition: RssObjectConversion.hpp:35
ad::rss::map::RssObjectConversion::laneIntervalAdded
void laneIntervalAdded(::ad::map::route::LaneInterval const &laneInterval)
lane interval was added to the object route, so append relevant occupied regions
ad::rss::map::RssObjectConversion::operator=
RssObjectConversion & operator=(const RssObjectConversion &other)=delete
delete standard assignment operator
ad::rss::map::RssObjectConversion::updateSpeedLimit
void updateSpeedLimit(::ad::physics::Speed const &maxSpeedOnAcceleration)
update the max speed content
RssObjectData.hpp
ad::rss::map::RssObjectConversion::Ptr
std::shared_ptr< RssObjectConversion > Ptr
Smart pointer on RssObjectConversion.
Definition: RssObjectConversion.hpp:41
ad::rss::map::RssObjectConversion::getObjectMapMatchedPosition
const ::ad::map::match::Object * getObjectMapMatchedPosition() const
return the map matched position object this was created with (might be nullptr)
Definition: RssObjectConversion.hpp:126
ad::rss::map::RssObjectConversion::getRssDynamics
::ad::rss::world::RssDynamics getRssDynamics() const
ad::rss::map::RssObjectConversion::RssObjectConversion
RssObjectConversion(RssObjectData const &objectData)
constructor
ad::rss::map::RssObjectConversion::isOriginalSpeedAcceptable
bool isOriginalSpeedAcceptable(::ad::physics::Speed const acceptableNegativeSpeed=::ad::physics::Speed(-0.5)) const
check if the original input speed is in acceptable range
ad::rss::map::RssObjectConversion::ConstPtr
std::shared_ptr< RssObjectConversion const > ConstPtr
Smart pointer on constant RssObjectConversion.
Definition: RssObjectConversion.hpp:46
ad::rss::map::RssObjectConversion::~RssObjectConversion
~RssObjectConversion()=default
standard destructor
ad::rss::map::RssObjectConversion::getOriginalObjectSpeed
const ::ad::physics::Speed & getOriginalObjectSpeed() const
Definition: RssObjectConversion.hpp:153
ad::rss::map::RssObjectConversion::getId
::ad::rss::world::ObjectId getId() const
ad::rss::map::RssObjectData
struct describing the object input data
Definition: RssObjectData.hpp:34
ad::rss::map::RssObjectConversion::calculateMinStoppingDistance
bool calculateMinStoppingDistance(::ad::physics::Distance &minStoppingDistance) const