MRPT  1.9.9
mrpt::math::TPoint2D Struct Reference

Detailed Description

Lightweight 2D point.

Allows coordinate access using [] operator.

See also
mrpt::poses::CPoint2D

Definition at line 31 of file TPoint2D.h.

#include <mrpt/math/TPoint2D.h>

Inheritance diagram for mrpt::math::TPoint2D:

Public Types

enum  { static_size = 2 }
 

Public Member Functions

constexpr TPoint2D ()
 Default constructor. More...
 
constexpr TPoint2D (double xx, double yy)
 Constructor from coordinates. More...
 
constexpr TPoint2D (const TPoint2D_data &d)
 
 TPoint2D (const TPose2D &p)
 Constructor from TPose2D, discarding phi. More...
 
 TPoint2D (const TPoint3D &p)
 Constructor from TPoint3D, discarding z. More...
 
 TPoint2D (const TPose3D &p)
 Constructor from TPose3D, discarding z and the angular coordinates. More...
 
double & operator[] (size_t i)
 Coordinate access using operator[]. More...
 
constexpr const double & operator[] (size_t i) const
 Coordinate access using operator[]. More...
 
void asVector (std::vector< double > &v) const
 Transformation into vector. More...
 
bool operator< (const TPoint2D &p) const
 
TPoint2Doperator+= (const TPoint2D &p)
 
TPoint2Doperator-= (const TPoint2D &p)
 
TPoint2Doperator*= (double d)
 
TPoint2Doperator/= (double d)
 
constexpr TPoint2D operator+ (const TPoint2D &p) const
 
constexpr TPoint2D operator- (const TPoint2D &p) const
 
constexpr TPoint2D operator* (double d) const
 
constexpr TPoint2D operator/ (double d) const
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[0.02 1.04]" ) 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]" ) More...
 
double sqrNorm () const
 Squared norm: |v|^2 = x^2+y^2. More...
 
double norm () const
 Point norm: |v| = sqrt(x^2+y^2) More...
 
constexpr std::size_t rows () const
 
constexpr std::size_t cols () const
 
constexpr std::size_t size () const
 
void resize (std::size_t n)
 throws if attempted to resize to incorrect length More...
 

Public Attributes

double x
 X,Y coordinates. More...
 
double y
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 35 of file TPoint2D.h.

Constructor & Destructor Documentation

◆ TPoint2D() [1/6]

constexpr mrpt::math::TPoint2D::TPoint2D ( )
inline

Default constructor.

Initializes to zeros

Definition at line 40 of file TPoint2D.h.

◆ TPoint2D() [2/6]

constexpr mrpt::math::TPoint2D::TPoint2D ( double  xx,
double  yy 
)
inline

Constructor from coordinates.

Definition at line 42 of file TPoint2D.h.

◆ TPoint2D() [3/6]

constexpr mrpt::math::TPoint2D::TPoint2D ( const TPoint2D_data d)
inline

Definition at line 43 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x, and mrpt::math::TPoint2D_data::y.

◆ TPoint2D() [4/6]

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

Constructor from TPose2D, discarding phi.

See also
TPose2D

Definition at line 59 of file TPoseOrPoint.cpp.

◆ TPoint2D() [5/6]

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

Constructor from TPoint3D, discarding z.

See also
TPoint3D

Definition at line 64 of file TPoseOrPoint.cpp.

◆ TPoint2D() [6/6]

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

Constructor from TPose3D, discarding z and the angular coordinates.

See also
TPose3D

Definition at line 69 of file TPoseOrPoint.cpp.

Member Function Documentation

◆ asString() [1/2]

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

Returns a human-readable textual representation of the object (eg: "[0.02 1.04]" )

See also
fromString

Definition at line 143 of file TPoint2D.h.

References mrpt::format().

Here is the call graph for this function:

◆ asString() [2/2]

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

Definition at line 144 of file TPoint2D.h.

◆ asVector()

void mrpt::math::TPoint2D::asVector ( std::vector< double > &  v) const
inline

Transformation into vector.

Definition at line 90 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x, and mrpt::math::TPoint2D_data::y.

◆ cols()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TPoint2D >::cols ( ) const
inlineinherited

Definition at line 57 of file TPoseOrPoint.h.

◆ fromString()

void mrpt::math::TPoint2D::fromString ( const std::string s)

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

See also
asString
Exceptions
std::exceptionOn invalid format

Definition at line 84 of file TPoseOrPoint.cpp.

