Main MRPT website > C++ reference
MRPT logo
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes

Detailed Description

Lightweight 2D pose.

Allows coordinate access using [] operator.

See also
mrpt::poses::CPose2D

Definition at line 183 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

 TPose2D (const TPoint2D &p)
 Implicit constructor from TPoint2D. More...
 
 TPose2D (const TPoint3D &p)
 Constructor from TPoint3D, losing information. More...
 
 TPose2D (const TPose3D &p)
 Constructor from TPose3D, losing information. More...
 
 TPose2D (const mrpt::poses::CPose2D &p)
 Implicit constructor from heavyweight type. More...
 
 TPose2D (double xx, double yy, double pphi)
 Constructor from coordinates. More...
 
 TPose2D ()
 Default fast constructor. More...
 
double & operator[] (size_t i)
 Unsafe coordinate access using operator[]. More...
 
const double & operator[] (size_t i) const
 Unsafe coordinate access using operator[]. More...
 
void getAsVector (vector_double &v) const
 Transformation into vector. More...
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[x y yaw]", yaw in degrees) More...
 
std::string asString () const
 
void fromString (const std::string &s)
 Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -45.0]" ) More...
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

double x
 X coordinate. More...
 
double y
 Y coordinate. More...
 
double phi
 Phi coordinate. More...
 

Constructor & Destructor Documentation

◆ TPose2D() [1/6]

mrpt::math::TPose2D::TPose2D ( const TPoint2D p)

Implicit constructor from TPoint2D.

Zeroes the phi coordinate.

See also
TPoint2D

◆ TPose2D() [2/6]

mrpt::math::TPose2D::TPose2D ( const TPoint3D p)
explicit

Constructor from TPoint3D, losing information.

Zeroes the phi coordinate.

See also
TPoint3D

◆ TPose2D() [3/6]

mrpt::math::TPose2D::TPose2D ( const TPose3D p)
explicit

Constructor from TPose3D, losing information.

The phi corresponds to the original pose's yaw.

See also
TPose3D

◆ TPose2D() [4/6]

mrpt::math::TPose2D::TPose2D ( const mrpt::poses::CPose2D p)

Implicit constructor from heavyweight type.

See also
mrpt::poses::CPose2D

◆ TPose2D() [5/6]

mrpt::math::TPose2D::TPose2D ( double  xx,
double  yy,
double  pphi 
)
inline

Constructor from coordinates.

Definition at line 219 of file lightweight_geom_data.h.

◆ TPose2D() [6/6]

mrpt::math::TPose2D::TPose2D ( )
inline

Default fast constructor.

Initializes to garbage.

Definition at line 223 of file lightweight_geom_data.h.

Member Function Documentation

◆ asString() [1/2]

void mrpt::math::TPose2D::asString ( std::string &  s) const
inline

Returns a human-readable textual representation of the object (eg: "[x y yaw]", yaw in degrees)

See also
fromString

Definition at line 246 of file lightweight_geom_data.h.

References mrpt::mrpt::format(), and RAD2DEG.

◆ asString() [2/2]

std::string mrpt::math::TPose2D::asString ( ) const
inline

Definition at line 247 of file lightweight_geom_data.h.

References asString().

Referenced by asString().

◆ fromString()

void mrpt::math::TPose2D::fromString ( const std::string &  s)

Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -45.0]" )

See also
asString
Exceptions
std::exceptionOn invalid format

◆ getAsVector()

void mrpt::math::TPose2D::getAsVector ( vector_double v) const
inline

Transformation into vector.

Definition at line 239 of file lightweight_geom_data.h.

References mrpt::dynamicsize_vector< T >::resize().

◆ operator[]() [1/2]

double& mrpt::math::TPose2D::operator[] ( size_t  i)
inline

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 227 of file lightweight_geom_data.h.

◆ operator[]() [2/2]

const double& mrpt::math::TPose2D::operator[] ( size_t  i) const
inline

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 233 of file lightweight_geom_data.h.

◆ size()

static size_t mrpt::math::TPose2D::size ( )
inlinestatic

Definition at line 254 of file lightweight_geom_data.h.

Member Data Documentation

◆ phi

double mrpt::math::TPose2D::phi

◆ x

double mrpt::math::TPose2D::x

◆ y

double mrpt::math::TPose2D::y



Page generated by Doxygen 1.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo