ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
adore::if_xodr::XODR2BorderBasedConverter Class Reference

OpenDRIVE converter from file to object sets. More...

#include <xodr2borderbased.h>

Collaboration diagram for adore::if_xodr::XODR2BorderBasedConverter:
Collaboration graph

Classes

class  XODR_Signal
 internal signal representation for conversion More...
 

Public Types

typedef std::unordered_map< std::string, XODR_SignalSignalByID
 

Public Member Functions

 XODR2BorderBasedConverter ()
 Construct a new XODR2BorderBasedConverter object. More...
 
void convert (const char *filename, adore::env::BorderBased::BorderSet *target_set, adore::env::TCDSet *tcdSet, adore::env::BorderBased::LanePositionedObjectSet *stoplineSet, adore::env::BorderBased::ParkingSpotSet *parkingSpotSet, BorderIDTranslation *idTranslation, double *x0, double *y0, bool transform=false)
 full conversion of OpenDRIVE map to object representations More...
 
void convert (const char *filename, adore::env::BorderBased::BorderSet *target_set, adore::env::TCDSet *tcdSet, adore::env::BorderBased::LanePositionedObjectSet *stoplineSet, adore::env::BorderBased::ParkingSpotSet *parkingSpotSet, bool transform)
 slightly reduced conversion without reference point of map More...
 
void convert (const char *filename, adore::env::BorderBased::BorderSet *target_set)
 reduced conversion with only border set as output More...
 
void convert (const char *filename, adore::env::BorderBased::BorderSet *target_set, bool transform)
 reduced conversion with only border set as output More...
 
void convert (const char *filename, adore::env::BorderBased::BorderSet *target_set, bool transform, BorderIDTranslation *idTranslation)
 reads borders from filename into target_set, transforms according to xodr south, west coordinate if so specified, and provides BorderIDTranslation table. More...
 

Public Attributes

struct {
   double   emax
 
   double   edes
 
   double   xmin
 
   double   xmax
 
   double   xstart
 
