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

This class defines a standard robotic configuration, containing the position of a reference point and the orientation of a main axis. More...

#include <OrPtConfig.hpp>

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

Public Member Functions

 OrPtConfig ()
 The default constructor should only be used for array initializations: it correspond to a default point with zero orientation. More...
 
 OrPtConfig (const iSeeML::geom::Point &P, const double &theta)
 The main constructor. More...
 
 OrPtConfig (const double &x, const double &y, const double &theta)
 A usefull constructor. More...
 
virtual ~OrPtConfig ()
 The virtual destructor does nothing.
 
iSeeML::Objectclone () const
 Description method, giving a copy of the current configuration. More...
 
void writeTo (ostream &O) const
 Description method, writing the configuration in a given output stream: coordinate in each dimension is written, between paranthesis and separated by commas. More...
 
const iSeeML::geom::Pointposition () const
 Description method, giving the position of the robot's reference point in this configuration. More...
 
const double & orientation () const
 Description method, giving the orientation of the robot's main axis in this configuration. More...
 
iSeeML::geom::Vector projection (const iSeeML::geom::Point &P) const
 Gives the projection of a point in the frame of this configuration. More...
 
OrPtConfig projection (const OrPtConfig &q) const
 Projects a configuration in the frame of this configuration. More...
 
OrPtConfiguTurn ()
 Modification method, turning the current oriented point to its opposite: the position does not change but the orientation is replaced by its opposite ( $\pm$ $\pi$ is added to it). More...
 
bool operator== (const OrPtConfig &other) const
 Equality operator between oriented points. More...
 
void operator+= (const OrPtConfig &other)
 Adds an oriente point to the current one: gives the oriented point obtained when the added oriented point is considered in the current's frame. More...
 
OrPtConfig operator+ (const OrPtConfig &other) const
 Addition operator between oriented points: gives the oriented point obtained when the second oriented point is considered in the first's frame. More...
 
