128 const double total_length = borderSequence.
getLength();
168 const double dL = std::sqrt(dx*dx+dy*dy);
179 const double v = std::sqrt(dxds*dxds+dyds*dyds);
180 if(v<1.0e-10)
return false;
181 const double dvds = (ddxdss*dxds+ddydss*dyds) / v;
182 const double nx = -dyds/v;
183 const double ny = dxds/v;
184 const double kappa = (ddydss*dxds-ddxdss*dyds)/(v*v*v);
185 const double dkappads = kappa * dvds/v + (dddydsss*dxds-dddxdsss*dyds)/(v*v*v);
186 const double dkappadL = dkappads/v;
205 bool allow_backwards_steps =
false;
206 double x0,
y0,
z0,
x1,
y1,
z1,xa,xb,nx0,ny0,nx1,ny1;
207 bool xa_inside,xb_inside;
208 auto current_index = borderSequence.
beginLines();
209 auto end_index = borderSequence.
endLines();
214 auto it = current_index;
215 for(;!hit && it!=end_index;it++)
223 xa,xb,xa_inside,xb_inside);
224 hit = xa_inside&&xb_inside;
230 if(!allow_backwards_steps)current_index = it;
231 offset->
getData()(1,i) = xa*2.0*maximum_offset-maximum_offset;
A local, non-linear, smooth road coordinate system generated from a sequence of borders.
Definition: baseline.h:31
int getNSamplePoints() const
Definition: baseline.h:118
int defineOffset(BorderSequence &borderSequence, function_type_scalar *offset, double maximum_offset=10.0)
define a function, which represents the offset from baseline to the neighboring function
Definition: baseline.h:199
csaps::DoubleArray samples_dx_
Definition: baseline.h:47
void update(BorderSequence &borderSequence, double soffset)
compute fit for borderSequence
Definition: baseline.h:125
csaps::DoubleArray breaks_z_
Definition: baseline.h:44
function_type2d normal_fct_
Definition: baseline.h:67
bool valid_
Definition: baseline.h:39
void resize()
Definition: baseline.h:83
csaps::DoubleArray base_L_
Definition: baseline.h:58
csaps::DoubleArray base_kappa_
Definition: baseline.h:61
csaps::DoubleArray base_nx_
Definition: baseline.h:59
void setSmoothness(double value)
Definition: baseline.h:112
Baseline()
Definition: baseline.h:72
void setLookBehind(double value)
Definition: baseline.h:117
double getLookAhead() const
Definition: baseline.h:114
csaps::DoubleArray breaks_y_
Definition: baseline.h:43
csaps::DoubleArray samples_y_
Definition: baseline.h:50
double getLookBehind() const
Definition: baseline.h:115
csaps::DoubleArray samples_z_
Definition: baseline.h:54
function_type_scalar curvatureDerivative_fct_
Definition: baseline.h:69
double lookahead_
Definition: baseline.h:37
csaps::DoubleArray breaks_s_
Definition: baseline.h:41
csaps::DoubleArray samples_s_
Definition: baseline.h:45
bool computeDerivatives()
Definition: baseline.h:161
csaps::DoubleArray samples_dz_
Definition: baseline.h:55
int getNFitPoints() const
Definition: baseline.h:119
double fit_smoothness_
Definition: baseline.h:35
csaps::DoubleArray samples_dddy_
Definition: baseline.h:53
double min_length_
Definition: baseline.h:38
csaps::DoubleArray samples_ddz_
Definition: baseline.h:56
csaps::DoubleArray samples_dddz_
Definition: baseline.h:57
void setLookAhead(double value)
Definition: baseline.h:116
double lookbehind_
Definition: baseline.h:36
csaps::DoubleArray breaks_x_
Definition: baseline.h:42
int nFitPoints_
Definition: baseline.h:33
int nSamplesPoints_
Definition: baseline.h:34
function_type_xyz position_fct_
Definition: baseline.h:66
csaps::DoubleArray base_dkappa_
Definition: baseline.h:62
csaps::DoubleArray samples_ddx_
Definition: baseline.h:48
csaps::DoubleArray samples_dddx_
Definition: baseline.h:49
bool isValid() const
Definition: baseline.h:113
csaps::DoubleArray samples_dy_
Definition: baseline.h:51
csaps::DoubleArray samples_ddy_
Definition: baseline.h:52
function_type_scalar curvature_fct_
Definition: baseline.h:68
csaps::DoubleArray samples_x_
Definition: baseline.h:46
csaps::DoubleArray base_ny_
Definition: baseline.h:60
A class which augments a vector of Border* with some sampling features.
Definition: bordersequence.h:28
bool sample(TArray1 sample_array, int i0, int i1, TArray2 &outx, TArray2 &outy, TArray2 &outz)
step through border sequence and sample the values along the borders
Definition: bordersequence.h:57
LineIterator beginLines()
Definition: bordersequence.h:203
double getLength() const
returns the total lenght of all contained borders
Definition: bordersequence.h:36
LineIterator endLines()
Definition: bordersequence.h:204
void setData(const adoreMatrix< T, n+1, 0 > &data)
Definition: llinearpiecewisefunction.h:580
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
bool intersectLines(T a, T b, T c, T d, T e, T f, T g, T h, T &x0, T &x1, bool &x0_inside, bool &x1_inside)
Definition: adoremath.h:522
adore::mad::LLinearPiecewiseFunctionM< double, 3 > function_type_xyz
Definition: linearfunctiontypedefs.h:22
adore::mad::LLinearPiecewiseFunctionM< double, 1 > function_type_scalar
Definition: linearfunctiontypedefs.h:24
adoreMatrix< T, 1, n > linspace(T x0, T x1)
Definition: adoremath.h:91
T bound(T lb, T value, T ub)
Definition: adoremath.h:569
adore::mad::LLinearPiecewiseFunctionM< double, 2 > function_type2d
Definition: linearfunctiontypedefs.h:23
x0
Definition: adore_set_goal.py:25
y0
Definition: adore_set_goal.py:26
z0
Definition: adore_set_goal.py:27
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
z1
Definition: adore_set_pose.py:30
Definition: areaofeffectconverter.h:20
void getValue(double &x0, double &y0, double &z0, double &x1, double &y1, double &z1)
Definition: bordersequence.h:175