ebertolazzi / Clothoids

Other
109 stars 50 forks source link

[Usage] ClothoidList #16

Closed yiakwy closed 4 years ago

yiakwy commented 4 years ago

Hi, I read codes implemented in src-mex and I found some problems

No codes about evaluation method and neither ant of evaluation method is explained.

For example

std::shared<ClothoidList> c(new ClothoidList);
G2lib::G2solve3arc solver;
int iter = solver.build(...);
if (iter > 0)
{
c->init();
c->reserve(3);
c->push_back(solver.getS0());
c->push_back(solver.getSM());
c->push_back(solver.getS1());
}

// evaluate it
#define ClothoidList G2LIB_CLASS

G2LIB_CLASS * ptr = c.get();

double X, Y;
ptr->eval_ISO(s, t, X, Y); // ? ptr->eval_ISO(s, X, Y)

I am confused about eval_ISO(s,t, X,Y) (see src_mex/mex_common.hxx, line 644). Considering that I am only interested in the c++ implementation what should I use to predict the curve?

@ebertolazzi Thank you for your work.

ebertolazzi commented 4 years ago

Sorry I do not understand the question.

There are a lot of way to evaluate the point on a clothoids, look at http://ebertolazzi.github.io/Clothoids/. All the classes can evaluate X, Y or XY directly with derivative or not. When you use (s,t) (two parameter) the second is the offset along the normal of the curve using ISO direction or SAE (opposite) direction.

Why use

std::shared c(new ClothoidList)

instead of

ClothoidList c;

which is most natural and do not require explicit destroy action?