OrPtConfig opposite () const
 Various method, giving the opposite oriented point of the current one: the opposite oriented point has the same position but opposite orientation (current oriented point's orientation $\pm$ $\pi$). More...
 
double distance2 (const OrPtConfig &other) const
 Various method, giving the distance between two oriented points' positions. More...
 
bool isParallelTo (const OrPtConfig &other) const
 Various method, checking whether two oriented points are parallel, ie whether their orientations are equal (modulo 2 $pi$). More...
 
bool isSymmetricTo (const OrPtConfig &other) const
 Various method, checking whether two oriented points are symmetric, ie whether their orientations are symmetric wrt the line segment connecting their position. More...
 
bool isAlignedWith (const OrPtConfig &other) const
 Various method, checking whether two oriented points are aligned: their orientations should be equal, and be the same as the orientation of the segment connecting their positions. More...
 
bool hasInFront (const iSeeML::geom::Point &point) const
 Various method, checking whether a point is in the front half-plane of the current oriented point: the vector connecting the current oriented point's position to the given point should make an angle between - $\pi$/ 2 and $\pi$/ 2 with the current oriented point's orientation. 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 algDimension () const
 Description method, giving the dimension of the containing space (3) when this configuration is considered as an algebraic vector. More...
 
double algCoord (const int i) const
 Description method, giving the coordinate of given index of the configuration (both coordinates of the position, then orientation). More...
 
- Protected Member Functions inherited from iSeeML::Object
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

- 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 a standard robotic configuration, containing the position of a reference point and the orientation of a main axis.

This configuration is sufficient to define the position of most robots, and thus is enough for collision avoidance. However, taking into account dynamic constraints (as velocity and acceleration bounds) or more precise kinematic constraints (as continuity of the directing wheels' positions) generally requires a more complex configuration, as e.g. iSeeML::rob::CurvConfig.

This class contains description methods giving position and orientation of a standard configuration as well as the writeTo method, a modification method changing a standard configuration into its opposite, the equality operator, and various methods giving the opposite of a standard configuration, the distance between two standard configurations' positions or whether two such configurations verify some properties (parallelism, symmetry, alignment) or whether a point is in front of a standard configuration.

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

Constructor & Destructor Documentation

iSeeML::rob::OrPtConfig::OrPtConfig ( )
inline

The default constructor should only be used for array initializations: it correspond to a default point with zero orientation.

See also
default constructor of iSeeML::geom::Point.
iSeeML::rob::OrPtConfig::OrPtConfig ( const iSeeML::geom::Point P,
const double &  theta 
)
inline

The main constructor.

Parameters
Pthe position of the reference point,
thetathe orientation of the main axis, taken between - $\pi$ (excluded) and $\pi$ (included) modulo 2 $\pi$.
See also
iSeeML::Object::mod2pi.
iSeeML::rob::OrPtConfig::OrPtConfig ( const double &  x,
const double &  y,
const double &  theta 
)
inline

A usefull constructor.

Parameters
xthe first coordinate of the reference point,
ythe second coordinate of the reference point,
thetathe orientation of the main axis, taken between - $\pi$ (excluded) and $\pi$ (included) modulo 2 $\pi$.
See also
main constructor of iSeeML::geom::Point, iSeeML::Object::mod2pi.

Member Function Documentation

double iSeeML::rob::OrPtConfig::algCoord ( const int  i) const
inlineprotectedvirtual

Description method, giving the coordinate of given index of the configuration (both coordinates of the position, then orientation).

Parameters
ithe index of the searched coordinate.
Precondition
the parameter is an index, and should be equal to one, two or three. If not, and ISEEML_CHECK_ORPT_CONFIG_PRECOND is defined (see CompilerFlags.h), an error is generated.
Returns
the double coordinate associated to the index if this one is between 1 and dimension, or 0.
See also
orientation, position, iSeeML::geom::Point::xCoord, iSeeML::geom::Point::yCoord.

Reimplemented from iSeeML::Object.

int iSeeML::rob::OrPtConfig::algDimension ( ) const
inlineprotectedvirtual

Description method, giving the dimension of the containing space (3) when this configuration is considered as an algebraic vector.

This representation is mainly used to define a unified writeTo. Dimension cannot be static, as it is virtual.

Reimplemented from iSeeML::Object.

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

Description method, giving a copy of the current configuration.

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

Returns
a copy/clone of the current configuration.

Implements iSeeML::Object.

double iSeeML::rob::OrPtConfig::distance2 ( const OrPtConfig other) const
inline

Various method, giving the distance between two oriented points' positions.

Note : this is the standard 2-dimensional plane distance, instead of being a distance in the 3-dimensional space of the oriented points. Its name comes from this fact.

Parameters
otheranother oriented point.
Returns
the distance between the oriented points' positions.
See also
position, iSeeML::geom::Point::distance.
bool iSeeML::rob::OrPtConfig::hasInFront ( const iSeeML::geom::Point point) const
inline

Various method, checking whether a point is in the front half-plane of the current oriented point: the vector connecting the current oriented point's position to the given point should make an angle between - $\pi$/ 2 and $\pi$/ 2 with the current oriented point's orientation.

The vector going from the oriented point's position to the point and the vector of same orientation as the oriented point should have a positive scalar product.

Parameters
pointa point.
Returns
whether the given point is in the front half-plane of the current oriented point.
See also
position, orientation, iSeeML::geom::Point::operator-, iSeeML::geom::Vector::operator*(const Vector&).
bool iSeeML::rob::OrPtConfig::isAlignedWith ( const OrPtConfig other) const
inline

Various method, checking whether two oriented points are aligned: their orientations should be equal, and be the same as the orientation of the segment connecting their positions.

In fact, the oriented points are aligned iff they are simultaneously parallel and symmetric.

Parameters
otheranother oriented point.
Returns
whether the current oriented point and the given one are aligned.
See also
isParallelTo, isSymmetricTo.
bool iSeeML::rob::OrPtConfig::isParallelTo ( const OrPtConfig other) const
inline

Various method, checking whether two oriented points are parallel, ie whether their orientations are equal (modulo 2 $pi$).

Parameters
otheranother oriented point.
Returns
whether the current oriented point and the given one have same orientation.
See also
orientation, iSeeML::Object::mod2pi, iSeeML::Object::isZero.
bool iSeeML::rob::OrPtConfig::isSymmetricTo ( const OrPtConfig other) const
inline

Various method, checking whether two oriented points are symmetric, ie whether their orientations are symmetric wrt the line segment connecting their position.

The vector connecting the positions and the vector of average orientation should be collinear: their vectorial product should be zero.

Parameters
otheranother oriented point.
Returns
whether the current oriented point and the given one are symmetric.
See also
position, orientation, iSeeML::geom::Vector::operator^, iSeeML::Object::isZero.
OrPtConfig iSeeML::rob::OrPtConfig::operator+ ( const OrPtConfig other) const
inline

Addition operator between oriented points: gives the oriented point obtained when the second oriented point is considered in the first's frame.

If R = P + Q, Q = P.projection(R).

Parameters
otherthe second oriented point.
Returns
the oriented point whose projection in the first oriented point's frame is the second oriented point.
See also
OrPtConfig projection(const OrPtConfig&).
void iSeeML::rob::OrPtConfig::operator+= ( const OrPtConfig other)
inline

Adds an oriente point to the current one: gives the oriented point obtained when the added oriented point is considered in the current's frame.

If R = P + Q, Q = P.projection(R).

Parameters
otherthe second oriented point.
See also
operator+.
bool iSeeML::rob::OrPtConfig::operator== ( const OrPtConfig other) const
inline

Equality operator between oriented points.

Parameters
otheranother oriented point.
Returns
whether the two points are equal (same position and orientation).
See also
position, iSeeML::geom::Point::operator==, isParallelTo.
OrPtConfig iSeeML::rob::OrPtConfig::opposite ( ) const
inline

Various method, giving the opposite oriented point of the current one: the opposite oriented point has the same position but opposite orientation (current oriented point's orientation $\pm$ $\pi$).

Returns
the opposite oriented point of the current one.
See also
uTurn.
const double& iSeeML::rob::OrPtConfig::orientation ( ) const
inline

Description method, giving the orientation of the robot's main axis in this configuration.

Returns
the orientation of the main axis.
Examples:
wxGuiFwd.cpp.
const iSeeML::geom::Point& iSeeML::rob::OrPtConfig::position ( ) const
inline

Description method, giving the position of the robot's reference point in this configuration.

Returns
the position of the reference point.
Examples:
wxGuiFwd.cpp.
iSeeML::geom::Vector iSeeML::rob::OrPtConfig::projection ( const iSeeML::geom::Point P) const
inline

Gives the projection of a point in the frame of this configuration.

Parameters
Pthe point projected into this configuration's frame.
Returns
the vector from the origin to the projected point.
See also
iSeeML::geom::Point::operator-(const iSeeML::geom::Point&), iSeeML::geom::Vector::rotate, position, orientation.
OrPtConfig iSeeML::rob::OrPtConfig::projection ( const OrPtConfig q) const
inline

Projects a configuration in the frame of this configuration.

If R = P.projection(Q), then Q = P + R.

Parameters
qthe configuration projected into this configuration's frame.
Returns
the new configuration, once projected.
See also
OrPtConfig(const iSeeML::geom::Point&, const double&), position, projection(const iSeeML::geom::Point&), orientation, operator+.
OrPtConfig& iSeeML::rob::OrPtConfig::uTurn ( )
inline

Modification method, turning the current oriented point to its opposite: the position does not change but the orientation is replaced by its opposite ( $\pm$ $\pi$ is added to it).

Returns
the new oriented point, one transformed to its opposite.
void iSeeML::rob::OrPtConfig::writeTo ( ostream &  O) const
inlinevirtual

Description method, writing the configuration in a given output stream: coordinate in each dimension is written, between paranthesis and separated by commas.

Parameters
Othe output stream in which description is written.
See also
algWriteTo.

Implements iSeeML::Object.

Member Data Documentation

const string iSeeML::rob::OrPtConfig::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: