libalmath  1.14
 All Classes Namespaces Functions Variables Typedefs Groups Pages
Public Member Functions | Public Attributes
AL::Math::Pose2D Struct Reference

A pose in a 2-dimentional space. More...

#include <alpose2d.h>

List of all members.

Public Member Functions

 Pose2D ()
 Create a Pose2D initialized with 0.0f.
 Pose2D (float pInit)
 Create a Pose2D initialize with the same float.
 Pose2D (float pX, float pY, float pTheta)
 Create a Pose2D initialized with explicit value.
 Pose2D (const std::vector< float > &pFloats)
 Create a Pose2D with an std::vector.
Pose2D operator+ (const Pose2D &pPos2) const
 Overloading of operator + for Pose2D.
Pose2D operator- (const Pose2D &pPos2) const
 Overloading of operator - for Pose2D.
Pose2D operator+ () const
 Overloading of operator + for Pose2D.
Pose2D operator- () const
 Overloading of operator - for Pose2D.
Pose2Doperator+= (const Pose2D &pPos2)
 Overloading of operator += for Pose2D.
Pose2Doperator-= (const Pose2D &pPos2)
 Overloading of operator -= for Pose2D.
Pose2Doperator*= (const Pose2D &pPos2)
 Overloading of operator *= for Pose2D.
Pose2D operator* (const Pose2D &pPos2) const
 Overloading of operator * for Pose2D.
bool operator== (const Pose2D &pPos2) const
 Overloading of operator == for Pose2D.
bool operator!= (const Pose2D &pPos2) const
 Overloading of operator != for Pose2D.
Pose2D operator* (float pVal) const
 Overloading of operator * for Pose2D.
Pose2D operator/ (float pVal) const
 Overloading of operator / for Pose2D.
Pose2Doperator*= (float pVal)
 Overloading of operator *= for Pose2D.
Pose2Doperator/= (float pVal)
 Overloading of operator /= for Pose2D.
float distanceSquared (const Pose2D &pPos2) const
 Compute the squared distance between the actual Pose2D and the one give in argument.
float distance (const Pose2D &pPos2) const
 Compute the distance between the actual Pose2D and the one give in argument.
Pose2D inverse () const
 Return the inverse of the Pose2D.
bool isNear (const Pose2D &pPos2, const float &pEpsilon=0.0001f) const
 Check if the actual Pose2D is near the one given in argument.
std::vector< float > toVector () const
 Return the Pose2D as a vector of float [x, y, theta].

Public Attributes

float x
float y
float theta

Detailed Description

A pose in a 2-dimentional space.

On a plane a position is totally defined by the postions x,y and the rotation theta.

Definition at line 24 of file alpose2d.h.


Constructor & Destructor Documentation

AL::Math::Pose2D::Pose2D ( )

Create a Pose2D initialized with 0.0f.

$ \left[\begin{array}{c} x \\ y \\ theta \end{array}\right] = \left[\begin{array}{c} 0.0 \\ 0.0 \\ 0.0 \end{array}\right]$

AL::Math::Pose2D::Pose2D ( float  pInit)
explicit

Create a Pose2D initialize with the same float.

$ \left[\begin{array}{c} x \\ y \\ theta \end{array}\right] = \left[\begin{array}{c} pInit \\ pInit \\ pInit \end{array}\right]$

Parameters:
pInitthe float value for each member
AL::Math::Pose2D::Pose2D ( float  pX,
float  pY,
float  pTheta 
)
explicit

Create a Pose2D initialized with explicit value.

$ \left[\begin{array}{c} x \\ y \\ theta \end{array}\right] = \left[\begin{array}{c} pX \\ pY \\ pTheta \end{array}\right]$

Parameters:
pXthe float value for x
pYthe float value for y
pThetathe float value for theta
AL::Math::Pose2D::Pose2D ( const std::vector< float > &  pFloats)

Create a Pose2D with an std::vector.

$ \left[\begin{array}{c} x \\ y \\ theta \end{array}\right] = \left[\begin{array}{c} pFloats[0] \\ pFloats[1] \\ pFloats[2] \end{array}\right]$

