18 #include <OpenDRIVE_1.4H.h>
23 #include <unordered_map>
51 typedef std::map<int,std::pair<TBorderFun*,adore::env::BorderBased::BorderType::TYPE>>
TSectionBorderSet;
62 typedef std::unordered_map<adore::env::BorderBased::Border*,std::string>
Border2RoadID;
94 sampling.numberOfPointsPerBorder = 128;
125 typedef std::unordered_map<std::string,XODR_Signal>
SignalByID;
142 const char* filename,
148 double*
x0,
double*
y0,
bool transform=
false);
161 const char* filename,
175 const char* filename,
185 const char* filename,
197 void convert(
const char* filename,
213 if(strcmp(xodrType.c_str(),
"driving")==0)
217 if(strcmp(xodrType.c_str(),
"special1")==0)
257 adoreMatrix<double,2,1>
p0,dp;
280 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)
299 throw(
"not implemented");
322 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)
326 adoreMatrix<double,2,1>
p0;
328 adoreMatrix<double,0,0> params(2,4);
339 switch(parameterRange)
341 case pRange::arcLength:
346 case pRange::normalized:
348 parampoly =
new TParamPoly3(adore::mad::stretch_poly_parameters<double,2,3>(params,0,1,0,ds),0,ds);
352 parampoly->
multiply(adore::mad::rotationMatrix<double,2>(psi0),0,1);
353 parampoly->
add(
p0,0,1);
370 for(
auto geo = road.planView().geometry().begin(); geo!= road.planView().geometry().end(); geo++ )
372 double s0 = geo->s().get();
373 double ds = geo->length().get();
375 double x0 = geo->x().get();
376 double y0 = geo->y().get();
377 double psi0 = geo->hdg().get();
378 if( geo->arc().present() )
380 double kappa = geo->arc()->curvature().get();
385 if( geo->line().present() )
391 if( geo->poly3().present() )
394 geo->poly3()->a().get(),
395 geo->poly3()->b().get(),
396 geo->poly3()->c().get(),
397 geo->poly3()->d().get());
401 if( geo->paramPoly3().present() )
403 if(geo->paramPoly3()->pRange().present())
406 geo->paramPoly3()->pRange().get(),
407 geo->paramPoly3()->aU().get(),
408 geo->paramPoly3()->bU().get(),
409 geo->paramPoly3()->cU().get(),
410 geo->paramPoly3()->dU().get(),
411 geo->paramPoly3()->aV().get(),
412 geo->paramPoly3()->bV().get(),
413 geo->paramPoly3()->cV().get(),
414 geo->paramPoly3()->dV().get());
420 geo->paramPoly3()->aU().get(),
421 geo->paramPoly3()->bU().get(),
422 geo->paramPoly3()->cU().get(),
423 geo->paramPoly3()->dU().get(),
424 geo->paramPoly3()->aV().get(),
425 geo->paramPoly3()->bV().get(),
426 geo->paramPoly3()->cV().get(),
427 geo->paramPoly3()->dV().get());
432 if( geo->spiral().present() )
434 double kappa0 = geo->spiral()->curvStart().get();
435 double kappa1 = geo->spiral()->curvEnd().get();
444 if(road.lanes().laneOffset().begin() == road.lanes().laneOffset().end())
450 bool first_run =
true;
451 for(
auto lo = road.lanes().laneOffset().begin(); lo != road.lanes().laneOffset().end(); lo++)
453 double a = lo->a().get();
454 double b = lo->b().get();
455 double c = lo->c().get();
456 double d = lo->d().get();
457 adoreMatrix<double,1,4> params;
459 double loStart = lo->s().get();
463 if(nextLo==road.lanes().laneOffset().end())
465 loEnd= road.length().get();
469 loEnd = nextLo->s().get();
472 if(nextLo!=road.lanes().laneOffset().end())
474 double diff = std::abs(poly->f(loEnd-loStart)-nextLo->a().get());
477 std::cerr<<
"There is a laneOffset jump of "<<std::abs(poly->f(loEnd-loStart)-nextLo->a().get())
478 <<
" within road "<<road.id().get()
488 double diff = std::abs(poly->f(0)-offsetFun.
f(offsetFun.
limitHi()));
491 std::cerr<<
"There is a laneOffset jump of "<<diff
492 <<
" in road "<<road.id().get()<<
"."<<std::endl;
512 if(section.right().present())
515 for(
auto lane = section.right()->lane().begin();lane!=section.right()->lane().end();lane++)
517 int width_fun_entry_count = 0;
519 for(
auto width = lane->width().begin();width!=lane->width().end();width ++)
522 double ws0 = width->sOffset().get() + s0;
524 auto nextWidth = width;
526 if(nextWidth==lane->width().end())
532 ws1 = nextWidth->sOffset().get() + s0;
537 if(ws1<=ws0)
continue;
538 if(width_fun_entry_count>0 && width_fun->
limitHi()>ws0)
continue;
541 adoreMatrix<double,1,4> param;
542 param = width->a().get(),width->b().get(),width->c().get(),width->d().get();
543 param = param * sign;
545 width_fun_entry_count ++;
549 width_record[lane->id().get()].first = width_fun;
550 width_record[lane->id().get()].second =
convertLaneType(lane->type().get());
558 if(section.left().present())
561 width_record[0].first=0;
564 for(
auto lane = section.left()->lane().begin();lane!=section.left()->lane().end();lane++)
566 int width_fun_entry_count = 0;
568 for(
auto width = lane->width().begin();width!=lane->width().end();width ++)
571 double ws0 = width->sOffset().get() + s0;
573 auto nextWidth = width;
575 if(nextWidth==lane->width().end())
581 ws1 = nextWidth->sOffset().get() + s0;
586 if(ws1<=ws0)
continue;
587 if(width_fun_entry_count>0 && width_fun->
limitHi()>ws0)
continue;
590 adoreMatrix<double,1,4> param;
591 param = width->a().get(),width->b().get(),width->c().get(),width->d().get();
592 param = param * sign;
597 width_record[lane->id().get()].first = width_fun;
598 width_record[lane->id().get()].second =
convertLaneType(lane->type().get());
617 if(section.right().present())
620 for(
auto lane = section.right()->lane().begin();lane!=section.right()->lane().end();lane++)
622 int width_fun_entry_count = 0;
624 for(
auto width = lane->border().begin();width!=lane->border().end();width ++)
627 double ws0 = width->sOffset().get() + s0;
629 auto nextWidth = width;
631 if(nextWidth==lane->border().end())
637 ws1 = nextWidth->sOffset().get() + s0;
642 if(ws1<=ws0)
continue;
643 if(width_fun_entry_count>0 && width_fun->
limitHi()>ws0)
continue;
646 adoreMatrix<double,1,4> param;
647 param = width->a().get(),width->b().get(),width->c().get(),width->d().get();
648 param = param * sign;
650 width_fun_entry_count ++;
654 width_record[lane->id().get()].first = width_fun;
655 width_record[lane->id().get()].second =
convertLaneType(lane->type().get());
663 if(section.left().present())
666 width_record[0].first=0;
669 for(
auto lane = section.left()->lane().begin();lane!=section.left()->lane().end();lane++)
671 int width_fun_entry_count = 0;
673 for(
auto width = lane->border().begin();width!=lane->border().end();width ++)
676 double ws0 = width->sOffset().get() + s0;
678 auto nextWidth = width;
680 if(nextWidth==lane->border().end())
686 ws1 = nextWidth->sOffset().get() + s0;
691 if(ws1<=ws0)
continue;
692 if(width_fun_entry_count>0 && width_fun->
limitHi()>ws0)
continue;
695 adoreMatrix<double,1,4> param;
696 param = width->a().get(),width->b().get(),width->c().get(),width->d().get();
697 param = param * sign;
702 width_record[lane->id().get()].first = width_fun;
703 width_record[lane->id().get()].second =
convertLaneType(lane->type().get());
729 sectionSet.push_back(borderSet);
738 bool usingWidthRepresentation =
true;
747 (section.right().present() && section.right()->lane().begin()!= section.right()->lane().end() && !section.right()->lane().begin()->width().empty())
749 (section.left().present() && section.left()->lane().begin()!= section.left()->lane().end() && !section.left()->lane().begin()->width().empty())
755 (section.right().present() && section.right()->lane().begin()!= section.right()->lane().end() && !section.right()->lane().begin()->border().empty())
757 (section.left().present() && section.left()->lane().begin()!= section.left()->lane().end() && !section.left()->lane().begin()->border().empty())
761 usingWidthRepresentation =
false;
778 offset_record[0].first = local_center_offset;
784 width_record[0].first=0;
789 offset_record[1].first =
adore::mad::funop::add(adore::mad::funop::minus<double,double,double,double>(offset_record[0].first->clone()),width_record[1].first->clone());
790 offset_record[1].second = width_record[1].second;
795 offset_record[-1].first =
adore::mad::funop::add(offset_record[0].first->clone(),width_record[-1].first->clone());
796 offset_record[-1].second = width_record[-1].second;
801 for(
int i=1;i<=left_count;i++)
803 if(usingWidthRepresentation)
806 offset_record[i].first =
adore::mad::funop::add(offset_record[i-1].first->clone(),width_record[i].first->clone());
810 offset_record[i].first = width_record[i].first->clone();
812 offset_record[i].second = width_record[i].second;
815 for(
int i=1;i<=right_count;i++)
817 if(usingWidthRepresentation)
819 offset_record[-i].first =
adore::mad::funop::add(offset_record[-i+1].first->clone(),width_record[-i].first->clone());
823 offset_record[-i].first = width_record[-i].first->clone();
825 offset_record[-i].second = width_record[-i].second;
829 for(
auto it = offset_record.begin();it!=offset_record.end();it++)
833 auto lane_border = adore::mad::create_normalOffset<double>(center.
clone(),center_heading.
clone(),offset->
clone());
834 auto lane_border_derivative = lane_border->create_derivative();
836 (*borderSet)[it->first].second = it->second.second;
838 delete lane_border_derivative;
841 for(
auto it = width_record.begin();it!=width_record.end();it++)
843 if(it->second.first!=0)
delete it->second.first;
845 for(
auto it = offset_record.begin();it!=offset_record.end();it++)
847 if(it->second.first!=0)
delete it->second.first;
865 if(strcmp(
"1000001",xodrtype.c_str())==0)
869 else if(strcmp(
"206",xodrtype.c_str())==0)
877 else if(strcmp(
"306",xodrtype.c_str())==0)
881 else if(strcmp(
"27430",xodrtype.c_str())==0)
885 else if(strcmp(
"27450",xodrtype.c_str())==0)
889 else if(strcmp(
"27480",xodrtype.c_str())==0)
912 auto signal_it = ordered_signal_set.begin();
917 for(
auto it_section = sectionSet.begin();it_section!=sectionSet.end();it_section++)
928 for(
auto it_border = borders->begin();it_border!=borders->end();it_border++)
931 i_min = (
std::min)(i_min,it_border->first);
932 i_max = (
std::max)(i_max,it_border->first);
938 adoreMatrix<double,0,0> m;
939 m = dlib::zeros_matrix<double>(4,
sampling.numberOfPointsPerBorder);
942 int points = (*borders)[0].first->export_points(m,s,s_cut,1e-10);
943 adoreMatrix<double,4,0> data = colm(m,dlib::range(0,points-1));
948 centerFunInverted->invertDomain();
958 for(
int i = 1;i<=i_max;i++)
961 points = (*borders)[i].first->export_points(m,s,s_cut,1e-10);
965 function->invertDomain();
966 function->startDomainAtZero();
978 for(
int i=-1;i>=i_min;i--)
981 points = (*borders)[i].first->export_points(m,s,s_cut,1e-10);
985 function->startDomainAtZero();
996 border2roadID->emplace(std::make_pair(current,
id));
1000 while(signal_it!=ordered_signal_set.end() && signal_it->s<s)signal_it++;
1001 for(;signal_it!=ordered_signal_set.end() && signal_it->s<=s_cut;signal_it ++)
1009 int i_start = (
std::max)(i_min,signal_it->fromLane);
1010 int i_end = (
std::min)(i_max,signal_it->toLane);
1014 for(
int i = i_start;i<=i_end;i++)
1020 adoreMatrix<double,2,1>
p0 = (*borders)[i].first->f_bounded(s);
1021 adoreMatrix<double,2,1> p1 = (*borders)[i].first->f_bounded(s_cut);
1052 if(s_max-s_cut<
sampling.emax)
break;
1063 std::vector<XODR2BorderBasedConverter::XODR_Signal>
extractSignals(
const OpenDRIVE::road_type& road)
1065 std::vector<XODR_Signal> orderedSignalSet;
1066 if(road.signals().present())
1068 for(
auto signal = road.signals().get().t_signal().begin();signal!=road.signals().get().t_signal().end();signal++)
1071 xs.
s = signal->s().get();
1072 xs.
t = signal->t().get();
1073 xs.
id = signal->id().get();
1075 xs.
type = signal->type().get();
1076 xs.
value = signal->value().get();
1079 if(signal->validity().begin()!=signal->validity().end())
1081 int from = signal->validity().begin()->fromLane().get();
1082 int to = signal->validity().begin()->toLane().get();
1107 for(
auto depIt = signal->dependency().begin(); depIt != signal->dependency().end(); depIt++)
1109 if(strcmp(depIt->type().get().c_str(),
"limitline")==0)
1115 orderedSignalSet.push_back(xs);
1118 return orderedSignalSet;
1131 for(
auto signalIt = orderedSignalSet.begin(); signalIt != orderedSignalSet.end(); signalIt++)
1137 double s = signalIt->s;
1140 double t = signalIt->t;
1141 auto p = center.
f(s);
1142 double psi = centerHeading(s);
1145 int toLane = signalIt->toLane;
1150 if( psi > (2 * 3.14159))
1160 tcd->
setID(std::stoi(signalIt->id));
1180 std::string
id = road.id().get();
1192 for(
auto section = road.lanes().laneSection().begin(); section!=road.lanes().laneSection().end(); section++)
1195 double s0 = section->s().get();
1197 auto nextLaneSection = section;
1199 if(nextLaneSection==road.lanes().laneSection().end())
1201 s1 = road.length().get();
1205 s1 = nextLaneSection->s().get();
1212 extractRoadSection(*section,center,center_heading, center_offset,s0,s1,sectionMap,sectionSet);
1217 std::vector<XODR_Signal> orderedSignalSet =
extractSignals(road);
1220 if(road.objects().present())
1222 for(
auto obj = road.objects().get().object().begin(); obj != road.objects().get().object().end(); obj++)
1224 if(obj->type().present() && strcmp(obj->type().get().c_str(),
"parkingSpace")==0)
1226 double s0_obj = obj->s().get();
1227 double t0_obj = obj->t().get();
1228 double hdg_obj = obj->hdg().get();
1230 if(obj->repeat().size()>0)
1233 for(
auto it = obj->repeat().begin(); it != obj->repeat().end(); it++)
1235 double s0_repeat = it->s().get();
1236 double length = it->length().get();
1237 double distance = it->distance().get();
1238 double t0_repeat = it->tStart().get();
1239 double t_repeat_changeRate = (it->tEnd().get()-t0_repeat)/length;
1240 double s_repeat = 0;
1244 double s = s0_repeat + s_repeat;
1245 double t = t0_repeat + s*t_repeat_changeRate;
1246 double psi = center_heading.
f(s);
1247 double hdg = hdg_obj + psi;
1248 auto point = center.
f(s);
1253 s_repeat = s_repeat + distance;
1254 }
while(s_repeat <= length);
1260 auto point = center.
f(s0_obj);
1261 auto psi = center_heading.
f(s0_obj);
1262 double hdg = hdg_obj + psi;
1263 double x = point(0) -
std::sin(psi)*t0_obj;
1264 double y = point(1) +
std::cos(psi)*t0_obj;
1275 convertBorders(sectionSet,sectionMap,targetSet,orderedSignalSet,stoplineSet,idTranslation,
id);
1286 for(
auto it = op->controller().begin(); it!=op->controller().end(); it++)
1288 if(!it->id().present())
1292 auto ctrlId = it->id().get();
1293 for(
auto it2 = it->control().begin(); it2!=it->control().end(); it2++)
1295 if(it2->signalId().present())
1297 tcdSet->
setMovementId(atoi(it2->signalId().get().c_str()), atoi(ctrlId.c_str()));
1301 for(
auto it = op->junction().begin(); it!= op->junction().end(); it++)
1303 if(!it->id().present())
1307 auto junctionId = it->id().get();
1308 for(
auto it2 = it->controller().begin(); it2!= it->controller().end(); it2++)
1310 if(it2->id().present())
1312 tcdSet->
setJunctionId(atoi(it2->id().get().c_str()), atoi(junctionId.c_str()));
1336 double*
x0,
double*
y0,
1337 bool relative_coordinates,
1338 double x_r,
double y_r,
double angle)
1340 std::unique_ptr<OpenDRIVE> op = OpenDRIVE_(filename, xml_schema::flags::keep_dom | xml_schema::flags::dont_validate);
1341 if(relative_coordinates && op->header().south().present() && op->header().west().present())
1343 m_x0 = op->header().west().get();
1344 m_y0 = op->header().south().get();
1365 for(
auto road = op->road().begin(); road!=op->road().end(); road++ )
1367 convertRoad(*road,&tmpBorderSet,&tmpTCDSet,&tmpStoplineSet,&tmpParkingSpotSet,&border2RoadID);
1372 for(
auto junction = op->junction().begin(); junction!=op->junction().end(); junction++)
1374 std::string junctionID = junction->id().get();
1375 for(
auto connection = junction->connection().begin(); connection!= junction->connection().end(); connection++ )
1377 std::string connectingRoadID = connection->connectingRoad().get();
1378 idTranslation->
insert(junctionID,connectingRoadID);
1389 &tmpBorderSet,&tmpTCDSet,&tmpStoplineSet,&tmpParkingSpotSet,
1390 targetSet,tcdSet,stoplineSet,parkingSpotSet,&border2RoadID,idTranslation);
1422 if(targetBorderSet!=
nullptr)
1424 for(
auto it = sourceBorderSet->
getAllBorders();it.first!=it.second;it.first++)
1431 idTranslation->
insert(newBorder->
m_id,(*border2RoadID)[sourceBorder]);
1435 if(targetTcdSet!=
nullptr)
1437 for(
auto it = sourceTcdSet->
getAllTCDs();it.first!=it.second;it.first++)
1448 targetTcdSet->
setJunctionId(std::get<1>(tlt),std::get<2>(tlt));
1453 if(targetStoplineSet!=
nullptr)
1455 for(
auto it = sourceStoplineSet->
getAllObjects();it.first!=it.second;it.first++)
1464 if(targetParkingSpotSet!=
nullptr)
1469 auto x = ps->first.get<0>();
1470 auto y = ps->first.get<1>();
1471 auto z = ps->first.get<2>();
Abstract class for Objects that are positioned by a connection to a certain lane.
Definition: alanepositionedobject.h:28
efficiently store borders in boost R-tree
Definition: borderset.h:99
void insert_border(Border *b, bool force_insert=false)
insert new border into this
Definition: borderset.h:225
BorderIteratorPair2 getAllBorders()
get all borders in this
Definition: borderset.h:356
This class represents a set of objects that are positioned by LanePosition.
Definition: lanepositionedobjectset.h:34
ObjectIteratorPair getAllObjects()
Get the begin()- and end()-iterator for the whole set.
Definition: lanepositionedobjectset.h:224
void insert_object(object *obj, bool remove_duplicates=false, double precision=0.5)
Insert a new object.
Definition: lanepositionedobjectset.h:147
Definition: parkingspotset.h:39
bool insertParkingSpot(ParkingSpot parkingSpot)
Definition: parkingspotset.h:135
ItPairCoordinate2heading getAllParkingSpots()
Definition: parkingspotset.h:181
This class definition is to represent parking spots.
Definition: parkingspot.h:31
This class provide information about stoplines.
Definition: stopline.h:31
void translate(double dx, double dy, double dz)
Translate the stop line.
Definition: stopline.h:115
bool insertTCD(env::TrafficControlDevice *tcd)
Definition: tcdset.h:128
void setMovementId(int tcdId, int movementId)
Definition: tcdset.h:149
void setJunctionId(int movementId, int junctionId)
Definition: tcdset.h:154
TCDIteratorPair getAllTCDs()
Definition: tcdset.h:205
env::TTCDTrafficLightTuple getTCDTrafficLight(int tcdID)
Definition: tcdset.h:273
Definition: trafficcontroldevice.h:24
void translate(double dx, double dy, double dz)
Definition: trafficcontroldevice.h:137
void setType(TCDType type)
Definition: trafficcontroldevice.h:150
void setCoordinate(BorderBased::Coordinate coordinate)
Definition: trafficcontroldevice.h:170
void setID(int id)
Definition: trafficcontroldevice.h:148
int getID() const
Definition: trafficcontroldevice.h:146
void setOrientation(double orientation)
Definition: trafficcontroldevice.h:160
TCDType getType() const
Definition: trafficcontroldevice.h:155
TCDType
Definition: trafficcontroldevice.h:28
@ STOP_SIGN
Definition: trafficcontroldevice.h:32
@ UNKNOWN
Definition: trafficcontroldevice.h:48
@ RIGHT_OF_WAY
Definition: trafficcontroldevice.h:31
@ TRAFFIC_LIGHT
Definition: trafficcontroldevice.h:29
@ SPEED_LIMIT_30
Definition: trafficcontroldevice.h:35
@ SPEED_LIMIT_80
Definition: trafficcontroldevice.h:40
@ SPEED_LIMIT_50
Definition: trafficcontroldevice.h:37
BorderIDTranslation is a set of translation tables, which keeps track of road ids,...
Definition: idtranslation.h:32
void insert(const BorderID &borderID, TID roadID)
Definition: idtranslation.h:57
internal signal representation for conversion
Definition: xodr2borderbased.h:103
std::list< std::string > dependency
Definition: xodr2borderbased.h:119
adore::env::BorderBased::LanePosition m_pos
Definition: xodr2borderbased.h:105
int road_id
Definition: xodr2borderbased.h:113
friend bool operator<(const XODR_Signal &l, const XODR_Signal &r)
Definition: xodr2borderbased.h:120
double t
Definition: xodr2borderbased.h:115
virtual const adore::env::BorderBased::LanePosition & getLanePosition()
Get the LanePosition of the Object.
Definition: xodr2borderbased.h:106
int toLane
Definition: xodr2borderbased.h:117
double value
Definition: xodr2borderbased.h:118
std::string type
Definition: xodr2borderbased.h:110
double s
Definition: xodr2borderbased.h:114
std::string id
Definition: xodr2borderbased.h:111
std::string orientation
Definition: xodr2borderbased.h:112
int fromLane
Definition: xodr2borderbased.h:116
OpenDRIVE converter from file to object sets.
Definition: xodr2borderbased.h:43
adore::mad::LLinearFunction< double, double > TPoly3u
Definition: xodr2borderbased.h:59
void extractRoadCenterLine_Spiral(TRoadCenterFun ¢er, TRoadCenterHeadingFun ¢er_heading, double s0, double ds, double x0, double y0, double psi0, double kappa0, double kappa1)
extract spiral geometry of road center line
Definition: xodr2borderbased.h:237
void extractLanes_width(int &left_count, int &right_count, double s0, double s1, const lanes::laneSection_type §ion, std::map< int, std::pair< adore::mad::LPiecewiseFunction< double, double > *, adore::env::BorderBased::BorderType::TYPE >> &width_record)
extract lanes with width entries
Definition: xodr2borderbased.h:510
std::vector< TSectionBorderSet * > TSectionSet
Definition: xodr2borderbased.h:53
struct adore::if_xodr::XODR2BorderBasedConverter::@1 sampling
sampling configuration object
adore::mad::LPiecewiseFunction< double, adoreMatrix< double, 2, 1 > > TRoadCenterFun
Definition: xodr2borderbased.h:48
adore::mad::LLinearFunction< double, adoreMatrix< double, 2, 1 > > TLine
Definition: xodr2borderbased.h:57
adore::mad::LLinearPiecewiseFunctionM< double, 2 > TBorderFun
Definition: xodr2borderbased.h:50
adore::mad::LSpiralFunction< double, 1 > TSpiral
Definition: xodr2borderbased.h:56
double emax
Definition: xodr2borderbased.h:70
double xstart
Definition: xodr2borderbased.h:74
double numberOfPointsPerBorder
Definition: xodr2borderbased.h:75
XODR2BorderBasedConverter()
Construct a new XODR2BorderBasedConverter object.
Definition: xodr2borderbased.h:87
void extractRoadCenterLine(const OpenDRIVE::road_type &road, TRoadCenterFun ¢er, TRoadCenterHeadingFun ¢er_heading, TOffsetFun &offsetFun)
extract road center line geometry to center and center heading functions
Definition: xodr2borderbased.h:367
void extractRoadCenterLine_ParamPoly3(TRoadCenterFun ¢er, TRoadCenterHeadingFun ¢er_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
Definition: xodr2borderbased.h:322
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.
Definition: xodr2borderbased.h:1330
std::unordered_map< adore::env::BorderBased::Border *, std::string > Border2RoadID
Definition: xodr2borderbased.h:62
double xmax
Definition: xodr2borderbased.h:73
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
Definition: xodr2borderbased.h:1177
adore::mad::LPiecewiseFunction< double, double > TOffsetFun
Definition: xodr2borderbased.h:54
double m_x0
Definition: xodr2borderbased.h:79
std::vector< XODR2BorderBasedConverter::XODR_Signal > extractSignals(const OpenDRIVE::road_type &road)
save signals from OpenDRIVE to XODR_Signal for later processing
Definition: xodr2borderbased.h:1063
adore::env::BorderBased::BorderType::TYPE convertLaneType(std::string xodrType)
convert xodr lane type to border type
Definition: xodr2borderbased.h:210
double edes
Definition: xodr2borderbased.h:71
adore::mad::LPolynomialM< double, 2, 3 > TParamPoly3
Definition: xodr2borderbased.h:60
adore::env::TrafficControlDevice::TCDType convertTCDType(std::string xodrtype)
convert OpenDRIVE signal type to traffic control device type
Definition: xodr2borderbased.h:857
void extractLanes_border(int &left_count, int &right_count, double s0, double s1, const lanes::laneSection_type §ion, std::map< int, std::pair< adore::mad::LPiecewiseFunction< double, double > *, adore::env::BorderBased::BorderType::TYPE >> &width_record)
extract lanes with border entries
Definition: xodr2borderbased.h:615
std::unordered_map< std::string, XODR_Signal > SignalByID
Definition: xodr2borderbased.h:125
void extractRoadSection(const lanes::laneSection_type §ion, TRoadCenterFun ¢er, TRoadCenterHeadingFun ¢er_heading, TOffsetFun ¢er_offset, double s0, double s1, TSectionMap §ionMap, TSectionSet §ionSet)
combine lanes and center line to function representation of road section
Definition: xodr2borderbased.h:723
void extractRoadCenterLine_Line(TRoadCenterFun ¢er, TRoadCenterHeadingFun ¢er_heading, double s0, double ds, double x0, double y0, double psi0)
extract line geometry of road center line
Definition: xodr2borderbased.h:255
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
Definition: xodr2borderbased.h:1410
void convertBorders(const TSectionSet §ionSet, const TSectionMap §ionMap, 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 positi...
Definition: xodr2borderbased.h:906
std::map< int, std::pair< TBorderFun *, adore::env::BorderBased::BorderType::TYPE > > TSectionBorderSet
Definition: xodr2borderbased.h:51
void convertNonStoplineSignals(TRoadCenterFun ¢er, TRoadCenterHeadingFun ¢erHeading, std::vector< XODR_Signal > &orderedSignalSet, adore::env::TCDSet *tcdSet)
determine absolute coordinate and heading of non stop line headings
Definition: xodr2borderbased.h:1129
adore::mad::LPiecewiseFunction< double, double > TRoadCenterHeadingFun
Definition: xodr2borderbased.h:49
double m_y0
Definition: xodr2borderbased.h:80
void addMovementIdAndJunctionId(const std::unique_ptr< OpenDRIVE > op, adore::env::TCDSet *tcdSet)
determine controller and junction id of traffic lights
Definition: xodr2borderbased.h:1284
double xmin
Definition: xodr2borderbased.h:72
void extractRoadCenterLine_Poly3(TRoadCenterFun ¢er, TRoadCenterHeadingFun ¢er_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
Definition: xodr2borderbased.h:280
static const char * XODR_SIGNALTYPE_STOPLINE
Definition: xodr2borderbased.h:46
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
Definition: xodr2borderbased.cpp:26
adore::mad::LPiecewiseFunction< double, int > TSectionMap
Definition: xodr2borderbased.h:52
adore::mad::LPolynomialS< double, 3 > TPoly3v
Definition: xodr2borderbased.h:58
Definition: alfunction.h:74
virtual ALFunction< DT, CT > * clone()=0
Definition: alfunction.h:287
Definition: alfunction.h:307
T getXAfterNPoints(T xstart, int N)
Definition: llinearpiecewisefunction.h:1113
virtual DT limitHi() const override
Definition: llinearpiecewisefunction.h:259
Definition: lpiecewisefunction.h:30
virtual void setLimits(DT lo, DT hi) override
Definition: lpiecewisefunction.h:125
virtual DT limitHi() const override
Definition: lpiecewisefunction.h:114
virtual DT limitLo() const override
Definition: lpiecewisefunction.h:119
virtual ALFunction< DT, CT > * clone() override
Definition: lpiecewisefunction.h:189
void appendHi(ALFunction< DT, CT > *newfun)
Definition: lpiecewisefunction.h:82
virtual CT f(DT x) const override
Definition: lpiecewisefunction.h:109
void appendHi_shifted(ALFunction< DT, CT > *newfun)
Definition: lpiecewisefunction.h:95
Definition: lpolynomial.h:202
virtual void multiply(adoreMatrix< T, 0, 0 > A, int rowi, int rowj) override
Definition: lpolynomial.h:307
virtual ALFunction< DT, CT > * create_derivative() override
Definition: lpolynomial.h:243
virtual void add(adoreMatrix< T, 0, 1 > b, int rowi, int rowj) override
Definition: lpolynomial.h:311
Definition: lpolynomial.h:140
Definition: lspiralfunction.h:38
virtual ALFunction< T, T > * create_heading()
Definition: lspiralfunction.h:138
TYPE
This enum holds the different types of borders.
Definition: border.h:37
@ OTHER
Definition: border.h:38
@ EMERGENCY
Definition: border.h:41
@ DRIVING
Definition: border.h:39
std::tuple< TrafficControlDevice *, int, int > TTCDTrafficLightTuple
Definition: tcdtrafficlightset.h:25
ALFunction< T, T > * heading(AScalarToN< T, 2 > *df)
Definition: heading.h:114
ALFunction< DT, CT > * add(ALFunction< DT, CT > *a, ALFunction< DT, CT > *b)
Definition: alfunction.h:742
interval< T > cos(interval< T > x)
Definition: intervalarithmetic.h:225
T bound(T lb, T value, T ub)
Definition: adoremath.h:569
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
interval< T > sin(interval< T > x)
Definition: intervalarithmetic.h:204
adoreMatrix< T, N, M > max(adoreMatrix< T, N, M > a, const adoreMatrix< T, N, M > &b)
Definition: adoremath.h:686
x0
Definition: adore_set_goal.py:25
x
Definition: adore_set_goal.py:30
y0
Definition: adore_set_goal.py:26
y
Definition: adore_set_goal.py:31
z
Definition: adore_set_goal.py:32
p0
Definition: adore_set_pose.py:32
r
Definition: adore_suppress_lanechanges.py:209
Definition: areaofeffectconverter.h:20
This struct identifies a Border by the coordinates of the starting and the end point.
Definition: borderid.h:31
Coordinate m_last
Definition: borderid.h:32
Coordinate m_first
Definition: borderid.h:32
The border struct contains data of the smallest.
Definition: border.h:62
BorderID m_id
Definition: border.h:68
void translate(double dx, double dy, double dz)
Translate the border.
Definition: border.h:289
BorderID * m_left
Definition: border.h:69
This struct represents 3-dimensional coordines.
Definition: coordinate.h:34
void translate(double dx, double dy, double dz)
Translate a coordinate object.
Definition: coordinate.h:87
double m_Y
Definition: coordinate.h:35
double m_Z
Definition: coordinate.h:35
double m_X
Definition: coordinate.h:35
This is a struct that contains a position defined by a BorderID and a progress on that border.
Definition: laneposition.h:30
double m_progress
Definition: laneposition.h:32
BorderID m_rightID
Definition: laneposition.h:31
T1 first
Definition: parkingspotset.h:47