ISeeML  1.0
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
iSeeML::rob::DubinsLikePath Class Referenceabstract

This class defines Dubins like paths, which are similar to Dubins paths. More...

#include <DubinsLikePath.hpp>

Inheritance diagram for iSeeML::rob::DubinsLikePath:
Inheritance graph
[legend]
Collaboration diagram for iSeeML::rob::DubinsLikePath:
Collaboration graph
[legend]

Public Types

enum  Type {
  lsl, lsr, rsl, rsr,
  lrl, rlr
}
 Dubins-like paths can be of six types: their first and last parts are turns, their middle part is tangent to the first and last parts but can be a line segment or a turn. More...
 
enum  { nbPossiblePaths = 6, nbTurningCircles = 4 }
 Some methods will need these integer values. More...
 

Public Member Functions

int nbPieces () const
 Description method, giving the number of pieces of the path. More...
 
const Typetype () const
 Description method, giving the path's type (from lsl to rlr). More...
 
const double & maxCurv () const
 Description method, giving the path's maximum curvature. More...
 
const iSeeML::rob::LinCurvPathlcPiece (const int index) const
 Description method, returning the (linear curvature) piece of the path with a given index. More...
 
virtual double turnRadius () const =0
 Description method, giving the radius of the turning circle (the circle of all the configurations which can be reached from a fixed one). More...
 
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 configurations with the shortest length (between nbPossiblePaths possibilities). More...
 
DubinsLikePathoperator= (const DubinsLikePath &other)
 Copy operator (default one is not correct). More...
 
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 current path, or to turn to reach the given goal configuration. More...
 
- Public Member Functions inherited from iSeeML::rob::CompoundPath
void writeTo (ostream &O) const
 Description method, writing a description of the path in a given output stream (the array of pieces is written). More...
 
const iSeeML::rob::OrPtConfigstart () const
 Description method, giving the path's starting configuration (first piece's starting configuration). More...
 
const iSeeML::rob::OrPtConfigend () const
 Description method, giving the path's final configuration (last piece's starting configuration). More...
 
const iSeeML::rob::BasicPathpiece (const int index) const
 Description method, returning the (constant) basic path of given index in the list of which this compound path is made. More...
 
double length () const
 Description method, giving the path's length (sum of the pieces' length). More...
 
double deflection () const
 Description method, giving the path's deflection (sum of the pieces' deflection). More...
 
iSeeML::rob::BasicPathpiece (const int index)
 Modification method, returning (for modification) the basic path of given index in the list of which this compound path is made. More...
 
iSeeML::rob::CurvConfig operator[] (const double &s) const
 Description method, giving a configuration at a given arc length along the path. More...
 
- Public Member Functions inherited from iSeeML::rob::Path
bool operator< (const Path &other) const
 Order operator, defining an order relation on the paths' set, based on the path's length. More...
 
- Public Member Functions inherited from iSeeML::Object
virtual ~Object ()
 This virtual class needs a virtual destructor.
 
virtual const string className () const
 Description method, giving the object's class name. More...
 
virtual iSeeML::Objectclone () const =0
 Description method, giving a copy of the current object. More...
 
bool sameClass (const iSeeML::Object &other)
 Method verifying that a given object has the same type (same class name) than the current one. More...
 

Protected Member Functions

 DubinsLikePath (const Type &type, const double &maxCurv)
 The structure can be filled using this constructor, which is protected (only defined for sub-classes). More...
 
 DubinsLikePath (const DubinsLikePath &other)
 The copy constructor (the default one is not correct). More...
 
 ~DubinsLikePath ()
 The destructor (the default one is not correct). More...
 
virtual int turnNbPieces (const double &length) const =0
 Description method, computing the number of pieces needed for a turn of given length. More...
 
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 and the angle between the segment connecting the turning centers and the previous one. More...
 
iSeeML::rob::LinCurvPathlcPiece (const int index)
 Modification method, returning for modification the (linear curvature) piece of the path with a given index. More...
 
void setNoPiece (const iSeeML::rob::OrPtConfig &start)
 Modification method, setting pieces of a non-valid Dubins' like path from a starting configuration (pieces array will only contain a zero length line segment). More...
 
void definePieces (const iSeeML::rob::OrPtConfig &start, const double &defl1, const double &lenDefl, const double &defl3)
 
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, with a given curvature sign and length. More...
 
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 curvature), with a given curvature's derivative and length. More...
 
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 made (no verification). More...
 
virtual DubinsLikePathconnectArray () const =0
 Various method, returning an array of nbPossiblePaths Dubins-like paths, initialised as clones of the current path. More...
 
virtual DubinsLikePathgetSolution (DubinsLikePath *paths, const int index) const =0
 Various method, getting in an array of Dubins-like paths the element of given index. More...
 
