ISeeML  1.0
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
iSeeML::rob::DubinsPath Class Reference

This class defines Dubins' paths, made of circular arcs tangentially connected by line segments, with no back-up maneuvres, corresponding to an optimal forward-only motion with a lower bounded turning radius. More...

#include <DubinsPath.hpp>

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

Public Member Functions

 DubinsPath ()
 The default constructor should only be used for array initializations: it generates a path starting from default oriented point, with type lsl, and zero maximum curvature and lengths. More...
 
 DubinsPath (const iSeeML::rob::OrPtConfig &start, const Type &type, const double &maxCurv, const double &length1, const double &length2, const double &length3)
 The 'forward' constructor: a Dubins' path is built from its starting oriented point, its type, its maximum curvature and its parts' lengths. More...
 
 DubinsPath (const iSeeML::rob::OrPtConfig &start, const iSeeML::rob::OrPtConfig &goal, const double &maxCurv)
 The 'goto' constructor: a Dubins' path is built, starting from a given iSeeML::rob::OrPtConfig and reaching an other one with a maximum curvature. More...
 
 DubinsPath (const DubinsPath &other)
 The copy constructor. More...
 
iSeeML::Objectclone () const
 Description method, giving a copy of the current Dubins' path. More...
 
void writeTo (ostream &O) const
 Description method, writing a description of the path in a given output stream. More...
 
double turnRadius () const
 Description method, giving the radius of the turning circle (the circle of all the configurations which can be reached from a fixed one). More...
 
DubinsPathoperator= (const DubinsPath &other)
 Copy operator (default one is not correct). More...
 
void computeCenters (const iSeeML::rob::OrPtConfig &start, const iSeeML::rob::OrPtConfig &goal, iSeeML::geom::Point centers[nbTurningCircles]) const
 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::DubinsLikePath
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...
 
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...
 
- Public Member Functions inherited from iSeeML::rob::CompoundPath
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...
 
bool sameClass (const iSeeML::Object &other)
 Method verifying that a given object has the same type (same class name) than the current one. More...
 

Static Public Attributes

static const string ClassName
 The class name is public, as this class can be instanced. More...
 

Protected Member Functions

int turnNbPieces (const double &defl) const
 Description method, computing the number of pieces (0 or 1) needed for a turn of given deflection. More...
 
virtual bool getConnection (const double &dist, double &length, double &angle) const
 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...
 
void addTurn (int &index, const iSeeML::rob::OrPtConfig **start, const double &defl)
 Modification method, adding to the pieces of a path a turn starting at a given configuration, with a given curvature sign and length. More...
 
iSeeML::rob::DubinsLikePathconnectArray () const
 Various method, returning an array of nbPossiblePaths Dubins-like paths, initialised as clones of the current path. More...
 
iSeeML::rob::DubinsLikePathgetSolution (iSeeML::rob::DubinsLikePath *paths, const int index) const
 Various method, getting in an array of Dubins-like paths the element of given index. More...
 
- Protected Member Functions inherited from iSeeML::rob::DubinsLikePath
 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...
 
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)
 
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...
 
- 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...
 

Additional Inherited Members

- Public Types inherited from iSeeML::rob::DubinsLikePath
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...
 
- 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...
 
- Static Protected Member Functions inherited from iSeeML::rob::DubinsLikePath
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...
 

Detailed Description

This class defines Dubins' paths, made of circular arcs tangentially connected by line segments, with no back-up maneuvres, corresponding to an optimal forward-only motion with a lower bounded turning radius.

See also
iSeeML::rob::FscPath.
Author
Alexis Scheuer.
Version
1.0
Examples:
Fwd.cpp, LengthFwd.cpp, TimeFwd.cpp, and wxGuiFwd.cpp.

Constructor & Destructor Documentation

iSeeML::rob::DubinsPath::DubinsPath ( )
inline

The default constructor should only be used for array initializations: it generates a path starting from default oriented point, with type lsl, and zero maximum curvature and lengths.

See also
default constructor of iSeeML::rob::DubinsLikePath.
iSeeML::rob::DubinsPath::DubinsPath ( const iSeeML::rob::OrPtConfig start,
const Type type,
const double &  maxCurv,
const double &  length1,
const double &  length2,
const double &  length3 
)
inline

The 'forward' constructor: a Dubins' path is built from its starting oriented point, its type, its maximum curvature and its parts' lengths.

