- Aldebaran documentation |
- C++ Libraries |
- index

libalmath 2.8.7.4

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
AL::Math::Pose2D Struct Reference
Types

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

`#include <alpose2d.h>`

## Public Member Functions
| Pose2D ()
| Create a Pose2D initialized with 0.0f. More...
| Pose2D (float pInit)
| Create a Pose2D initialize with the same float. More...
| Pose2D (float pX, float pY, float pTheta)
| Create a Pose2D initialized with explicit value. More...
| Pose2D (const std::vector< float > &pFloats)
| Create a Pose2D with an std::vector. More...
Pose2D | operator+ (const Pose2D &pPos2) const
| Overloading of operator + for Pose2D. More...
Pose2D | operator- (const Pose2D &pPos2) const
| Overloading of operator - for Pose2D. More...
Pose2D | operator+ (void) const
| Overloading of operator + for Pose2D. More...
Pose2D | operator- () const
| Overloading of operator - for Pose2D. More...
Pose2D & | operator+= (const Pose2D &pPos2)
| Overloading of operator += for Pose2D. More...
Pose2D & | operator-= (const Pose2D &pPos2)
| Overloading of operator -= for Pose2D. More...
Pose2D & | operator*= (const Pose2D &pPos2)
| Overloading of operator *= for Pose2D. More...
Pose2D | operator* (const Pose2D &pPos2) const
| Overloading of operator * for Pose2D. More...
bool | operator== (const Pose2D &pPos2) const
| Overloading of operator == for Pose2D. More...
bool | operator!= (const Pose2D &pPos2) const
| Overloading of operator != for Pose2D. More...
Pose2D | operator* (float pVal) const
| Overloading of operator * for Pose2D. More...
Pose2D | operator/ (float pVal) const
| Overloading of operator / for Pose2D. More...
Pose2D & | operator*= (float pVal)
| Overloading of operator *= for Pose2D. More...
Pose2D & | operator/= (float pVal)
| Overloading of operator /= for Pose2D. More...
float | distanceSquared (const Pose2D &pPos2) const
| Compute the squared distance between the actual Pose2D and the one give in argument. More...
float | distance (const Pose2D &pPos2) const
| Compute the distance between the actual Pose2D and the one give in argument. More...
Pose2D | inverse () const
| Return the inverse of the Pose2D More...
Pose2D | diff (const Pose2D &pPos2) const
| Compute the Pose2D between the actual Pose2D and the one given in argument: More...
bool | isNear (const Pose2D &pPos2, const float &pEpsilon=0.0001f) const
| Check if the actual Pose2D is near the one given in argument. More...
void | toVector (std::vector< float > &pReturnVector) const
| Return the Pose2D as a vector of float [x, y, theta]. More...
std::vector< float > | toVector (void) const
void | writeToVector (std::vector< float >::iterator &pIt) const
| Write [x, y, theta] in the vector and update the iterator. It is assumed the vector has enough space. More...
float | norm () const
| Compute the norm of the current Pose2D. More...
Pose2D | normalize () const
| Normalize the current Pose2D position. More...
float | getAngle (void) const
| Returns the angle of the current Pose2D. More...

## Static Public Member Functions
static Pose2D | fromPolarCoordinates (const float pRadius, const float pAngle)
| Create a Pose2D from polar coordinates. More...

## 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 26 of file alpose2d.h.

## Constructor & Destructor Documentation

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

Create a Pose2D initialized with 0.0f.

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

Create a Pose2D initialize with the same float.

Parameters

  pInit | the float value for each member

AL::Math::Pose2D::Pose2D | ( | float | pX,
|  | float | pY,
|  | float | pTheta
| ) |  |
| explicit

Create a Pose2D initialized with explicit value.

Parameters

  pX | the float value for x
  pY | the float value for y
  pTheta | the float value for theta

AL::Math::Pose2D::Pose2D | ( | const std::vector< float > & | pFloats | ) |

Create a Pose2D with an std::vector.

Parameters

  pFloats | An std::vector<float> of size 3 for respectively:

x, y and theta

## Member Function Documentation

Pose2D AL::Math::Pose2D::diff | ( | const Pose2D & | pPos2 | ) | const

Compute the Pose2D between the actual Pose2D and the one given in argument:

result: inverse(pPos1)*pPos2

Parameters

  pPos2 | the second Pose2D

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

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