- Protected Member Functions inherited from iSeeML::rob::CompoundPath
iSeeML::rob::BasicPathgetPiece (const int index) const
 Method returning the basic path of given index in the list of which this compound path is made. More...
 
- Protected Member Functions inherited from iSeeML::Object
virtual int algDimension () const
 Description method for algebraic vectors, giving the dimension of the containing space (default is zero). More...
 
virtual double algCoord (const int) const
 Description method for algebraic vectors, giving coordinate of given index for this vector. More...
 
virtual void algWriteTo (ostream &O) const
 Description method for algebraic vectors, writing this vector in a given output stream: coordinates for each dimension are written, between paranthesis and separated by commas. More...
 

Static Protected Member Functions

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 segment whose number is given for a path of given type. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from iSeeML::Object
template<class T >
static const T & min (const T &a, const T &b)
 Method giving the minimum of two elements. More...
 
template<class T >
static const T & max (const T &a, const T &b)
 Method giving the maximum of two elements. More...
 
static double sqr (const double &x)
 Method giving the square of a double. More...
 
static double mod2pi (const double &theta)
 Method giving the angle between - $\pi$ (excluded) and $\pi$ (included), which is equal to a given angle modulo 2 $\pi$. More...
 
static double rad2deg (const double &theta)
 Method transforming an angle in radian, $x \pi$ with $x$ between -1 (excluded) and 1 (included), into its equivalent in degree, i.e. More...
 
static double deg2rad (const double &theta)
 Method transforming an angle in degree, $90 x$ with $x$ between -1 (excluded) and 1 (included), into its equivalent in radian, i.e. More...
 
static bool isPositive (const double &x)
 Method telling whether a double is strictly positive. More...
 
static bool isNegative (const double &x)
 Method telling whether a double is strictly negative. More...
 
static bool isZero (const double &x)
 Method comparing a double to zero. More...
 
static int sign (const double &x)
 Method giving the sign of a double. More...
 

Detailed Description

This class defines Dubins like paths, which are similar to Dubins paths.

A Dubins like path is made of at most three parts, which can be a turn or a straight line. Dubins paths' parts are circular arcs or line segments, with a ponctual change of curvature at each part's end, while FSC paths' turns start and finish with zero curvature. Each part is represented by one to three pieces, which are linear curvature paths.

Author
Alexis Scheuer.
Version
1.0
Examples:
wxGuiFwd.cpp.

Member Enumeration Documentation

anonymous enum

Some methods will need these integer values.

Enumerator
nbPossiblePaths 

the number of possible paths (6).

See also
Type.
nbTurningCircles 

the number of usefull turning circles (4).

Dubins-like paths can be of six types: their first and last parts are turns, their middle part is tangent to the first and last parts but can be a line segment or a turn.

Thus, Dubins-like paths' types can be named by three letters: the first and third are l or r (Left or Right turn) and the second is l, r or s (Left or Right turn, or Segment).

Enumerator
lsl 

Path made of a left turn, a straight line and a left turn.

lsr 

Path made of a left turn, a straight line and a right turn.

rsl 

Path made of a right turn, a straight line and a left turn.

rsr 

Path made of a right turn, a straight line and a right turn.

lrl 

Path made of a left turn, a right turn and a left turn.

rlr 

Path made of a right turn, a left turn and a right turn.

Constructor & Destructor Documentation

iSeeML::rob::DubinsLikePath::DubinsLikePath ( const Type type,
const double &  maxCurv 
)
inlineprotected

The structure can be filled using this constructor, which is protected (only defined for sub-classes).

No other constructor is defined, as this class is virtual.

Parameters
typethe type of Dubins' path,
maxCurvthe maximum curvature along the path (taken in absolute value).
iSeeML::rob::DubinsLikePath::DubinsLikePath ( const DubinsLikePath other)
inlineprotected

The copy constructor (the default one is not correct).

The array of pieces of the other path is copied.

Parameters
otherthe copied path.
iSeeML::rob::DubinsLikePath::~DubinsLikePath ( )
inlineprotected

The destructor (the default one is not correct).

The array of pieces of the other path is freed.

Member Function Documentation

iSeeML::rob::BasicPath& iSeeML::rob::DubinsLikePath::_piece ( const int  index) const
inlineprotectedvirtual

Virtual method returning the basic path of given index in the list of which this compound path is made (no verification).

Parameters
indexthe index of the desired piece (between 1 and the result of nbPieces).
Returns
the basic path whose index has been given.
See also
nbPieces, piece, getPiece.

Implements iSeeML::rob::CompoundPath.

void iSeeML::rob::DubinsLikePath::addPiece ( int &  index,
const iSeeML::rob::CurvConfig start,
const double &  curvDeriv,
const double &  length 
)
inlineprotected

