ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
r2s2borderbased.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Robert Markowski - initial API and implementation
13  ********************************************************************************/
14 
15 #pragma once
16 #include <string>
17 #include <map>
20 
21 namespace adore
22 {
23  namespace if_r2s
24  {
31  {
32  public:
33  typedef std::map<int,Section> TSectionMap;
34  typedef std::map<int,TFunctionTypePair> TDist2Function;
35 
36  private:
38 
39  private:
40  void group(TReferenceLineVector rlm, TLaneBorderVector lbv, TSectionMap& sectionmap);
47  void convertToBorder(TSectionMap sectionmap, env::BorderBased::BorderSet& targetset);
63  void sortFunctionsByDistance(std::vector<TFunctionTypePair>& functions, TDist2Function& dist2function, double s0, double s1);
74  void createBorders(TDist2Function& dist2function, double s0, double s1, int max_points, adore::env::BorderBased::BorderSet& targetSet, bool inverted);
83  void do_convert(std::string referenceLineFile, std::string laneBorderFile, env::BorderBased::BorderSet& targetset, TSectionMap& sectionmap);
84 
85  public:
90  void toBorders(const TReferenceLineVector& reflines,const TLaneBorderVector& laneborders,env::BorderBased::BorderSet& targetset);
98  void convert(std::string referenceLineFile, std::string laneBorderFile, env::BorderBased::BorderSet& targetset);
107  void convert(std::string referenceLineFile, std::string laneBorderFile, env::BorderBased::BorderSet& targetset, TSectionMap& sectionmap);
113  void cleanup(TSectionMap& sectionmap);
119  void setExtractOnlyReferenceLines(bool b);
120  };
121  }
122 }
efficiently store borders in boost R-tree
Definition: borderset.h:99
input: 2 files, reference lines and borders output: border file
Definition: r2s2borderbased.h:31
void convert(std::string referenceLineFile, std::string laneBorderFile, env::BorderBased::BorderSet &targetset)
convert to borders
Definition: r2s2borderbased.cpp:182
void cleanup(TSectionMap &sectionmap)
cleanup leftover functions in sectionmap
Definition: r2s2borderbased.cpp:50
void toBorders(const TReferenceLineVector &reflines, const TLaneBorderVector &laneborders, env::BorderBased::BorderSet &targetset)
converts sets of ReferenceLine and LaneBorder structs into adore borders
Definition: r2s2borderbased.cpp:83
void createBorders(TDist2Function &dist2function, double s0, double s1, int max_points, adore::env::BorderBased::BorderSet &targetSet, bool inverted)
borders for functions in dist2function from s0 to s1
Definition: r2s2borderbased.cpp:253
std::map< int, TFunctionTypePair > TDist2Function
Definition: r2s2borderbased.h:34
env::BorderBased::BorderType::TYPE convertLaneBorderType(LaneBorder::TYPE type)
converts from LaneBorder::TYPE to BorderType::TYPE
Definition: r2s2borderbased.cpp:35
void do_convert(std::string referenceLineFile, std::string laneBorderFile, env::BorderBased::BorderSet &targetset, TSectionMap &sectionmap)
actual conversion
Definition: r2s2borderbased.cpp:57
void convertToBorder(TSectionMap sectionmap, env::BorderBased::BorderSet &targetset)
manage overall conversion process from sectionmap to borderset
Definition: r2s2borderbased.cpp:292
std::map< int, Section > TSectionMap
Definition: r2s2borderbased.h:33
R2S2BorderBasedConverter()
Definition: r2s2borderbased.cpp:27
void sortFunctionsByDistance(std::vector< TFunctionTypePair > &functions, TDist2Function &dist2function, double s0, double s1)
sort borders by their distance to base function which is required to be available through dist2functi...
Definition: r2s2borderbased.cpp:210
void group(TReferenceLineVector rlm, TLaneBorderVector lbv, TSectionMap &sectionmap)
Definition: r2s2borderbased.cpp:188
void setExtractOnlyReferenceLines(bool b)
set option to only convert reference lines and ignore laneborders
Definition: r2s2borderbased.cpp:31
bool extractOnlyReferenceLines_
Definition: r2s2borderbased.h:37
TYPE
This enum holds the different types of borders.
Definition: border.h:37
std::vector< LaneBorder > TLaneBorderVector
Definition: r2sauxiliary.h:236
std::vector< ReferenceLine > TReferenceLineVector
Definition: r2sauxiliary.h:235
Definition: areaofeffectconverter.h:20
TYPE
Definition: r2sauxiliary.h:145