Parameters

  pPos2 | the 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.

Parameters

  pPos2 | the second Pose2D

Returns
  the float squared distance between the two Pose2D

float AL::Math::Pose2D::getAngle | ( | void |  | ) | const
| inline

Returns the angle of the current Pose2D.

result: $$/atan2(pose.y, pose.x)$$

Definition at line 323 of file alpose2d.h.

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

  pPos2 | the second Pose2D
  pEpsilon | an optionnal epsilon distance - default: 0.0001

Returns
  true if the distance between the two Pose2D is less than pEpsilon

float AL::Math::Pose2D::norm | ( |  | ) | const
| inline

Compute the norm of the current Pose2D.

result: $$/sqrt(pose.x^{2} + pose.y^{2})$$

Definition at line 302 of file alpose2d.h.

Pose2D AL::Math::Pose2D::normalize | ( |  | ) | const

Normalize the current Pose2D position.

Returns
  the Pose2D normalized

bool AL::Math::Pose2D::operator!= | ( | const Pose2D & | pPos2 | ) | const

Overloading of operator != for Pose2D.

Parameters

  pPos2 | the second Pose2D

Pose2D AL::Math::Pose2D::operator* | ( | const Pose2D & | pPos2 | ) | const
| inline

Overloading of operator * for Pose2D.

Parameters

  pPos2 | the second Pose2D

Definition at line 183 of file alpose2d.h.

Pose2D AL::Math::Pose2D::operator* | ( | float | pVal | ) | const
| inline

Overloading of operator * for Pose2D.

Parameters

  pVal | the float factor

Definition at line 207 of file alpose2d.h.

Pose2D& AL::Math::Pose2D::operator*= | ( | const Pose2D & | pPos2 | ) |

Overloading of operator *= for Pose2D.

Parameters

  pPos2 | the second Pose2D

Pose2D& AL::Math::Pose2D::operator*= | ( | float | pVal | ) |

Overloading of operator *= for Pose2D.

Parameters

  pVal | the float factor

Pose2D AL::Math::Pose2D::operator+ | ( | const Pose2D & | pPos2 | ) | const
| inline

Overloading of operator + for Pose2D.

Parameters

  pPos2 | the second Pose2D

Definition at line 131 of file alpose2d.h.

Pose2D AL::Math::Pose2D::operator+ | ( | void |  | ) | const
| inline

Overloading of operator + for Pose2D.

Definition at line 148 of file alpose2d.h.

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

Overloading of operator += for Pose2D.

Parameters

  pPos2 | the second Pose2D

Pose2D AL::Math::Pose2D::operator- | ( | const Pose2D & | pPos2 | ) | const
| inline

Overloading of operator - for Pose2D.

Parameters

  pPos2 | the second Pose2D

Definition at line 140 of file alpose2d.h.

Pose2D AL::Math::Pose2D::operator- | ( |  | ) | const
| inline

Overloading of operator - for Pose2D.

Definition at line 156 of file alpose2d.h.

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

Overloading of operator -= for Pose2D.

Parameters

  pPos2 | the second Pose2D

Pose2D AL::Math::Pose2D::operator/ | ( | float | pVal | ) | const

Overloading of operator / for Pose2D.

Parameters

  pVal | the float factor

Pose2D& AL::Math::Pose2D::operator/= | ( | float | pVal | ) |

Overloading of operator /= for Pose2D.

Parameters

  pVal | the float factor

bool AL::Math::Pose2D::operator== | ( | const Pose2D & | pPos2 | ) | const

Overloading of operator == for Pose2D.

Parameters

  pPos2 | the second Pose2D

void AL::Math::Pose2D::toVector | ( | std::vector< float > & | pReturnVector | ) | const

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

std::vector<float> AL::Math::Pose2D::toVector | ( | void |  | ) | const

void AL::Math::Pose2D::writeToVector | ( | std::vector< float >::iterator & | pIt | ) | const

Write [x, y, theta] in the vector and update the iterator. It is assumed the vector has enough space.

## Member Data Documentation

float AL::Math::Pose2D::theta

Definition at line 32 of file alpose2d.h.

float AL::Math::Pose2D::x

Definition at line 28 of file alpose2d.h.

float AL::Math::Pose2D::y

Definition at line 30 of file alpose2d.h.

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

- /home/opennao/work/release-2.8/lib/libalmath/almath/types/alpose2d.h