ad_map_access
Operation.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: MIT
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <memory>
16 #include "ad/map/access/Store.hpp"
19 #include "ad/map/lane/Types.hpp"
20 #include "ad/map/route/Types.hpp"
21 
23 namespace ad {
25 namespace map {
26 
27 namespace point {
28 class CoordinateTransform;
29 } // namespace point
30 
32 namespace access {
33 
39 inline bool isValid(MapMetaData const &metaData, bool const logErrors = true)
40 {
41  bool isValidInputRange = withinValidInputRange(metaData, logErrors) && (metaData.trafficType != TrafficType::INVALID);
42  if (!isValidInputRange && logErrors)
43  {
44  spdlog::error("withinValidInputRange(::ad::map::access::MapMetaData)>> {} not valid", metaData);
45  }
46  return isValidInputRange;
47 }
48 
52 std::shared_ptr<point::CoordinateTransform> getCoordinateTransform();
53 
61 bool init(std::string const &configFileName);
62 
69 bool initFromOpenDriveContent(std::string const &openDriveContent,
70  double const overlapMargin,
71  intersection::IntersectionType const defaultIntersectionType,
72  landmark::TrafficLightType const defaultTrafficLightType
79 bool init(Store::Ptr store);
80 
84 void cleanup();
85 
91 void setENUReferencePoint(point::GeoPoint const &point);
92 
99 
104 
113 std::vector<config::PointOfInterest> getPointsOfInterest(point::GeoPoint const &geoPoint,
114  physics::Distance const &radius);
115 
121 std::vector<config::PointOfInterest> const &getPointsOfInterest();
122 
133 bool getPointOfInterest(std::string const &name, config::PointOfInterest &poi);
134 
138 bool isLeftHandedTraffic();
139 
143 bool isRightHandedTraffic();
144 
148 Store &getStore();
149 
150 } // namespace access
151 } // namespace map
152 } // namespace ad
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::access::getCoordinateTransform
std::shared_ptr< point::CoordinateTransform > getCoordinateTransform()
get the coordinate transformation object
ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN
@ SOLID_RED_YELLOW_GREEN
ad::map::access::setENUReferencePoint
void setENUReferencePoint(point::GeoPoint const &point)
set the current ENU reference point
ad::map::access::isValid
bool isValid(MapMetaData const &metaData, bool const logErrors=true)
checks if the given MapMetaData is valid
Definition: Operation.hpp:39
MapMetaDataValidInputRange.hpp
ad::map::access::MapMetaData
DataType MapMetaData.
Definition: MapMetaData.hpp:44
ad::map::access::TrafficType::INVALID
@ INVALID
withinValidInputRange
bool withinValidInputRange(::ad::map::access::MapMetaData const &input, bool const logErrors=true)
check if the given MapMetaData is within valid input range
Definition: MapMetaDataValidInputRange.hpp:37
ad::map::point::GeoPoint
DataType GeoPoint.
Definition: GeoPoint.hpp:47
ad::map::config::PointOfInterest
DataType PointOfInterest.
Definition: PointOfInterest.hpp:45
ad::map::access::getENUReferencePoint
point::GeoPoint getENUReferencePoint()
get the current ENU reference point set in the map
ad::map::access::Store::Ptr
std::shared_ptr< Store > Ptr
Smart pointer to the Store.
Definition: Store.hpp:46
PointOfInterest.hpp
ad::map::landmark::TrafficLightType
TrafficLightType
DataType TrafficLightType.
Definition: TrafficLightType.hpp:43
ad::map::access::isENUReferencePointSet
bool isENUReferencePointSet()
check if ENU Reference Point is set
ad::map::access::initFromOpenDriveContent
bool initFromOpenDriveContent(std::string const &openDriveContent, double const overlapMargin, intersection::IntersectionType const defaultIntersectionType, landmark::TrafficLightType const defaultTrafficLightType=landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN)
initialize singleton with OpenDRIVE content
ad::map::intersection::IntersectionType
IntersectionType
DataType IntersectionType.
Definition: IntersectionType.hpp:43
ad::map::access::init
bool init(std::string const &configFileName)
initialize singleton with given configuration file
ad::map::access::getPointsOfInterest
std::vector< config::PointOfInterest > getPointsOfInterest(point::GeoPoint const &geoPoint, physics::Distance const &radius)
get points of interest in the surrounding of a given geoPoint
Types.hpp
IntersectionType.hpp
Types.hpp
ad::map::access::cleanup
void cleanup()
remove all loaded maps and configuration
Store.hpp
ad::map::access::isRightHandedTraffic
bool isRightHandedTraffic()
ad::map::access::getStore
Store & getStore()
ad::map::access::getPointOfInterest
bool getPointOfInterest(std::string const &name, config::PointOfInterest &poi)
get a certain point of interest if exists
ad::map::access::isLeftHandedTraffic
bool isLeftHandedTraffic()