Modification method, adding to the pieces of a path a piece starting at a given configuration (with curvature), with a given curvature's derivative and length.

Index index of the first undefined piece in the pieces array is incremented by one in this method, to remain the index of the first undefined piece in the array. Configuration start remains constant.

Parameters
indexthe first free index in the pieces array (index will be added at this index, which will be incremented),
startthe starting configuration,
curvDerivthe turn's curvature's derivative,
lengththe turn's length.
virtual void iSeeML::rob::DubinsLikePath::addTurn ( int &  index,
const iSeeML::rob::OrPtConfig **  start,
const double &  defl 
)
protectedpure virtual

Modification method, adding to the pieces of a path a turn starting at a given configuration, with a given curvature sign and length.

Index index of the first undefined piece in the pieces array is modified by this method, to remain the index of the first undefined piece in the array. Adress start of the next starting configuration is also modified along this method. Maximum curvature of the current Dubins-like path is used in this method.

Parameters
indexthe first free index in the pieces array (pieces will be added at this index and after, and the index will be incremented),
starta reference to the reference of the starting configuration (it will be changed to a ref. to the ref. of next starting config.),
deflthe turn's deflection (change of orientation), giving the curvature sign.
Precondition
This method only works if the maximum curvature is not zero (otherwise, it writes an error on stderr).

Implemented in iSeeML::rob::FscPath, and iSeeML::rob::DubinsPath.

virtual void iSeeML::rob::DubinsLikePath::computeCenters ( const iSeeML::rob::OrPtConfig start,
const iSeeML::rob::OrPtConfig goal,
iSeeML::geom::Point  centers[nbTurningCircles] 
) const
pure virtual

Various method, computing the set of circle centers used to turn from starting configuration of the current path, or to turn to reach the given goal configuration.

Parameters
startthe starting configuration,
goalthe configuration to reach,
centersthe set of nbTurningCircles circle centers computed.
Precondition
This method only works if the maximum curvature is not zero (zero curvature case is to be treated separately in constructors).

Implemented in iSeeML::rob::FscPath, and iSeeML::rob::DubinsPath.

Examples:
wxGuiFwd.cpp.
void iSeeML::rob::DubinsLikePath::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 configurations with the shortest length (between nbPossiblePaths possibilities).

Maximum curvature of the current Dubins-like path is used.

Parameters
startthe starting configuration,
goalthe goal configuration.
virtual DubinsLikePath* iSeeML::rob::DubinsLikePath::connectArray ( ) const
protectedpure virtual

Various method, returning an array of nbPossiblePaths Dubins-like paths, initialised as clones of the current path.

Returns
the array of Dubins-like paths.

Implemented in iSeeML::rob::FscPath, and iSeeML::rob::DubinsPath.

void iSeeML::rob::DubinsLikePath::definePieces ( const iSeeML::rob::OrPtConfig start,
const double &  defl1,
const double &  lenDefl,
const double &  defl3 
)
protected

Modification method, defining pieces of a Dubins-like path from a starting configuration and deflections (change of orientation, for turns) or length (for straight lines) of each part.

Warning
type and maximum curvature (at least) of the current path are used.
Parameters
startthe starting configuration,
defl1the deflection of the first part of the path,
lenDeflthe length or deflection of the second part,
defl3the deflection of the third part of the path.
Precondition
memory should not be full. If memory is full and ISEEML_CHECK_NIL_POINTER is defined (see CompilerFlags.h), an error message is generated (in this method or in setNoPiece) and the program exits.
Postcondition
Number of pieces needed is estimated for memory allocation. Pieces array is then filled using setNoPiece, addTurn and addPiece. Coherence between estimated and used number of pieces is verified if ISEEML_CHECK_DLIKE_PATH_POSTCOND is defined (see CompilerFlags.h).
See also
setNoPiece, addTurn, addPiece.
virtual bool iSeeML::rob::DubinsLikePath::getConnection ( const double &  dist,
double &  length,
double &  angle 
) const
protectedpure virtual

Description method, trying to compute the length of the line segment connecting the turning circles and the angle between the segment connecting the turning centers and the previous one.

The angle can only be computed if the square distance between the turning centers is greater than a value depending of the path's type. Length is not computed for lrl or rlr path's type, and is negative when previous angle cannot be computed.