   double   numberOfPointsPerBorder
 
sampling
 sampling configuration object More...
 
double m_x0
 
double m_y0
 

Private Types

typedef adore::mad::LPiecewiseFunction< double, adoreMatrix< double, 2, 1 > > TRoadCenterFun
 
typedef adore::mad::LPiecewiseFunction< double, double > TRoadCenterHeadingFun
 
typedef adore::mad::LLinearPiecewiseFunctionM< double, 2 > TBorderFun
 
typedef std::map< int, std::pair< TBorderFun *, adore::env::BorderBased::BorderType::TYPE > > TSectionBorderSet
 
typedef adore::mad::LPiecewiseFunction< double, int > TSectionMap
 
typedef std::vector< TSectionBorderSet * > TSectionSet
 
typedef adore::mad::LPiecewiseFunction< double, double > TOffsetFun
 
typedef adore::mad::LSpiralFunction< double, 1 > TSpiral
 
typedef adore::mad::LLinearFunction< double, adoreMatrix< double, 2, 1 > > TLine
 
typedef adore::mad::LPolynomialS< double, 3 > TPoly3v
 
typedef adore::mad::LLinearFunction< double, double > TPoly3u
 
typedef adore::mad::LPolynomialM< double, 2, 3 > TParamPoly3
 
typedef std::unordered_map< adore::env::BorderBased::Border *, std::string > Border2RoadID
 

Private Member Functions

adore::env::BorderBased::BorderType::TYPE convertLaneType (std::string xodrType)
 convert xodr lane type to border type More...
 
void extractRoadCenterLine_Spiral (TRoadCenterFun &center, TRoadCenterHeadingFun &center_heading, double s0, double ds, double x0, double y0, double psi0, double kappa0, double kappa1)
 extract spiral geometry of road center line More...
 
void extractRoadCenterLine_Line (TRoadCenterFun &center, TRoadCenterHeadingFun &center_heading, double s0, double ds, double x0, double y0, double psi0)
 extract line geometry of road center line More...
 
void extractRoadCenterLine_Poly3 (TRoadCenterFun &center, TRoadCenterHeadingFun &center_heading, double s0, double ds, double x0, double y0, double psi0, double a, double b, double c, double d)
 extract poly3 geometry of road center line More...
 
void extractRoadCenterLine_ParamPoly3 (TRoadCenterFun &center, TRoadCenterHeadingFun &center_heading, double s0, double ds, double x0, double y0, double psi0, pRange parameterRange, double au, double bu, double cu, double du, double av, double bv, double cv, double dv)
 extract parampoly3 geometry of road center line More...
 
void extractRoadCenterLine (const OpenDRIVE::road_type &road, TRoadCenterFun &center, TRoadCenterHeadingFun &center_heading, TOffsetFun &offsetFun)
 extract road center line geometry to center and center heading functions More...
 
void extractLanes_width (int &left_count, int &right_count, double s0, double s1, const lanes::laneSection_type &section, std::map< int, std::pair< adore::mad::LPiecewiseFunction< double, double > *, adore::env::BorderBased::BorderType::TYPE >> &width_record)
 extract lanes with width entries More...
 
void extractLanes_border (int &left_count, int &right_count, double s0, double s1, const lanes::laneSection_type &section, std::map< int, std::pair< adore::mad::LPiecewiseFunction< double, double > *, adore::env::BorderBased::BorderType::TYPE >> &width_record)
 extract lanes with border entries More...
 
void extractRoadSection (const lanes::laneSection_type &section, TRoadCenterFun &center, TRoadCenterHeadingFun &center_heading, TOffsetFun &center_offset, double s0, double s1, TSectionMap &sectionMap, TSectionSet &sectionSet)
 combine lanes and center line to function representation of road section More...
 
adore::env::TrafficControlDevice::TCDType convertTCDType (std::string xodrtype)
 convert OpenDRIVE signal type to traffic control device type More...
 
void convertBorders (const TSectionSet &sectionSet, const TSectionMap &sectionMap, adore::env::BorderBased::BorderSet *targetSet, const std::vector< XODR_Signal > &ordered_signal_set, adore::env::BorderBased::LanePositionedObjectSet *stoplineSet, Border2RoadID *border2roadID, const std::string &id)
 convert function representation of road to border representation, determine absolute stop line positions and signal positions More...
 
std::vector< XODR2BorderBasedConverter::XODR_SignalextractSignals (const OpenDRIVE::road_type &road)
 save signals from OpenDRIVE to XODR_Signal for later processing More...
 
void convertNonStoplineSignals (TRoadCenterFun &center, TRoadCenterHeadingFun &centerHeading, std::vector< XODR_Signal > &orderedSignalSet, adore::env::TCDSet *tcdSet)
 determine absolute coordinate and heading of non stop line headings More...
 
void convertRoad (const OpenDRIVE::road_type &road, adore::env::BorderBased::BorderSet *targetSet, adore::env::TCDSet *tcdSet, adore::env::BorderBased::LanePositionedObjectSet *stoplineSet, adore::env::BorderBased::ParkingSpotSet *parkingSpotSet, Border2RoadID *idTranslation)
 convert road geometry to borders and also extract traffic control devices and stop lines More...
 
void addMovementIdAndJunctionId (const std::unique_ptr< OpenDRIVE > op, adore::env::TCDSet *tcdSet)
 determine controller and junction id of traffic lights More...
 
void do_convert (const char *filename, adore::env::BorderBased::BorderSet *targetSet, adore::env::TCDSet *tcdSet, adore::env::BorderBased::LanePositionedObjectSet *stoplineSet, adore::env::BorderBased::ParkingSpotSet *parkingSpotSet, BorderIDTranslation *idTranslation, double *x0, double *y0, bool relative_coordinates, double x_r, double y_r, double angle)
 Fills data sets of BorderBased map data representation with data from openDrive xml file. More...
 
void translate_and_rotate_map (double dx, double dy, double dz, double x_r, double y_r, double angle, adore::env::BorderBased::BorderSet *sourceBorderSet, adore::env::TCDSet *sourceTcdSet, adore::env::BorderBased::LanePositionedObjectSet *sourceStoplineSet, adore::env::BorderBased::ParkingSpotSet *sourceParkingSpotSet, adore::env::BorderBased::BorderSet *targetBorderSet, adore::env::TCDSet *targetTcdSet, adore::env::BorderBased::LanePositionedObjectSet *targetStoplineSet, adore::env::BorderBased::ParkingSpotSet *targetParkingSpotSet, Border2RoadID *border2RoadID, BorderIDTranslation *idTranslation)
 change position of all objects via translation More...
 

Static Private Attributes

static const char * XODR_SIGNALTYPE_STOPLINE = "294"
 

Detailed Description

OpenDRIVE converter from file to object sets.

Member Typedef Documentation

◆ Border2RoadID

◆ SignalByID

typedef std::unordered_map<std::string,XODR_Signal> adore::if_xodr::XODR2BorderBasedConverter::SignalByID

◆ TBorderFun

◆ TLine

◆ TOffsetFun

◆ TParamPoly3

◆ TPoly3u

◆ TPoly3v

◆ TRoadCenterFun

◆ TRoadCenterHeadingFun

◆ TSectionBorderSet

◆ TSectionMap

◆ TSectionSet

◆ TSpiral

Constructor & Destructor Documentation

◆ XODR2BorderBasedConverter()

adore::if_xodr::XODR2BorderBasedConverter::XODR2BorderBasedConverter ( )
inline

Construct a new XODR2BorderBasedConverter object.

Member Function Documentation

◆ addMovementIdAndJunctionId()

void adore::if_xodr::XODR2BorderBasedConverter::addMovementIdAndJunctionId ( const std::unique_ptr< OpenDRIVE >  op,
adore::env::TCDSet tcdSet 
)
inlineprivate

determine controller and junction id of traffic lights

Parameters
op
tcdSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert() [1/5]

void adore::if_xodr::XODR2BorderBasedConverter::convert ( const char *  filename,
adore::env::BorderBased::BorderSet target_set 
)

reduced conversion with only border set as output

Parameters
filename
target_set
Here is the call graph for this function:

◆ convert() [2/5]

void adore::if_xodr::XODR2BorderBasedConverter::convert ( const char *  filename,
adore::env::BorderBased::BorderSet target_set,
adore::env::TCDSet tcdSet,
adore::env::BorderBased::LanePositionedObjectSet stoplineSet,
adore::env::BorderBased::ParkingSpotSet parkingSpotSet,
bool  transform 
)

slightly reduced conversion without reference point of map

Parameters
filename
target_set
tcdSet
stoplineSet
parkingSpotSet
transform
Here is the call graph for this function:

◆ convert() [3/5]

void adore::if_xodr::XODR2BorderBasedConverter::convert ( const char *  filename,
adore::env::BorderBased::BorderSet target_set,
adore::env::TCDSet tcdSet,
adore::env::BorderBased::LanePositionedObjectSet stoplineSet,
adore::env::BorderBased::ParkingSpotSet parkingSpotSet,
BorderIDTranslation idTranslation,
double *  x0,
double *  y0,
bool  transform = false 
)

full conversion of OpenDRIVE map to object representations

Parameters
filename
target_set
tcdSet
stoplineSet
parkingSpotSet
x0
y0
transform
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert() [4/5]

void adore::if_xodr::XODR2BorderBasedConverter::convert ( const char *  filename,
adore::env::BorderBased::BorderSet target_set,
bool  transform 
)

reduced conversion with only border set as output

Parameters
filename
target_set
transform
Here is the call graph for this function:

◆ convert() [5/5]

void adore::if_xodr::XODR2BorderBasedConverter::convert ( const char *  filename,
adore::env::BorderBased::BorderSet target_set,
bool  transform,
BorderIDTranslation idTranslation 
)

reads borders from filename into target_set, transforms according to xodr south, west coordinate if so specified, and provides BorderIDTranslation table.

Parameters
filenamexodr file to be read
target_setBorderSet, where imported borders are placed
transformspecify whether a transformation shall be applied according to xodr header south-west coordinates
idTranslationa table providing translation between BorderID and xodr-roadID, and xodr-junctionID
Here is the call graph for this function:

◆ convertBorders()

void adore::if_xodr::XODR2BorderBasedConverter::convertBorders ( const TSectionSet sectionSet,
const TSectionMap sectionMap,
adore::env::BorderBased::BorderSet targetSet,
const std::vector< XODR_Signal > &  ordered_signal_set,
adore::env::BorderBased::LanePositionedObjectSet stoplineSet,
Border2RoadID border2roadID,
const std::string &  id 
)
inlineprivate

convert function representation of road to border representation, determine absolute stop line positions and signal positions

Parameters
sectionSet
sectionMap
targetSet
ordered_signal_set
stoplineSet

for right side: p0 to p1

for left side: p1 to p0

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertLaneType()

adore::env::BorderBased::BorderType::TYPE adore::if_xodr::XODR2BorderBasedConverter::convertLaneType ( std::string  xodrType)
inlineprivate

convert xodr lane type to border type

Parameters
xodrType
Returns
adore::env::BorderBased::BorderType::TYPE
Here is the caller graph for this function:

◆ convertNonStoplineSignals()

void adore::if_xodr::XODR2BorderBasedConverter::convertNonStoplineSignals ( TRoadCenterFun center,
TRoadCenterHeadingFun centerHeading,
std::vector< XODR_Signal > &  orderedSignalSet,
adore::env::TCDSet tcdSet 
)
inlineprivate

determine absolute coordinate and heading of non stop line headings

Parameters
center
centerHeading
orderedSignalSet
tcdSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertRoad()

void adore::if_xodr::XODR2BorderBasedConverter::convertRoad ( const OpenDRIVE::road_type &  road,
adore::env::BorderBased::BorderSet targetSet,
adore::env::TCDSet tcdSet,
adore::env::BorderBased::LanePositionedObjectSet stoplineSet,
adore::env::BorderBased::ParkingSpotSet parkingSpotSet,
Border2RoadID idTranslation 
)
inlineprivate

convert road geometry to borders and also extract traffic control devices and stop lines

Parameters
road
targetSet
tcdSet
stoplineSet
parkingSpotSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertTCDType()

adore::env::TrafficControlDevice::TCDType adore::if_xodr::XODR2BorderBasedConverter::convertTCDType ( std::string  xodrtype)
inlineprivate

convert OpenDRIVE signal type to traffic control device type

Parameters
xodrtype
Returns
adore::env::TrafficControlDevice::TCDType
Here is the caller graph for this function:

◆ do_convert()

void adore::if_xodr::XODR2BorderBasedConverter::do_convert ( const char *  filename,
adore::env::BorderBased::BorderSet targetSet,
adore::env::TCDSet tcdSet,
adore::env::BorderBased::LanePositionedObjectSet stoplineSet,
adore::env::BorderBased::ParkingSpotSet parkingSpotSet,
BorderIDTranslation idTranslation,
double *  x0,
double *  y0,
bool  relative_coordinates,
double  x_r,
double  y_r,
double  angle 
)
inlineprivate

Fills data sets of BorderBased map data representation with data from openDrive xml file.

Parameters
filename
targetSet
tcdSet
stoplineSet
parkingSpotSet
x0
y0
relative_coordinates

translates the map by a specified offset. idTranslation is computed inside, because BorderIDs change with translation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractLanes_border()

void adore::if_xodr::XODR2BorderBasedConverter::extractLanes_border ( int &  left_count,
int &  right_count,
double  s0,
double  s1,
const lanes::laneSection_type &  section,
std::map< int, std::pair< adore::mad::LPiecewiseFunction< double, double > *, adore::env::BorderBased::BorderType::TYPE >> &  width_record 
)
inlineprivate

extract lanes with border entries

Parameters
left_count
right_count
s0
s1
section
width_record
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractLanes_width()

void adore::if_xodr::XODR2BorderBasedConverter::extractLanes_width ( int &  left_count,
int &  right_count,
double  s0,
double  s1,
const lanes::laneSection_type &  section,
std::map< int, std::pair< adore::mad::LPiecewiseFunction< double, double > *, adore::env::BorderBased::BorderType::TYPE >> &  width_record 
)
inlineprivate

extract lanes with width entries

Parameters
left_count
right_count
s0
s1
section
width_record
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractRoadCenterLine()

void adore::if_xodr::XODR2BorderBasedConverter::extractRoadCenterLine ( const OpenDRIVE::road_type &  road,
TRoadCenterFun center,
TRoadCenterHeadingFun center_heading,
TOffsetFun offsetFun 
)
inlineprivate

extract road center line geometry to center and center heading functions

Parameters
road
center
center_heading
offsetFun

@TODO: extract the <laneOffset> entry, which is 0+ child entry of <lanes>

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractRoadCenterLine_Line()

void adore::if_xodr::XODR2BorderBasedConverter::extractRoadCenterLine_Line ( TRoadCenterFun center,
TRoadCenterHeadingFun center_heading,
double  s0,
double  ds,
double  x0,
double  y0,
double  psi0 
)
inlineprivate

extract line geometry of road center line

Parameters
center
center_heading
s0
ds
x0
y0
psi0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractRoadCenterLine_ParamPoly3()

void adore::if_xodr::XODR2BorderBasedConverter::extractRoadCenterLine_ParamPoly3 ( TRoadCenterFun center,
TRoadCenterHeadingFun center_heading,
double  s0,
double  ds,
double  x0,
double  y0,
double  psi0,
pRange  parameterRange,
double  au,
double  bu,
double  cu,
double  du,
double  av,
double  bv,
double  cv,
double  dv 
)
inlineprivate

extract parampoly3 geometry of road center line

Parameters
center
center_heading
s0
ds
x0
y0
psi0
parameterRange
au
bu
cu
du
av
bv
cv
dv
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractRoadCenterLine_Poly3()

void adore::if_xodr::XODR2BorderBasedConverter::extractRoadCenterLine_Poly3 ( TRoadCenterFun center,
TRoadCenterHeadingFun center_heading,
double  s0,
double  ds,
double  x0,
double  y0,
double  psi0,
double  a,
double  b,
double  c,
double  d 
)
inlineprivate

extract poly3 geometry of road center line

Parameters
center
center_heading
s0
ds
x0
y0
psi0
a
b
c
d
Here is the caller graph for this function:

◆ extractRoadCenterLine_Spiral()

void adore::if_xodr::XODR2BorderBasedConverter::extractRoadCenterLine_Spiral ( TRoadCenterFun center,
TRoadCenterHeadingFun center_heading,
double  s0,
double  ds,
double  x0,
double  y0,
double  psi0,
double  kappa0,
double  kappa1 
)
inlineprivate

extract spiral geometry of road center line

Parameters
center
center_heading
s0
ds
x0
y0
psi0
kappa0
kappa1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractRoadSection()

void adore::if_xodr::XODR2BorderBasedConverter::extractRoadSection ( const lanes::laneSection_type &  section,
TRoadCenterFun center,
TRoadCenterHeadingFun center_heading,
TOffsetFun center_offset,
double  s0,
double  s1,
TSectionMap sectionMap,
TSectionSet sectionSet 
)
inlineprivate

combine lanes and center line to function representation of road section

Parameters
section
center
center_heading
center_offset
s0
s1
sectionMap
sectionSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractSignals()

std::vector<XODR2BorderBasedConverter::XODR_Signal> adore::if_xodr::XODR2BorderBasedConverter::extractSignals ( const OpenDRIVE::road_type &  road)
inlineprivate

save signals from OpenDRIVE to XODR_Signal for later processing

Parameters
road
Returns
std::vector<XODR2BorderBasedConverter::XODR_Signal>

@TODO multiple lane validities are possible

positive orientation -> only lanes on right side of the road

negative orientation -> only for lanes on the left side of the road

no orientation -> valid for all lanes

@TODO add signal dependency

Here is the call graph for this function:
Here is the caller graph for this function:

◆ translate_and_rotate_map()

void adore::if_xodr::XODR2BorderBasedConverter::translate_and_rotate_map ( double  dx,
double  dy,
double  dz,
double  x_r,
double  y_r,
double  angle,
adore::env::BorderBased::BorderSet sourceBorderSet,
adore::env::TCDSet sourceTcdSet,
adore::env::BorderBased::LanePositionedObjectSet sourceStoplineSet,
adore::env::BorderBased::ParkingSpotSet sourceParkingSpotSet,
adore::env::BorderBased::BorderSet targetBorderSet,
adore::env::TCDSet targetTcdSet,
adore::env::BorderBased::LanePositionedObjectSet targetStoplineSet,
adore::env::BorderBased::ParkingSpotSet targetParkingSpotSet,
Border2RoadID border2RoadID,
BorderIDTranslation idTranslation 
)
inlineprivate

change position of all objects via translation

Parameters
dx
dy
dz
sourceBorderSet
sourceTcdSet
sourceStoplineSet
sourceParkingSpotSet
targetBorderSet
targetTcdSet
targetStoplineSet
targetParkingSpotSet
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ edes

double adore::if_xodr::XODR2BorderBasedConverter::edes

◆ emax

double adore::if_xodr::XODR2BorderBasedConverter::emax

◆ m_x0

double adore::if_xodr::XODR2BorderBasedConverter::m_x0

◆ m_y0

double adore::if_xodr::XODR2BorderBasedConverter::m_y0

◆ numberOfPointsPerBorder

double adore::if_xodr::XODR2BorderBasedConverter::numberOfPointsPerBorder

◆ 

struct { ... } adore::if_xodr::XODR2BorderBasedConverter::sampling

sampling configuration object

◆ xmax

double adore::if_xodr::XODR2BorderBasedConverter::xmax

◆ xmin

double adore::if_xodr::XODR2BorderBasedConverter::xmin

◆ XODR_SIGNALTYPE_STOPLINE

const char * adore::if_xodr::XODR2BorderBasedConverter::XODR_SIGNALTYPE_STOPLINE = "294"
staticprivate

◆ xstart

double adore::if_xodr::XODR2BorderBasedConverter::xstart

The documentation for this class was generated from the following files: