ad_rss_map_integration
RssSceneCreation.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2018-2020 Intel Corporation
4 //
5 // SPDX-License-Identifier: LGPL-2.1-only
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <ad/map/landmark/Types.hpp>
15 #include <ad/map/route/Types.hpp>
17 #include <ad/rss/world/WorldModel.hpp>
18 #include <mutex>
19 #include <ostream>
20 #include <string>
21 
25 namespace ad {
29 namespace rss {
33 namespace map {
34 
35 class RssSceneCreator;
36 class RssObjectConversion;
37 
41 enum class RssMode
42 {
43  NotRelevant,
44  Structured,
46 };
47 
54 {
55 public:
64  RssSceneCreation(::ad::rss::world::TimeIndex const &timeIndex,
65  ::ad::rss::world::RssDynamics const &defaultEgoRssDynamics);
66 
73  {
77  None,
83 
91 
99  };
100 
120  bool appendScenes(RssObjectData const &egoObjectData,
121  ::ad::map::route::FullRoute const &egoRoute,
122  RssObjectData const &otherObjectData,
123  RestrictSpeedLimitMode const &restrictSpeedLimitMode,
124  ::ad::map::landmark::LandmarkIdSet const &greenTrafficLights,
125  ::ad::rss::map::RssMode const &mode);
126 
131  {
135  RouteOnly,
144  };
145 
158  bool appendRoadBoundaries(RssObjectData const &egoObjectData,
159  ::ad::map::route::FullRoute const &route,
160  AppendRoadBoundariesMode const operationMode);
161 
169  ::ad::rss::world::WorldModel getWorldModel();
170 
171 private:
172  friend class RssSceneCreator;
173 
174  bool appendStructuredScenes(::ad::rss::map::RssSceneCreator &sceneCreator,
175  std::shared_ptr<RssObjectConversion const> const &egoObject,
176  ::ad::map::route::FullRoute const &egoRoute,
177  std::shared_ptr<RssObjectConversion const> const &otherObject);
178 
179  bool appendSceneToWorldModel(::ad::rss::world::Scene const &scene);
180 
181  ::ad::rss::world::WorldModel mWorldModel;
182  bool mFinalized;
183  std::mutex mWorldModelLock;
184 };
185 
186 } // namespace map
187 } // namespace rss
188 } // namespace ad
189 
193 namespace std {
194 
199 {
200  switch (value)
201  {
202  case ::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::None:
203  return string("::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::None");
204  case ::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::ExactSpeedLimit:
205  return string("::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::ExactSpeedLimit");
206  case ::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::IncreasedSpeedLimit5:
207  return string("::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::IncreasedSpeedLimit5");
208  case ::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::IncreasedSpeedLimit10:
209  return string("::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::IncreasedSpeedLimit10");
210  default:
211  return string("::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode UNKNOWN ENUM VALUE");
212  }
213 }
214 
224 inline ostream &operator<<(ostream &os, ::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode const &value)
225 {
226  return os << std::to_string(value);
227 }
228 
232 inline string to_string(::ad::rss::map::RssMode const &value)
233 {
234  switch (value)
235  {
236  case ::ad::rss::map::RssMode::NotRelevant:
237  return string("::ad::rss::map::RssMode::NotRelevant");
238  case ::ad::rss::map::RssMode::Structured:
239  return string("::ad::rss::map::RssMode::Structured");
240  case ::ad::rss::map::RssMode::Unstructured:
241  return string("::ad::rss::map::RssMode::Unstructured");
242  default:
243  return string("::ad::rss::map::RssMode UNKNOWN ENUM VALUE");
244  }
245 }
246 
256 inline ostream &operator<<(ostream &os, ::ad::rss::map::RssMode const &value)
257 {
258  return os << to_string(value);
259 }
260 
261 } // namespace std
ad
namespace rss
Definition: Logging.hpp:19
ad::rss::map::RssSceneCreation::getWorldModel
::ad::rss::world::WorldModel getWorldModel()
get the final world model object
std::operator<<
ostream & operator<<(ostream &os, ::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode const &value)
standard ostream operator
Definition: RssSceneCreation.hpp:224
ad::rss::map::RssMode::Unstructured
@ Unstructured
the scene requires unstructured analysis
ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::IncreasedSpeedLimit10
@ IncreasedSpeedLimit10
std::to_string
string to_string(::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode const &value)
overload of the std::to_string for RestrictSpeedLimitMode
Definition: RssSceneCreation.hpp:198
ad::rss::map::RssSceneCreation::appendRoadBoundaries
bool appendRoadBoundaries(RssObjectData const &egoObjectData, ::ad::map::route::FullRoute const &route, AppendRoadBoundariesMode const operationMode)
create scenes between ego vehicle and road boundaries
ad::rss::map::RssSceneCreation::AppendRoadBoundariesMode::ExpandRouteToOppositeLanes
@ ExpandRouteToOppositeLanes
RssObjectData.hpp
ad::rss::map::RssSceneCreation::RssSceneCreation
RssSceneCreation(::ad::rss::world::TimeIndex const &timeIndex, ::ad::rss::world::RssDynamics const &defaultEgoRssDynamics)
create a scene creation object
ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::IncreasedSpeedLimit5
@ IncreasedSpeedLimit5
ad::rss::map::RssSceneCreation::AppendRoadBoundariesMode::RouteOnly
@ RouteOnly
std::to_string
string to_string(::ad::rss::map::RssMode const &value)
overload of the std::to_string for RssMode
Definition: RssSceneCreation.hpp:232
ad::rss::map::RssSceneCreation::appendScenes
bool appendScenes(RssObjectData const &egoObjectData, ::ad::map::route::FullRoute const &egoRoute, RssObjectData const &otherObjectData, RestrictSpeedLimitMode const &restrictSpeedLimitMode, ::ad::map::landmark::LandmarkIdSet const &greenTrafficLights, ::ad::rss::map::RssMode const &mode)
create possible scenes between ego vehicle and the object
ad::rss::map::RssMode::Structured
@ Structured
the scene requires structured analysis
ad::rss::map::RssSceneCreator
class providing support to create and append RSS Scenes
Definition: RssSceneCreator.hpp:39
ad::rss::map::RssMode
RssMode
Specifies the scene mode.
Definition: RssSceneCreation.hpp:41
ad::rss::map::RssSceneCreation::AppendRoadBoundariesMode::ExpandRouteToAllNeighbors
@ ExpandRouteToAllNeighbors
ad::rss::map::RssSceneCreation
class providing supporting functions to create a world model and its scenes.
Definition: RssSceneCreation.hpp:53
ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode
RestrictSpeedLimitMode
enumeration defining the modes of speed limit consideration within RSS accelerated movement.
Definition: RssSceneCreation.hpp:72
ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::ExactSpeedLimit
@ ExactSpeedLimit
ad::rss::map::RssMode::NotRelevant
@ NotRelevant
the scene is not relevant (but should be visible as NotRelvant scene)
ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::None
@ None
ad::rss::map::RssObjectData
struct describing the object input data
Definition: RssObjectData.hpp:34
ad::rss::map::RssSceneCreation::AppendRoadBoundariesMode
AppendRoadBoundariesMode
enumeration defining the operation modes of appendRoadBoundaries() function.
Definition: RssSceneCreation.hpp:130