Parameters
distthe distance between the turning centers,
lengththe length to compute (modified by the method),
anglethe angle to compute (modified by the method).
Returns
whether the computation was succesful or not (whether the distance dist2 is greater than a value depending of the path's type).

Implemented in iSeeML::rob::FscPath, and iSeeML::rob::DubinsPath.

virtual DubinsLikePath& iSeeML::rob::DubinsLikePath::getSolution ( DubinsLikePath paths,
const int  index 
) const
protectedpure virtual

Various method, getting in an array of Dubins-like paths the element of given index.

This method is virtual as the real type of the paths in the first parameter array is the same as the real type of the current Dubins-like path (either Dubins' or FSC path). Size of these paths' representation being different, access in an array needs different computations.

Parameters
pathsthe array of Dubins-like paths,
indexthe index of the searched path.
Precondition
first parameter should be an array of paths obtained using connectArray.
second parameter should be a correct index for first parameter array (between 0 and nbPossiblePaths - 1).
Returns
the array of Dubins-like paths.
See also
connectArray.

Implemented in iSeeML::rob::FscPath, and iSeeML::rob::DubinsPath.

const iSeeML::rob::LinCurvPath& iSeeML::rob::DubinsLikePath::lcPiece ( const int  index) const
inline

Description method, returning the (linear curvature) piece of the path with a given index.

Parameters
indexthe index of the desired piece (between 1 and the result of nbPiece()).
Precondition
the given index should be between one and the result of nbPieces.
Returns
the piece of the path whose index has been given.
See also
piece.
Examples:
wxGuiFwd.cpp.
iSeeML::rob::LinCurvPath& iSeeML::rob::DubinsLikePath::lcPiece ( const int  index)
inlineprotected

Modification method, returning for modification the (linear curvature) piece of the path with a given index.

Parameters
indexthe index of the desired piece (between 1 and the result of nbPiece()).
Precondition
the given index should be between one and the result of nbPieces.
Returns
the (modifiable) piece of the path whose index has been given.
See also
piece.
const double& iSeeML::rob::DubinsLikePath::maxCurv ( ) const
inline

Description method, giving the path's maximum curvature.

Returns
the path's maximum curvature.
int iSeeML::rob::DubinsLikePath::nbPieces ( ) const
inlinevirtual

Description method, giving the number of pieces of the path.

Returns
the number of pieces of the path.
Version
1.1

Implements iSeeML::rob::CompoundPath.

Examples:
wxGuiFwd.cpp.
DubinsLikePath& iSeeML::rob::DubinsLikePath::operator= ( const DubinsLikePath other)
inline

Copy operator (default one is not correct).

Parameters
otherthe path to copy.
Precondition
memory should not be full. If memory is full and ISEEML_CHECK_NULL_POINTER is defined (see CompilerFlags.h), an error message is generated and the program exits.
Returns
the current path, after modification.
void iSeeML::rob::DubinsLikePath::setNoPiece ( const iSeeML::rob::OrPtConfig start)
inlineprotected

Modification method, setting pieces of a non-valid Dubins' like path from a starting configuration (pieces array will only contain a zero length line segment).

Parameters
startthe starting configuration.
Precondition
memory should not be full. If memory is full and ISEEML_CHECK_NIL_POINTER is defined (see CompilerFlags.h), an error message is generated and the program exits.
virtual int iSeeML::rob::DubinsLikePath::turnNbPieces ( const double &  length) const
protectedpure virtual

Description method, computing the number of pieces needed for a turn of given length.

Parameters
lengththe turn's length.
Returns
the number of needed pieces.

Implemented in iSeeML::rob::FscPath, and iSeeML::rob::DubinsPath.

virtual double iSeeML::rob::DubinsLikePath::turnRadius ( ) const
pure virtual

Description method, giving the radius of the turning circle (the circle of all the configurations which can be reached from a fixed one).

Maximum curvature of the current path is used. It should not be zero, or this method will return infinity.

Returns
the turning circle's radius.

Implemented in iSeeML::rob::FscPath, and iSeeML::rob::DubinsPath.

Examples:
wxGuiFwd.cpp.
static int iSeeML::rob::DubinsLikePath::turnSign ( const int  number,
const Type type 
)
inlinestaticprotected

Description method, giving the sign (1 for left, -1 for right, 0 for a segment) of the turn or segment whose number is given for a path of given type.

As an example, a lsr type path has respective parts signs 1, 0 and -1, when a rlr type path has respective parts signs -1, 1 and -1.

Parameters
numberthe number of the part whose sign is wanted,
typethe type of the considered path.
Precondition
the given number of the part should be between 1 and 3. If not, an error message is generated if ISEEML_CHECK_DLIKE_PATH_PRECOND is defined, and the number is considered as 1 if smaller and 3 if bigger, if ISEEML_CHECK_ARRAY_ELEMT is defined (see CompilerFlags.h).
Returns
the part's sign.
const Type& iSeeML::rob::DubinsLikePath::type ( ) const
inline

Description method, giving the path's type (from lsl to rlr).

Returns
the path's type.

The documentation for this class was generated from the following file: