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

Objects of this class are Forward-only Sub-optimal Continuous-curvature (FSC) paths, made of circular arcs, pieces of clothoid and line segments. More...

#include <FscPath.hpp>

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

Public Member Functions

 FscPath ()
 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, maximum curvature's derivative and lengths. More...
 
 FscPath (const iSeeML::rob::OrPtConfig &start, const Type &type, const double &maxCurv, const double &maxCDer, const double &length1, const double &length2, const double &length3)
 The 'forward' constructor: a FSC path is built from its starting oriented point, its type, its maximum curvature, maximum curvature's derivative and parts' lengths. More...
 
 FscPath (const iSeeML::rob::OrPtConfig &start, const Type &type, const double &maxCurv, const double &maxCDer, const double &limDefl, const double &turnRad, const double &turnAng, const double &length1, const double &length2, const double &length3)
 The complete 'forward' constructor: a FSC path is built from its starting oriented point, its type, its maximum curvature, maximum curvature's derivative, limit deflection, turning radius, turning angle, and parts' lengths. More...
 
 FscPath (const iSeeML::rob::OrPtConfig &start, const iSeeML::rob::OrPtConfig &goal, const double &maxCurv, const double &maxCDer)
 The 'goto' constructor: a FSC path is built, starting from a given iSeeML::rob::OrPtConfig and reaching an other one with a maximum curvature and curvature's derivative. More...
 
 FscPath (const iSeeML::rob::OrPtConfig &start, const iSeeML::rob::OrPtConfig &goal, const double &maxCurv, const double &maxCDer, const double &limDefl, const double &turnRad, const double &turnAng)
 The complete 'goto' constructor: a FSC path is built, starting from a given iSeeML::rob::OrPtConfig and reaching an other one with a maximum curvature, curvature's derivative, limit deflection, turning radius and turning angle. More...
 
 FscPath (const FscPath &other)
 The copy constructor. More...
 
iSeeML::Objectclone () const
 Description method, giving a copy of the current FSC path. More...
 
void writeTo (ostream &O) const
 Description method, writing a description of the path in a given output stream. More...
 
double maxCurvDeriv () const
 Description method, giving the path's maximum curvature's derivative. More...
 
double limDefl () const
 Description method, giving the limit deflection: a turn of lower (but not zero) deflection is degenerated (it is made of two pieces and does not reach maximum curvature derivative nor maximum curvature), a turn of bigger deflection is normal (it is made of three pieces, the middle one being a circular arc of maximum curvature, and the other two being clothoid pieces of maximum curvature derivative). 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...
 
double turnAngle () const
 Description method, giving the constant angle between the turning circle's tangent and the orientation of the configurations which can be reached. More...
 
FscPathoperator= (const FscPath &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 Member Functions

static void computeValues (const double &maxCurv, const double &maxCDer, double &limDefl, double &turnRad, double &turnAng)
 Description method, computing from maximum curvature and maximum curvature's derivative the values of limit deflection, turning radius and turning angle for a FSC path. 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 Public Attributes

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

Protected Member Functions

bool isShortTurn (const double &defl) const
 Description method, checking whether the given length is too short with respect to the maximum curvature's derivative to reach maximum curvature along a turn. More...
 
int turnNbPieces (const double &defl) const
 Description method, computing the number of pieces 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 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

Objects of this class are Forward-only Sub-optimal Continuous-curvature (FSC) paths, made of circular arcs, pieces of clothoid and line segments.

They are similar to Dubins' paths, but their curvature have a continuous profile (pieces of clothoid connecting line segments and circular arcs).

Author
Alexis Scheuer.
Version
1.0
Examples:
Fwd.cpp, LengthFwd.cpp, TimeFwd.cpp, and wxGuiFwd.cpp.

Constructor & Destructor Documentation

iSeeML::rob::FscPath::FscPath ( )
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, maximum curvature's derivative and lengths.

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.
See also
default constructor of iSeeML::rob::DubinsLikePath.
iSeeML::rob::FscPath::FscPath ( const iSeeML::rob::OrPtConfig start,
const Type type,
const double &  maxCurv,
const double &  maxCDer,
const double &  length1,
const double &  length2,
const double &  length3 
)
inline

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

Parameters
startthe starting configuration,
typethe type of Dubins' path,
maxCurvthe maximum curvature along the path (taken in absolute value),
maxCDerthe maximum curvature's derivative 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::FscPath::FscPath ( const iSeeML::rob::OrPtConfig start,
const Type type,
const double &  maxCurv,
const double &  maxCDer,
const double &  limDefl,
const double &  turnRad,
const double &  turnAng,
const double &  length1,
const double &  length2,
const double &  length3 
)
inline

The complete 'forward' constructor: a FSC path is built from its starting oriented point, its type, its maximum curvature, maximum curvature's derivative, limit deflection, turning radius, turning angle, and parts' lengths.

