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 |
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 25 of file alpose2d.h.
AL::Math::Pose2D::Pose2D | ( | ) |
Create a Pose2D initialized with 0.0f.
|
explicit |
Create a Pose2D initialize with the same float.
pInit | the float value for each member |
|
explicit |
Create a Pose2D initialized with explicit value.
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.
pFloats | An std::vector<float> of size 3 for respectively: |
x, y and theta
float AL::Math::Pose2D::distance | ( | const Pose2D & | pPos2 | ) | const |
float AL::Math::Pose2D::distanceSquared | ( | const Pose2D & | pPos2 | ) | const |
|
inline |
Returns the angle of the current Pose2D.
result: $$/atan2(pose.y, pose.x)$$
Definition at line 322 of file alpose2d.h.
bool AL::Math::Pose2D::isNear | ( | const Pose2D & | pPos2, |
const float & | pEpsilon = 0.0001f |
||
) | const |
|
inline |
Compute the norm of the current Pose2D.
result: $$/sqrt(pose.x^{2} + pose.y^{2})$$
Definition at line 301 of file alpose2d.h.
Pose2D AL::Math::Pose2D::normalize | ( | ) | const |
bool AL::Math::Pose2D::operator!= | ( | const Pose2D & | pPos2 | ) | const |
Overloading of operator * for Pose2D.
pPos2 | the second Pose2D |
Definition at line 182 of file alpose2d.h.
|
inline |
Overloading of operator * for Pose2D.
pVal | the float factor |
Definition at line 206 of file alpose2d.h.
Pose2D& AL::Math::Pose2D::operator*= | ( | float | pVal | ) |
Overloading of operator *= for Pose2D.
pVal | the float factor |
Overloading of operator + for Pose2D.
pPos2 | the second Pose2D |
Definition at line 130 of file alpose2d.h.
|
inline |
Overloading of operator + for Pose2D.
Definition at line 147 of file alpose2d.h.
Overloading of operator - for Pose2D.
pPos2 | the second Pose2D |
Definition at line 139 of file alpose2d.h.
|
inline |
Overloading of operator - for Pose2D.
Definition at line 155 of file alpose2d.h.
Pose2D AL::Math::Pose2D::operator/ | ( | float | pVal | ) | const |
Overloading of operator / for Pose2D.
pVal | the float factor |
Pose2D& AL::Math::Pose2D::operator/= | ( | float | pVal | ) |
Overloading of operator /= for Pose2D.
pVal | the float factor |
bool AL::Math::Pose2D::operator== | ( | const Pose2D & | pPos2 | ) | const |
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.
float AL::Math::Pose2D::theta |
Definition at line 31 of file alpose2d.h.
float AL::Math::Pose2D::x |
Definition at line 27 of file alpose2d.h.
float AL::Math::Pose2D::y |
Definition at line 29 of file alpose2d.h.