References ASSERTMSG_, mrpt::math::CMatrixDynamic< T >::cols(), mrpt::math::MatrixVectorBase< Scalar, Derived >::fromMatlabStringFormat(), mrpt::math::CMatrixDynamic< T >::rows(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ norm()

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

Point norm: |v| = sqrt(x^2+y^2)

Definition at line 162 of file TPoint2D.h.

References sqrNorm().

Referenced by mrpt::nav::collision_free_dist_segment_circ_robot(), mrpt::nav::CParameterizedTrajectoryGenerator::evalClearanceSingleObstacle(), mrpt::nav::CHolonomicND::gapsEstimator(), mrpt::nav::CHolonomicND::searchBestGap(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().

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

◆ operator*()

constexpr TPoint2D mrpt::math::TPoint2D::operator* ( double  d) const
inline

Definition at line 137 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x.

◆ operator*=()

TPoint2D& mrpt::math::TPoint2D::operator*= ( double  d)
inline

Definition at line 113 of file TPoint2D.h.

◆ operator+()

constexpr TPoint2D mrpt::math::TPoint2D::operator+ ( const TPoint2D p) const
inline

Definition at line 127 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x.

◆ operator+=()

TPoint2D& mrpt::math::TPoint2D::operator+= ( const TPoint2D p)
inline

Definition at line 99 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x.

◆ operator-()

constexpr TPoint2D mrpt::math::TPoint2D::operator- ( const TPoint2D p) const
inline

Definition at line 132 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x.

◆ operator-=()

TPoint2D& mrpt::math::TPoint2D::operator-= ( const TPoint2D p)
inline

Definition at line 106 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x.

◆ operator/()

constexpr TPoint2D mrpt::math::TPoint2D::operator/ ( double  d) const
inline

Definition at line 138 of file TPoint2D.h.

◆ operator/=()

TPoint2D& mrpt::math::TPoint2D::operator/= ( double  d)
inline

Definition at line 120 of file TPoint2D.h.

◆ operator<()

bool mrpt::math::TPoint2D::operator< ( const TPoint2D p) const

Definition at line 75 of file TPoseOrPoint.cpp.

◆ operator[]() [1/2]

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

Coordinate access using operator[].

Order: x,y

Definition at line 61 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x, and mrpt::math::TPoint2D_data::y.

◆ operator[]() [2/2]

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

Coordinate access using operator[].

Order: x,y

Definition at line 74 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::x, and mrpt::math::TPoint2D_data::y.

◆ resize()

void mrpt::math::internal::ProvideStaticResize< TPoint2D >::resize ( std::size_t  n)
inlineinherited

throws if attempted to resize to incorrect length

Definition at line 61 of file TPoseOrPoint.h.

◆ rows()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TPoint2D >::rows ( ) const
inlineinherited

Definition at line 56 of file TPoseOrPoint.h.

◆ size()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TPoint2D >::size ( ) const
inlineinherited

Definition at line 58 of file TPoseOrPoint.h.

◆ sqrNorm()

double mrpt::math::TPoint2D::sqrNorm ( ) const
inline

Squared norm: |v|^2 = x^2+y^2.

Definition at line 159 of file TPoint2D.h.

References mrpt::math::TPoint2D_data::y.

Referenced by norm().

Here is the caller graph for this function:

Member Data Documentation

◆ x

double mrpt::math::TPoint2D_data::x
inherited

X,Y coordinates.

Definition at line 23 of file TPoint2D.h.

Referenced by mrpt::slam::CGridMapAligner::AlignPDF_robustMatch(), mrpt::math::areAligned(), asVector(), mrpt::nav::CAbstractPTGBasedReactive::build_movement_candidate(), mrpt::nav::CAbstractPTGBasedReactive::calc_move_candidate_scores(), mrpt::nav::CHolonomicND::calcRepresentativeSectorForGap(), mrpt::nav::CReactiveNavigationSystem::checkCollisionWithLatestObstacles(), mrpt::nav::CReactiveNavigationSystem3D::checkCollisionWithLatestObstacles(), mrpt::nav::collision_free_dist_arc_circ_robot(), mrpt::nav::collision_free_dist_segment_circ_robot(), mrpt::math::TPose2D::composePoint(), mrpt::poses::CPose2D::composePoint(), mrpt::poses::CPosePDFGaussian::composePoint(), mrpt::poses::CPose3D::composePoint(), mrpt::maps::COccupancyGridMap2D::computeLikelihoodField_II(), mrpt::maps::COccupancyGridMap2D::computeLikelihoodField_Thrun(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_Consensus(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_ConsensusOWA(), mrpt::nav::PlannerSimple2D::computePath(), mrpt::poses::CPoint2D::CPoint2D(), mrpt::math::distance(), mrpt::nav::CParameterizedTrajectoryGenerator::evalClearanceSingleObstacle(), mrpt::nav::CHolonomicFullEval::evalSingleTarget(), mrpt::math::TLine2D::evaluatePoint(), mrpt::maps::CPointsMap::extractCylinder(), mrpt::poses::CRobot2DPoseEstimator::extrapolateRobotPose(), mrpt::vision::findMultipleChessboardsCorners(), mrpt::nav::TWaypoint::getAsText(), mrpt::math::TPolygon2D::getBoundingBox(), mrpt::math::TSegment2D::getCenter(), mrpt::math::getRectangleBounds(), mrpt::math::getSegmentBisector(), mrpt::nav::CAbstractPTGBasedReactive::impl_waypoint_is_reachable(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_GMRF(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_KernelDM_DMV(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_KF(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_KF2(), mrpt::math::TPose2D::inverseComposePoint(), mrpt::poses::CPose2D::inverseComposePoint(), mrpt::poses::CPose3D::inverseComposePoint(), mrpt::math::isLeft(), mrpt::nav::TWaypoint::isValid(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeClosestPoint2D(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeClosestPoint2DsqrError(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeNClosestPoint2D(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeNClosestPoint2DIdx(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeTwoClosestPoint2D(), mrpt::nav::CReactiveNavigationSystem3D::loggingGetWSObstaclesAndShape(), mrpt::slam::CRangeBearingKFSLAM2D::OnTransitionJacobian(), mrpt::math::operator!=(), operator*(), operator+(), mrpt::poses::operator+(), operator+=(), operator-(), operator-=(), mrpt::math::operator==(), operator[](), run_rnav_test(), mrpt::nav::CHolonomicND::searchBestGap(), mrpt::maps::CPointsMap::squareDistanceToClosestCorrespondenceT(), TEST(), mrpt::math::TLine2D::TLine2D(), TPoint2D(), mrpt::topography::transformHelmert2D(), mrpt::topography::transformHelmert2D_TOPCON(), unsafeProjectPoint(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().

◆ y

double mrpt::math::TPoint2D_data::y
inherited

Definition at line 23 of file TPoint2D.h.

Referenced by mrpt::slam::CGridMapAligner::AlignPDF_robustMatch(), mrpt::math::areAligned(), asVector(), mrpt::nav::CAbstractPTGBasedReactive::build_movement_candidate(), mrpt::nav::CAbstractPTGBasedReactive::calc_move_candidate_scores(), mrpt::nav::CHolonomicND::calcRepresentativeSectorForGap(), mrpt::nav::CReactiveNavigationSystem::checkCollisionWithLatestObstacles(), mrpt::nav::CReactiveNavigationSystem3D::checkCollisionWithLatestObstacles(), mrpt::nav::collision_free_dist_arc_circ_robot(), mrpt::nav::collision_free_dist_segment_circ_robot(), mrpt::math::TPose2D::composePoint(), mrpt::poses::CPose2D::composePoint(), mrpt::poses::CPosePDFGaussian::composePoint(), mrpt::poses::CPose3D::composePoint(), mrpt::maps::COccupancyGridMap2D::computeLikelihoodField_II(), mrpt::maps::COccupancyGridMap2D::computeLikelihoodField_Thrun(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_Consensus(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_ConsensusOWA(), mrpt::nav::PlannerSimple2D::computePath(), mrpt::math::TPolygon2D::contains(), mrpt::poses::CPoint2D::CPoint2D(), mrpt::math::distance(), mrpt::nav::CParameterizedTrajectoryGenerator::evalClearanceSingleObstacle(), mrpt::nav::CHolonomicFullEval::evalSingleTarget(), mrpt::math::TLine2D::evaluatePoint(), mrpt::maps::CPointsMap::extractCylinder(), mrpt::poses::CRobot2DPoseEstimator::extrapolateRobotPose(), mrpt::nav::TWaypoint::getAsText(), mrpt::math::TPolygon2D::getBoundingBox(), mrpt::math::TSegment2D::getCenter(), mrpt::math::getRectangleBounds(), mrpt::math::getSegmentBisector(), mrpt::nav::CAbstractPTGBasedReactive::impl_waypoint_is_reachable(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_GMRF(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_KernelDM_DMV(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_KF(), mrpt::maps::CRandomFieldGridMap2D::insertObservation_KF2(), mrpt::poses::CPose2D::inverseComposePoint(), mrpt::poses::CPose3D::inverseComposePoint(), mrpt::math::isLeft(), mrpt::nav::TWaypoint::isValid(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeClosestPoint2D(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeClosestPoint2DsqrError(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeNClosestPoint2D(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeNClosestPoint2DIdx(), mrpt::math::KDTreeCapable< CFeatureList >::kdTreeTwoClosestPoint2D(), mrpt::nav::CReactiveNavigationSystem3D::loggingGetWSObstaclesAndShape(), mrpt::slam::CRangeBearingKFSLAM2D::OnTransitionJacobian(), mrpt::math::operator!=(), mrpt::poses::operator+(), mrpt::math::operator==(), operator[](), run_rnav_test(), mrpt::nav::CHolonomicND::searchBestGap(), sqrNorm(), mrpt::maps::CPointsMap::squareDistanceToClosestCorrespondenceT(), TEST(), mrpt::math::TLine2D::TLine2D(), TPoint2D(), mrpt::topography::transformHelmert2D(), mrpt::topography::transformHelmert2D_TOPCON(), unsafeProjectPoint(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019