ad_map_access
AdMapFactory.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2019-2021 Intel Corporation
4 //
5 // SPDX-License-Identifier: MIT
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <opendrive/types.hpp>
15 #include <string>
16 
20 
22 namespace ad {
24 namespace map {
26 namespace opendrive {
27 
38 {
39 public:
40  explicit AdMapFactory(access::Store &store);
41 
42  AdMapFactory() = delete;
43  AdMapFactory(AdMapFactory const &) = delete;
44  AdMapFactory(AdMapFactory const &&) = delete;
45  AdMapFactory &operator=(AdMapFactory &&) = delete;
46  AdMapFactory &operator=(AdMapFactory const &) = delete;
47 
57  bool createAdMap(std::string const &mapFilePath,
58  double const overlapMargin,
59  intersection::IntersectionType const defaultIntersectionType,
60  landmark::TrafficLightType const defaultTrafficLightType
62 
73  bool createAdMapFromString(std::string const &mapContent,
74  double const overlapMargin,
75  intersection::IntersectionType const defaultIntersectionType,
76  landmark::TrafficLightType const defaultTrafficLightType
78 
84  static bool isOpenDriveMap(std::string const &mapName);
85 
86 private:
96  bool createAdMap(::opendrive::OpenDriveData &openDriveData,
97  double const overlapMargin,
98  intersection::IntersectionType const defaultIntersectionType,
99  landmark::TrafficLightType const defaultTrafficLightType);
100 
109  bool convertToAdMap(::opendrive::OpenDriveData &mapData,
110  intersection::IntersectionType const defaultIntersectionType,
111  landmark::TrafficLightType const defaultTrafficLightType);
112 
116  restriction::Restrictions createRoadRestrictions() const;
117 
123  bool setLaneSpeed(::opendrive::Lane const &lane);
124 
130  bool addLandmark(::opendrive::Landmark const &landmark);
131 
137  bool addLane(::opendrive::Lane const &lane);
138 
146  bool addSpecialContact(::opendrive::Lane const &lane,
147  ::opendrive::Landmark const &landmark,
148  lane::ContactLocation const &location);
149 
155  bool isDrivableLane(lane::LaneType laneType) const;
156 
163  bool addSpecialContacts(::opendrive::Lane const &lane, ::opendrive::LandmarkMap const &landmarks);
164 
173  bool addContactLanes(::opendrive::Lane const &lane,
174  intersection::IntersectionType const defaultIntersectionType,
175  landmark::TrafficLightType const defaultTrafficLightType);
176 };
177 
178 } // namespace opendrive
179 } // namespace map
180 } // namespace ad
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::access::Store
Autonomus Driving Map Store.
Definition: Store.hpp:40
ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN
@ SOLID_RED_YELLOW_GREEN
ad::map::restriction::Restrictions
DataType Restrictions.
Definition: Restrictions.hpp:42
Types.hpp
ad::map::lane::ContactLocation
ContactLocation
DataType ContactLocation.
Definition: ContactLocation.hpp:43
ad::map::opendrive::AdMapFactory::createAdMapFromString
bool createAdMapFromString(std::string const &mapContent, double const overlapMargin, intersection::IntersectionType const defaultIntersectionType, landmark::TrafficLightType const defaultTrafficLightType=landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN)
Parses OpenDRIVE map content string, generates a lane map and populates the AdMap store with it via a...
ad::map::opendrive::AdMapFactory::createAdMap
bool createAdMap(std::string const &mapFilePath, double const overlapMargin, intersection::IntersectionType const defaultIntersectionType, landmark::TrafficLightType const defaultTrafficLightType=landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN)
Reads the OpenDRIVE map xml, generates a lane map and populates the AdMap store with it via admap Fac...
Factory.hpp
ad::map::landmark::TrafficLightType
TrafficLightType
DataType TrafficLightType.
Definition: TrafficLightType.hpp:43
ad::map::opendrive::AdMapFactory::isOpenDriveMap
static bool isOpenDriveMap(std::string const &mapName)
Returns true if the given file matches an OpenDRIVE map file.
ad::map::intersection::IntersectionType
IntersectionType
DataType IntersectionType.
Definition: IntersectionType.hpp:43
Types.hpp
ad::map::opendrive::AdMapFactory
Creates an AdMap from an OpenDRIVE map file.
Definition: AdMapFactory.hpp:37
ad::map::access::Factory
Autonomus Driving Map Factory. Contains method to be used to initialize and modify content in the Sto...
Definition: Factory.hpp:36
ad::map::lane::LaneType
LaneType
DataType LaneType.
Definition: LaneType.hpp:43