8 #ifndef ISEEML_DUBINS_LIKE_PATH_HH
9 #define ISEEML_DUBINS_LIKE_PATH_HH
13 #include <iSeeML/rob/CompoundPath.hpp>
15 #include <iSeeML/rob/LinCurvPath.hpp>
75 static const string ClassName;
89 double MaximumCurvature;
103 NbPieces(0), LcPieces(NULL), PathType(
type),
104 MaximumCurvature(fabs(
maxCurv)) {}
113 NbPieces(0), LcPieces(NULL) { *
this = other; }
147 { {1, 1, -1, -1, 1, -1}, {0, 0, 0, 0, -1, 1},
148 {1, -1, 1, -1, 1, -1} };
149 #ifdef ISEEML_CHECK_DLIKE_PATH_PRECOND
150 if ( (number < 1) || (number > 3) )
151 cerr << ClassName <<
"::turnSign: abnormal number "
155 #ifdef ISEEML_CHECK_ARRAY_ELEMT
156 number < 1 ? 0 : (number > 3) ? 2 :
159 return(values[nb][(
int)
type]); }
177 const double&
maxCurv()
const {
return MaximumCurvature; }
241 double& angle)
const = 0;
283 void reset(
const int newNbPieces,
287 if (LcPieces != NULL)
delete[] LcPieces;
288 #ifdef ISEEML_CHECK_DLIKE_PATH_PRECOND
290 cerr << ClassName <<
"::reset: negative nb of pieces,"
291 << endl <<
" considered as zero!" << endl;
293 NbPieces = newNbPieces > 0 ? newNbPieces : 0;
296 #ifdef ISEEML_CHECK_NULL_POINTER
297 if (LcPieces == NULL) {
298 cerr << ClassName <<
"reset: out of memory!!!" << endl;
301 ISEEML_ROB_COMPATH_forall_pieces(i)
lcPiece(i) = stdPath; }
354 (
start, 0), 0, 0) ); }
387 const double& defl1,
const double& lenDefl,
388 const double& defl3);
417 virtual void addTurn(
int& index,
419 const double& defl) = 0;
438 const double& curvDeriv,
const double&
length) {
474 if (LcPieces != NULL)
delete[] LcPieces;
477 #ifdef ISEEML_CHECK_NULL_POINTER
478 if (LcPieces == NULL) {
479 cerr << ClassName <<
"operator=: out of memory!!!"
482 ISEEML_ROB_COMPATH_forall_pieces(i)
486 MaximumCurvature = other.
maxCurv();
return *
this; }
514 return LcPieces[index - 1]; }
570 const int ls = test ?
lsl :
lsr;
573 const int rs = test ?
rsl :
rsr;
576 const int ccc = test ?
lrl :
rlr;
579 const int csc = test ? ls : rs;
582 const int best = test ? csc : ccc;
587 #endif // end of definition
virtual double turnRadius() const =0
Description method, giving the radius of the turning circle (the circle of all the configurations whi...
iSeeML::rob::LinCurvPath & lcPiece(const int index)
Modification method, returning for modification the (linear curvature) piece of the path with a given...
Definition: DubinsLikePath.hpp:260
double length() const
Description method, giving the path's length (sum of the pieces' length).
Definition: CompoundPath.hpp:126
const iSeeML::rob::BasicPath & piece(const int index) const
Description method, returning the (constant) basic path of given index in the list of which this comp...
Definition: CompoundPath.hpp:114
This class defines a more precise configuration than classical ones for mobile robots.
Definition: CurvConfig.hpp:30
void connect(const iSeeML::rob::OrPtConfig &start, const iSeeML::rob::OrPtConfig &goal)
Modification method, defining type and pieces of a Dubins' like path in order to connect two given co...
@ rsr
Path made of a right turn, a straight line and a right turn.
Definition: DubinsLikePath.hpp:55
@ rsl
Path made of a right turn, a straight line and a left turn.
Definition: DubinsLikePath.hpp:53
DubinsLikePath & operator=(const DubinsLikePath &other)
Copy operator (default one is not correct).
Definition: DubinsLikePath.hpp:471
This class defines a standard robotic configuration, containing the position of a reference point and...
Definition: OrPtConfig.hpp:45
@ nbTurningCircles
the number of usefull turning circles (4).
Definition: DubinsLikePath.hpp:66
~DubinsLikePath()
The destructor (the default one is not correct).
Definition: DubinsLikePath.hpp:120
Type
Dubins-like paths can be of six types: their first and last parts are turns, their middle part is tan...
Definition: DubinsLikePath.hpp:47
virtual bool getConnection(const double &dist, double &length, double &angle) const =0
Description method, trying to compute the length of the line segment connecting the turning circles a...
@ lrl
Path made of a left turn, a right turn and a left turn.
Definition: DubinsLikePath.hpp:57
const Type & type() const
Description method, giving the path's type (from lsl to rlr).
Definition: DubinsLikePath.hpp:171
DubinsLikePath(const Type &type, const double &maxCurv)
The structure can be filled using this constructor, which is protected (only defined for sub-classes)...
Definition: DubinsLikePath.hpp:102
const iSeeML::rob::LinCurvPath & lcPiece(const int index) const
Description method, returning the (linear curvature) piece of the path with a given index.
Definition: DubinsLikePath.hpp:194
This class defines Dubins like paths, which are similar to Dubins paths.
Definition: DubinsLikePath.hpp:33
virtual int turnNbPieces(const double &length) const =0
Description method, computing the number of pieces needed for a turn of given length.
const iSeeML::rob::OrPtConfig & start() const
Description method, giving the path's starting configuration (first piece's starting configuration).
Definition: CompoundPath.hpp:79
virtual DubinsLikePath & getSolution(DubinsLikePath *paths, const int index) const =0
Various method, getting in an array of Dubins-like paths the element of given index.
This class defines superclass of basic paths, from which compound paths can be built.
Definition: BasicPath.hpp:21
virtual void addTurn(int &index, const iSeeML::rob::OrPtConfig **start, const double &defl)=0
Modification method, adding to the pieces of a path a turn starting at a given configuration,...
static int turnSign(const int number, const Type &type)
Description method, giving the sign (1 for left, -1 for right, 0 for a segment) of the turn or segmen...
Definition: DubinsLikePath.hpp:145
int nbPieces() const
Description method, giving the number of pieces of the path.
Definition: DubinsLikePath.hpp:164
iSeeML::rob::BasicPath & _piece(const int index) const
Virtual method returning the basic path of given index in the list of which this compound path is mad...
Definition: DubinsLikePath.hpp:512
DubinsLikePath(const DubinsLikePath &other)
The copy constructor (the default one is not correct).
Definition: DubinsLikePath.hpp:112
This class defines 2D geometric points, defined by their Cartesian coordinates.
Definition: Point.hpp:29
@ lsl
Path made of a left turn, a straight line and a left turn.
Definition: DubinsLikePath.hpp:49
void setNoPiece(const iSeeML::rob::OrPtConfig &start)
Modification method, setting pieces of a non-valid Dubins' like path from a starting configuration (p...
Definition: DubinsLikePath.hpp:352
@ lsr
Path made of a left turn, a straight line and a right turn.
Definition: DubinsLikePath.hpp:51
virtual DubinsLikePath * connectArray() const =0
Various method, returning an array of nbPossiblePaths Dubins-like paths, initialised as clones of the...
virtual void computeCenters(const iSeeML::rob::OrPtConfig &start, const iSeeML::rob::OrPtConfig &goal, iSeeML::geom::Point centers[nbTurningCircles]) const =0
Various method, computing the set of circle centers used to turn from starting configuration of the c...
const double & maxCurv() const
Description method, giving the path's maximum curvature.
Definition: DubinsLikePath.hpp:177
@ nbPossiblePaths
the number of possible paths (6).
Definition: DubinsLikePath.hpp:64
This class defines compound (or complex, or composed) paths, which are made of a set of basic paths.
Definition: CompoundPath.hpp:28
void addPiece(int &index, const iSeeML::rob::CurvConfig &start, const double &curvDeriv, const double &length)
Modification method, adding to the pieces of a path a piece starting at a given configuration (with c...
Definition: DubinsLikePath.hpp:437
This class defines linear curvature elementary paths, for which the curvature derivative (with respec...
Definition: LinCurvPath.hpp:27
@ rlr
Path made of a right turn, a left turn and a right turn.
Definition: DubinsLikePath.hpp:59