28 typedef std::vector<adore::env::BorderBased::Coordinate>
TR2SGeometry;
68 std::vector<int> distinct;
70 distinct.push_back(0);
80 for(
int i = 0;i<distinct.size();i++)
95 std::vector<int> distinct;
107 for(
int i = 0;i<distinct.size();i++)
198 std::vector<int> distinct;
200 distinct.push_back(0);
210 for(
int i = 0;i<distinct.size();i++)
256 std::vector<TFunctionTypePair> value;
259 auto fun = (*it).first;
260 if(fun->f(fun->limitLo())(0)==
x && fun->f(fun->limitLo())(1)==
y)
262 value.push_back(*it);
269 std::vector<TFunctionTypePair> value;
272 auto fun = (*it).first;
273 if(fun->f(fun->limitHi())(0)==
x && fun->f(fun->limitHi())(1)==
y)
275 value.push_back(*it);
283 geometry->
getData()(0,0) = 0.0;
284 for(
int i = 1; i<geometry->
getData().nc(); i++)
287 geometry->
getData()(0,i) = geometry->
getData()(0,i-1) + c1.distance(c2);
300 functions_.push_back(std::make_pair(
function,type));
310 std::vector<TFunctionTypePair> value;
313 auto fun = (*it).first;
314 if(fun->limitLo() <=
x && fun->limitHi() >=
x)
316 value.push_back(*it);
344 if(
x0!=fun->limitLo() ||
x1!=fun->limitHi())
346 fun->stretchDomain(
x0,
x1);
347 intervals.insert(
x0);
348 intervals.insert(
x1);
352 if(intervals.size()>=2)
354 auto s_start0 = *intervals.begin();
355 auto s_end1 = *intervals.rbegin();
359 if(functions.size()<1)
362 for(
auto f = functions.begin(); f!=functions.end(); f++)
365 fun->stretchDomain(
x0,fun->limitHi());
367 intervals.insert(
x0);
372 if(functions.size()<1)
375 for(
auto f = functions.begin(); f!=functions.end(); f++)
378 fun->stretchDomain(fun->limitLo(),
x1);
380 intervals.insert(
x1);
396 if(!((*it).first==
nullptr))
426 adoreMatrix<double,0,0> m;
427 m.set_size(3,geometry.size());
429 m(1,0) = geometry.at(0).m_X;
430 m(2,0) = geometry.at(0).m_Y;
431 for(
int i = 1; i<geometry.size(); i++)
433 m(0,i) = m(0,i-1)+geometry.at(i).distance(geometry.at(i-1));
434 m(1,i) = geometry.at(i).m_X;
435 m(2,i) = geometry.at(i).m_Y;
465 if(
referenceLine_ ==
nullptr)
throw(
"Section::referenceLine_ is undefined.");
473 if(abs(d) > 0.05)
break;
475 auto p_start = fun->
f(fun->
limitLo());
476 auto p_end = fun->
f(fun->
limitHi());
477 double d_start, d_end;
500 LOG_T(
"p_start: (%.2f|%.2f)",p_start(0),p_start(1));
501 LOG_T(
"p_end : (%.2f|%.2f)",p_end(0),p_end(1));
502 LOG_T(
"s_start: %.2f",s_start);
503 LOG_T(
"s_end : %.2f",s_end);
storage class to access different functions by their domain intervals
Definition: r2sauxiliary.h:250
std::vector< TFunctionTypePair > functions_
Definition: r2sauxiliary.h:252
void resetSParameter(TGeometryFunction *geometry)
Definition: r2sauxiliary.h:280
void addFunction(TGeometryFunction *function, LaneBorder::TYPE type)
add function to container
Definition: r2sauxiliary.h:298
std::vector< TFunctionTypePair > getFunctions()
getter method
Definition: r2sauxiliary.h:326
std::vector< TFunctionTypePair > getFunctionsStartingAtPoint(double x, double y)
Definition: r2sauxiliary.h:254
void mend(TGeometryFunction *refLine, std::set< double > &intervals)
try to repair some mistakes that might occur due to matching to closest point on refline
Definition: r2sauxiliary.h:336
std::vector< TFunctionTypePair > getFunctionsEndingAtPoint(double x, double y)
Definition: r2sauxiliary.h:267
std::vector< TFunctionTypePair > getFunctionsAtParameter(double x)
returns functions that are valid at the given parameter
Definition: r2sauxiliary.h:308
void deleteFunctions()
delete function objects
Definition: r2sauxiliary.h:392
directed borders, ordered from center line to outer border
Definition: r2sauxiliary.h:244
std::set< double > intervals_
Definition: r2sauxiliary.h:416
std::vector< TFunctionTypePair > getLeftFunctionsAtParameter(double x)
get functions that are valid at given parameter
Definition: r2sauxiliary.h:530
FunctionMap functionMapLeft_
storage for functions originally in the opposite direction as the reference line, stored in functions...
Definition: r2sauxiliary.h:413
FunctionMap functionMapRight_
storage for functions in the same directions as the reference line
Definition: r2sauxiliary.h:408
std::vector< TFunctionTypePair > getRightFunctionsAtParameter(double x)
get functions that are valid at given parameter
Definition: r2sauxiliary.h:520
TGeometryFunction * geometry2function(TR2SGeometry geometry)
easy conversion from a coordinate vector to a LLinearPiecewiseFunction
Definition: r2sauxiliary.h:424
void cleanup()
delete objects in pointers
Definition: r2sauxiliary.h:547
bool oneway_
Definition: r2sauxiliary.h:414
Section()
Definition: r2sauxiliary.h:443
FunctionMap getFunctionMapRight()
getter
Definition: r2sauxiliary.h:567
TGeometryFunction * getReferenceLineFunction()
getter
Definition: r2sauxiliary.h:539
void mend()
try to repair mistakes that occured during function generation
Definition: r2sauxiliary.h:557
std::set< double > getIntervals()
getter
Definition: r2sauxiliary.h:510
FunctionMap getFunctionMapLeft()
getter
Definition: r2sauxiliary.h:576
void addLaneBorder(LaneBorder lb)
add lane border to section, determine its valid range
Definition: r2sauxiliary.h:463
TGeometryFunction * referenceLine_
Definition: r2sauxiliary.h:415
void setReferenceLine(ReferenceLine rl)
setter
Definition: r2sauxiliary.h:453
~Section()
Definition: r2sauxiliary.h:584
bool isOneway()
Definition: r2sauxiliary.h:580
virtual CT f(DT x) const override
Definition: llinearpiecewisefunction.h:251
double getClosestParameter(T px, T py, int d1, int d2, T &n_min) const
Definition: llinearpiecewisefunction.h:1014
virtual void stretchDomain(DT x0, DT x1)
Definition: llinearpiecewisefunction.h:344
virtual void invertDomain()
Definition: llinearpiecewisefunction.h:320
virtual DT limitLo() const override
Definition: llinearpiecewisefunction.h:264
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
virtual DT limitHi() const override
Definition: llinearpiecewisefunction.h:259
#define LOG_T(...)
log on trace level
Definition: csvlog.h:28
@ OTHER
Definition: border.h:38
@ DRIVING
Definition: border.h:39
std::vector< LaneBorder > TLaneBorderVector
Definition: r2sauxiliary.h:236
std::pair< TGeometryFunction *, LaneBorder::TYPE > TFunctionTypePair
Definition: r2sauxiliary.h:238
adore::mad::LLinearPiecewiseFunctionM< double, 2 > TGeometryFunction
Definition: r2sauxiliary.h:237
std::vector< ReferenceLine > TReferenceLineVector
Definition: r2sauxiliary.h:235
std::vector< adore::env::BorderBased::Coordinate > TR2SGeometry
Definition: r2sauxiliary.h:28
adore::mad::LLinearPiecewiseFunctionM< double, 3 > function_type_xyz
Definition: linearfunctiontypedefs.h:22
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
x0
Definition: adore_set_goal.py:25
x
Definition: adore_set_goal.py:30
y
Definition: adore_set_goal.py:31
x1
Definition: adore_set_pose.py:28
Definition: areaofeffectconverter.h:20
This struct identifies a Border by the coordinates of the starting and the end point.
Definition: borderid.h:31
double distance(const BorderID &other) const
returns sum of distance between this.m_first and other.m_first and distance between this....
Definition: borderid.h:51
The border struct contains data of the smallest.
Definition: border.h:62
BorderType::TYPE m_type
Definition: border.h:71
BorderID * m_left
Definition: border.h:69
This struct represents 3-dimensional coordines.
Definition: coordinate.h:34
basic storage struct for lane borders from file
Definition: r2sauxiliary.h:143
adore::env::BorderBased::BorderID getBorderID() const
Definition: r2sauxiliary.h:169
TYPE type_
Definition: r2sauxiliary.h:158
TYPE
Definition: r2sauxiliary.h:145
@ DRIVING
Definition: r2sauxiliary.h:147
@ TOWN
Definition: r2sauxiliary.h:152
@ NONE
Definition: r2sauxiliary.h:146
@ SHOULDER
Definition: r2sauxiliary.h:150
@ PARKING
Definition: r2sauxiliary.h:149
@ BIKE
Definition: r2sauxiliary.h:148
@ RESTRICTED
Definition: r2sauxiliary.h:151
@ OTHER
Definition: r2sauxiliary.h:153
int parent_id_
Definition: r2sauxiliary.h:156
adore::env::BorderBased::Border * getBorder(const adore::env::BorderBased::BorderID &leftID) const
Definition: r2sauxiliary.h:222
double distance(const ReferenceLine &rl) const
Definition: r2sauxiliary.h:190
bool isOnRightHandSide(const ReferenceLine &rl) const
Definition: r2sauxiliary.h:173
int id_
Definition: r2sauxiliary.h:155
adore::mad::function_type_xyz * getBorderPath() const
Definition: r2sauxiliary.h:195
bool isSane() const
Definition: r2sauxiliary.h:165
double sortingDistance(const ReferenceLine &rl) const
Definition: r2sauxiliary.h:178
LaneBorder()
Definition: r2sauxiliary.h:159
TR2SGeometry geometry_
Definition: r2sauxiliary.h:157
basic storage struct for ReferenceLine from file
Definition: r2sauxiliary.h:35
adore::env::BorderBased::Border * getBorder() const
Definition: r2sauxiliary.h:119
adore::env::BorderBased::BorderID getInverseBorderID() const
Definition: r2sauxiliary.h:61
adore::mad::function_type_xyz * getInverseBorderPath() const
Definition: r2sauxiliary.h:92
int id_
Definition: r2sauxiliary.h:41
LINETYPE
Definition: r2sauxiliary.h:37
@ StandardLine
Definition: r2sauxiliary.h:38
@ ConnectionLine
Definition: r2sauxiliary.h:39
adore::mad::function_type_xyz * getBorderPath() const
Definition: r2sauxiliary.h:65
LINETYPE linetype_
Definition: r2sauxiliary.h:44
bool isSane() const
Definition: r2sauxiliary.h:52
bool oneway_
Definition: r2sauxiliary.h:43
ReferenceLine()
Definition: r2sauxiliary.h:46
TR2SGeometry geometry_
Definition: r2sauxiliary.h:42
adore::env::BorderBased::BorderID getBorderID() const
Definition: r2sauxiliary.h:57
adore::env::BorderBased::Border * getInverseBorder() const
Definition: r2sauxiliary.h:128