Parameters
startthe starting configuration,
typethe type of Dubins' path,
maxCurvthe maximum curvature along the path (taken in absolute value),
length1the length of the first part of the path,
length2the length of the second part of the path,
length3the length of the third part of the path.
iSeeML::rob::DubinsPath::DubinsPath ( const iSeeML::rob::OrPtConfig start,
const iSeeML::rob::OrPtConfig goal,
const double &  maxCurv 
)
inline

The 'goto' constructor: a Dubins' path is built, starting from a given iSeeML::rob::OrPtConfig and reaching an other one with a maximum curvature.

Parameters
startthe starting configuration,
goalthe goal configuration,
maxCurvthe maximum curvature along the path.
iSeeML::rob::DubinsPath::DubinsPath ( const DubinsPath other)
inline

The copy constructor.

Parameters
otherthe copied path.

Member Function Documentation

void iSeeML::rob::DubinsPath::addTurn ( int &  index,
const iSeeML::rob::OrPtConfig **  start,
const double &  defl 
)
protectedvirtual

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

Maximum curvature of the current Dubins' path is used.

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
the maximum curvature should not be zero. If it is, an error message is generated if ISEEML_CHECK_DUBINS_PATH_PRECOND is defined (see CompilerFlags.h).

Implements iSeeML::rob::DubinsLikePath.

iSeeML::Object& iSeeML::rob::DubinsPath::clone ( ) const
inlinevirtual

Description method, giving a copy of the current Dubins' path.

This clone is dynamically allocated (using copy constructor), it has to be deleted later.

Returns
a copy/clone of the current Dubins' path.

Implements iSeeML::Object.

void iSeeML::rob::DubinsPath::computeCenters ( const iSeeML::rob::OrPtConfig start,
const iSeeML::rob::OrPtConfig goal,
iSeeML::geom::Point  centers[nbTurningCircles] 
) const
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.

Circles' radiuses are the opposite of the maximum curvature of the current path (maximum curvature should not be zero).

Parameters
startthe starting configuration,
goalthe configuration to reach,
centersthe set of circle centers computed.
Precondition
the maximum curvature should not be zero. If it is, an error message is generated if ISEEML_CHECK_DUBINS_PATH_PRECOND is defined (see CompilerFlags.h).

Implements iSeeML::rob::DubinsLikePath.

iSeeML::rob::DubinsLikePath* iSeeML::rob::DubinsPath::connectArray ( ) const
inlineprotectedvirtual

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

Returns
the array of Dubins-like paths.

Implements iSeeML::rob::DubinsLikePath.

virtual bool iSeeML::rob::DubinsPath::getConnection ( const double &  dist,
double &  length,
double &  angle 
) const
protectedvirtual

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 computed was succesful or not (whether the distance dist2 is greater than a value depending of the path's type).

Implements iSeeML::rob::DubinsLikePath.

iSeeML::rob::DubinsLikePath& iSeeML::rob::DubinsPath::getSolution ( iSeeML::rob::DubinsLikePath paths,
const int  index 
) const
inlineprotectedvirtual

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

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). If not, an error message is generated if ISEEML_CHECK_DUBINS_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 array of Dubins-like paths.

Implements iSeeML::rob::DubinsLikePath.

DubinsPath& iSeeML::rob::DubinsPath::operator= ( const DubinsPath other)
inline

Copy operator (default one is not correct).

Parameters
otherthe path to copy.
Returns
the current path, after modification.
int iSeeML::rob::DubinsPath::turnNbPieces ( const double &  defl) const
inlineprotectedvirtual

Description method, computing the number of pieces (0 or 1) needed for a turn of given deflection.

Parameters
deflthe turn's deflection.
Returns
the number of needed pieces, which is 0 or 1.

Implements iSeeML::rob::DubinsLikePath.

double iSeeML::rob::DubinsPath::turnRadius ( ) const
inlinevirtual

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

Warning
This method returns infinity if the maximum curvature is zero (zero curvature path should not use it).
Returns
the turning circle's radius.

Implements iSeeML::rob::DubinsLikePath.

void iSeeML::rob::DubinsPath::writeTo ( ostream &  O) const
virtual

Description method, writing a description of the path in a given output stream.

Starting configuration (as an oriented point) is given, followed by a short description of each part (curvature and length), and by the final configuration.

Parameters
Othe output stream in which description is written.

Reimplemented from iSeeML::rob::CompoundPath.

Member Data Documentation

const string iSeeML::rob::DubinsPath::ClassName
static

The class name is public, as this class can be instanced.

See also
className.

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