Parameters:
pFloatsAn std::vector<float> of size 3 for respectively:

x, y and theta


Member Function Documentation

float AL::Math::Pose2D::distance ( const Pose2D pPos2) const

Compute the distance between the actual Pose2D and the one give in argument.

$\sqrt{(pPos1.x-pPos2.x)^2+(pPos1.y-pPos2.y)^2}$

Parameters:
pPos2the second Pose2D
Returns:
the float distance between the two Pose2D
float AL::Math::Pose2D::distanceSquared ( const Pose2D pPos2) const

Compute the squared distance between the actual Pose2D and the one give in argument.

This avoids doing the sqrt needed for a true distance.

$(pPos1.x-pPos2.x)^2+(pPos1.y-pPos2.y)^2$

Parameters:
pPos2the second Pose2D
Returns:
the float squared distance between the two Pose2D
Pose2D AL::Math::Pose2D::inverse ( ) const

Return the inverse of the Pose2D.

bool AL::Math::Pose2D::isNear ( const Pose2D pPos2,
const float &  pEpsilon = 0.0001f 
) const

Check if the actual Pose2D is near the one given in argument.

Parameters:
pPos2the second Pose2D
pEpsilonan optionnal epsilon distance - default: 0.0001
Returns:
true if the distance between the two Pose2D is less than pEpsilon
bool AL::Math::Pose2D::operator!= ( const Pose2D pPos2) const

Overloading of operator != for Pose2D.

Parameters:
pPos2the second Pose2D
Pose2D AL::Math::Pose2D::operator* ( const Pose2D pPos2) const

Overloading of operator * for Pose2D.

Parameters:
pPos2the second Pose2D
Pose2D AL::Math::Pose2D::operator* ( float  pVal) const

Overloading of operator * for Pose2D.

Parameters:
pValthe float factor
Pose2D& AL::Math::Pose2D::operator*= ( const Pose2D pPos2)

Overloading of operator *= for Pose2D.

Parameters:
pPos2the second Pose2D
Pose2D& AL::Math::Pose2D::operator*= ( float  pVal)

Overloading of operator *= for Pose2D.

Parameters:
pValthe float factor
Pose2D AL::Math::Pose2D::operator+ ( const Pose2D pPos2) const

Overloading of operator + for Pose2D.

Parameters:
pPos2the second Pose2D
Pose2D AL::Math::Pose2D::operator+ ( ) const

Overloading of operator + for Pose2D.

Pose2D& AL::Math::Pose2D::operator+= ( const Pose2D pPos2)

Overloading of operator += for Pose2D.

Parameters:
pPos2the second Pose2D
Pose2D AL::Math::Pose2D::operator- ( const Pose2D pPos2) const

Overloading of operator - for Pose2D.

Parameters:
pPos2the second Pose2D
Pose2D AL::Math::Pose2D::operator- ( ) const

Overloading of operator - for Pose2D.

Pose2D& AL::Math::Pose2D::operator-= ( const Pose2D pPos2)

Overloading of operator -= for Pose2D.

Parameters:
pPos2the second Pose2D
Pose2D AL::Math::Pose2D::operator/ ( float  pVal) const

Overloading of operator / for Pose2D.

Parameters:
pValthe float factor
Pose2D& AL::Math::Pose2D::operator/= ( float  pVal)

Overloading of operator /= for Pose2D.

Parameters:
pValthe float factor
bool AL::Math::Pose2D::operator== ( const Pose2D pPos2) const

Overloading of operator == for Pose2D.

Parameters:
pPos2the second Pose2D
std::vector<float> AL::Math::Pose2D::toVector ( ) const

Return the Pose2D as a vector of float [x, y, theta].


Member Data Documentation

float AL::Math::Pose2D::theta

Definition at line 30 of file alpose2d.h.

float AL::Math::Pose2D::x

Definition at line 26 of file alpose2d.h.

float AL::Math::Pose2D::y

Definition at line 28 of file alpose2d.h.


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