Warning
this constuctor only works if limit deflection, turning radius and turning angle have been correctly computed (using method computeValues).
Parameters
startthe starting configuration,
typethe type of Dubins' path,
maxCurvthe maximum curvature along the path (taken in absolute value),
maxCDerthe maximum curvature's derivative along the path (taken in absolute value),
limDeflthe limit deflection (taken in abs. value),
turnRadthe turning radius (taken in abs. value),
turnAngthe turning angle (taken in abs. 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::FscPath::FscPath ( const iSeeML::rob::OrPtConfig start,
const iSeeML::rob::OrPtConfig goal,
const double &  maxCurv,
const double &  maxCDer 
)
inline

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

Parameters
startthe starting configuration,
goalthe goal configuration,
maxCurvthe maximum curvature along the path (taken in absolute value),
maxCDerthe maximum curvature's derivative along the path (taken in abs. value).
iSeeML::rob::FscPath::FscPath ( const iSeeML::rob::OrPtConfig start,
const iSeeML::rob::OrPtConfig goal,
const double &  maxCurv,
const double &  maxCDer,
const double &  limDefl,
const double &  turnRad,
const double &  turnAng 
)
inline

The complete 'goto' constructor: a FSC path is built, starting from a given iSeeML::rob::OrPtConfig and reaching an other one with a maximum curvature, curvature's derivative, limit deflection, turning radius and turning angle.

Warning
this constuctor only works if limit deflection, turning radius and turning angle have been correctly computed (using the method computeValues).
Parameters
startthe starting configuration,
goalthe goal configuration,
maxCurvthe maximum curvature along the path (taken in absolute value),
maxCDerthe maximum curvature's derivative along the path (taken in abs. value),
limDeflthe limit deflection (taken in abs. value),
turnRadthe turning radius (taken in abs. value),
turnAngthe turning angle (taken in abs. value).
iSeeML::rob::FscPath::FscPath ( const FscPath other)
inline

The copy constructor.

Parameters
otherthe copied path.

Member Function Documentation

void iSeeML::rob::FscPath::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 FSC 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
This method only works if the maximum curvature is not zero (otherwise, it writes an error on stderr).

Implements iSeeML::rob::DubinsLikePath.

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

Description method, giving a copy of the current FSC path.

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

Returns
a copy/clone of the current FSC path.

Implements iSeeML::Object.

void iSeeML::rob::FscPath::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.

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_FSC_PATH_PRECOND is defined (see CompilerFlags.h).

Implements iSeeML::rob::DubinsLikePath.

static void iSeeML::rob::FscPath::computeValues ( const double &  maxCurv,
const double &  maxCDer,
double &  limDefl,
double &  turnRad,
double &  turnAng 
)
static

Description method, computing from maximum curvature and maximum curvature's derivative the values of limit deflection, turning radius and turning angle for a FSC path.

If maximum curvature or curvature's derivative is too small, limit deflection is set to zero and turning radius and angle are given negative values.

Parameters
maxCurvthe maximum curvature along the path (taken in absolute value),
maxCDerthe maximum curvature's derivative along the path (taken in abs. value),
limDeflthe corresponding limit deflection,
turnRadthe corresponding turning radius,
turnAngthe corresponding turning angle.
See also
limDefl, turnRadius, turnAngle.
Examples:
LengthFwd.cpp, and TimeFwd.cpp.
iSeeML::rob::DubinsLikePath* iSeeML::rob::FscPath::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::FscPath::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::FscPath::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_FSC_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.

bool iSeeML::rob::FscPath::isShortTurn ( const double &  defl) const
inlineprotected

Description method, checking whether the given length is too short with respect to the maximum curvature's derivative to reach maximum curvature along a turn.

Parameters
deflthe turn's deflection.
Returns
true if the length is too short, else false.
double iSeeML::rob::FscPath::limDefl ( ) const
inline

Description method, giving the limit deflection: a turn of lower (but not zero) deflection is degenerated (it is made of two pieces and does not reach maximum curvature derivative nor maximum curvature), a turn of bigger deflection is normal (it is made of three pieces, the middle one being a circular arc of maximum curvature, and the other two being clothoid pieces of maximum curvature derivative).

Returns
the turning circle's radius.
Precondition
This method returns zero if the maximum curvature is zero (zero curvature path should not use it).
double iSeeML::rob::FscPath::maxCurvDeriv ( ) const
inline

Description method, giving the path's maximum curvature's derivative.

Returns
the path's maximum curvature's derivative.
FscPath& iSeeML::rob::FscPath::operator= ( const FscPath other)
inline

Copy operator (default one is not correct).

Parameters
otherthe path to copy.
Returns
the current path, after modification.
double iSeeML::rob::FscPath::turnAngle ( ) const
inline

Description method, giving the constant angle between the turning circle's tangent and the orientation of the configurations which can be reached.

Returns
the turning circle's angle.
Precondition
This method returns - $\pi$ if the maximum curvature is zero (zero curvature path should not use it).
See also
turnRadius.
int iSeeML::rob::FscPath::turnNbPieces ( const double &  defl) const
inlineprotectedvirtual

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

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

Implements iSeeML::rob::DubinsLikePath.

double iSeeML::rob::FscPath::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).

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

Implements iSeeML::rob::DubinsLikePath.

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

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

Starting configuration (as an oriented point with curvature) is given, followed by a short description of each piece (curvature's derivative 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::FscPath::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: