Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
mrpt::math::TPose2D Struct Reference

Detailed Description

Lightweight 2D pose.

Allows coordinate access using [] operator.

See also
mrpt::poses::CPose2D

Definition at line 194 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Types

enum  { static_size = 3 }
 

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)
 Coordinate access using operator[]. More...
 
const double & operator[] (size_t i) const
 Coordinate access using operator[]. More...
 
void getAsVector (std::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
 
mrpt::math::TPose2D operator+ (const mrpt::math::TPose2D &b) const
 Operator "oplus" pose composition: "ret=this \oplus b". More...
 
mrpt::math::TPose2D operator- (const mrpt::math::TPose2D &b) const
 Operator "ominus" pose composition: "ret=this \ominus b". More...
 
void composePoint (const TPoint2D l, TPoint2D &g) const
 
void inverseComposePoint (const TPoint2D g, TPoint2D &l) const
 
double norm () const
 Returns the norm of the (x,y) vector (phi is not used) More...
 
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,Y coordinates. More...
 
double y
 
double phi
 Orientation (rads) More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 196 of file lightweight_geom_data.h.

Constructor & Destructor Documentation

◆ TPose2D() [1/6]

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

Implicit constructor from TPoint2D.

Zeroes the phi coordinate.

See also
TPoint2D

Definition at line 72 of file lightweight_geom_data.cpp.

◆ TPose2D() [2/6]

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

Constructor from TPoint3D, losing information.

Zeroes the phi coordinate.

See also
TPoint3D

Definition at line 73 of file lightweight_geom_data.cpp.

◆ 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

Definition at line 74 of file lightweight_geom_data.cpp.

◆ TPose2D() [4/6]

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

Implicit constructor from heavyweight type.

See also
mrpt::poses::CPose2D

Definition at line 75 of file lightweight_geom_data.cpp.

◆ TPose2D() [5/6]

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

Constructor from coordinates.

Definition at line 228 of file lightweight_geom_data.h.

◆ TPose2D() [6/6]

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

Default fast constructor.

Initializes to garbage.

Definition at line 234 of file lightweight_geom_data.h.

Member Function Documentation

◆ asString() [1/2]

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

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

See also
fromString

Definition at line 79 of file lightweight_geom_data.cpp.

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

Referenced by mrpt::nav::CAbstractPTGBasedReactive::calc_move_candidate_scores(), and mrpt::nav::CAbstractPTGBasedReactive::performNavigationStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asString() [2/2]

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

Definition at line 280 of file lightweight_geom_data.h.

◆ composePoint()

void mrpt::math::TPose2D::composePoint ( const TPoint2D  l,
TPoint2D g 
) const
inline

Definition at line 291 of file lightweight_geom_data.h.

References phi, mrpt::math::TPoint2D::x, and mrpt::math::TPoint2D::y.

◆ 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

Definition at line 83 of file lightweight_geom_data.cpp.

References ASSERTMSG_, DEG2RAD, phi, mrpt::mrpt::math::size(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ getAsVector()

void mrpt::math::TPose2D::getAsVector ( std::vector< double > &  v) const
inline

Transformation into vector.

Definition at line 268 of file lightweight_geom_data.h.

References phi, x, and y.

◆ inverseComposePoint()

void mrpt::math::TPose2D::inverseComposePoint ( const TPoint2D  g,
TPoint2D l 
) const
inline

◆ norm()

double mrpt::math::TPose2D::norm ( ) const
inline

Returns the norm of the (x,y) vector (phi is not used)

Definition at line 305 of file lightweight_geom_data.h.

References mrpt::mrpt::math::hypot_fast().

Here is the call graph for this function:

◆ operator+()

mrpt::math::TPose2D mrpt::math::TPose2D::operator+ ( const mrpt::math::TPose2D b) const

Operator "oplus" pose composition: "ret=this \oplus b".

See also
CPose2D

Definition at line 95 of file lightweight_geom_data.cpp.

References mrpt::math::wrapToPi().

Here is the call graph for this function:

◆ operator-()

mrpt::math::TPose2D mrpt::math::TPose2D::operator- ( const mrpt::math::TPose2D b) const

Operator "ominus" pose composition: "ret=this \ominus b".

See also
CPose2D

Definition at line 107 of file lightweight_geom_data.cpp.

References mrpt::math::wrapToPi().

Here is the call graph for this function:

◆ operator[]() [1/2]

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

Coordinate access using operator[].

Order: x,y,phi

Definition at line 236 of file lightweight_geom_data.h.

References phi, x, and y.

◆ operator[]() [2/2]

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

Coordinate access using operator[].

Order: x,y,phi

Definition at line 251 of file lightweight_geom_data.h.

References phi, x, and y.

◆ size()

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

Definition at line 312 of file lightweight_geom_data.h.

Referenced by mrpt::maps::CPointsMap::determineMatching2D().

Here is the caller graph for this function:

Member Data Documentation

◆ phi

double mrpt::math::TPose2D::phi

Orientation (rads)

Definition at line 203 of file lightweight_geom_data.h.

Referenced by asString(), mrpt::nav::CAbstractPTGBasedReactive::calc_move_candidate_scores(), mrpt::obs::carmen_log_parse_line(), composePoint(), mrpt::maps::COccupancyGridMap2D::determineMatching2D(), mrpt::poses::CRobot2DPoseEstimator::extrapolateRobotPose(), fromString(), getAsVector(), mrpt::poses::CRobot2DPoseEstimator::getCurrentEstimate(), mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentGTVelLocal(), mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentOdometricVelLocal(), mrpt::hwdrivers::CRovio::getPosition(), mrpt::slam::CICP::ICP_Method_Classic(), mrpt::maps::CPointsMap::internal_computeObservationLikelihood(), mrpt::kinematics::CVehicleSimul_Holo::internal_simulControlStep(), mrpt::kinematics::CVehicleSimul_DiffDriven::internal_simulControlStep(), inverseComposePoint(), mrpt::graphs::detail::graph_ops< graph_t >::load_graph_of_poses_from_text_file(), mrpt::nav::CParameterizedTrajectoryGenerator::loadFromConfigFile(), mrpt::math::operator!=(), mrpt::math::operator<<(), mrpt::math::operator==(), mrpt::math::operator>>(), operator[](), mrpt::nav::CParameterizedTrajectoryGenerator::saveToConfigFile(), mrpt::tfest::se2_l2(), mrpt::kinematics::CVehicleSimul_Holo::sendVelCmd(), mrpt::kinematics::CVehicleSimulVirtualBase::simulateOneTimeStep(), mrpt::nav::PlannerRRT_SE2_TPS::solve(), mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().

◆ x

double mrpt::math::TPose2D::x

◆ y

double mrpt::math::TPose2D::y



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019