Template Struct TPoint2D_
Defined in File TPoint2D.h
Inheritance Relationships
Base Types
public mrpt::math::TPoseOrPoint(Struct TPoseOrPoint)public mrpt::math::TPoint2D_data< T >(Template Struct TPoint2D_data)public mrpt::math::internal::ProvideStaticResize< TPoint2D_< T > >(Template Struct ProvideStaticResize)
Struct Documentation
-
template<typename T>
struct TPoint2D_ : public mrpt::math::TPoseOrPoint, public mrpt::math::TPoint2D_data<T>, public mrpt::math::internal::ProvideStaticResize<TPoint2D_<T>> Base template for TPoint2D (double) and TPoint2Df (float).
Represents a point (or free vector) in the 2D Euclidean space R^2. Coordinates are stored as
(x, y).This is a lightweight POD-like type intended for storage and arithmetic. When pose-point composition (i.e. applying an SE(2) rigid transformation to a point) is needed, use mrpt::poses::CPose2D or mrpt::math::TPose2D instead.
Forward declarations of all mrpt::math classes related to poses and points
See also
Note
TVector2Dis a type alias forTPoint2D(both represent elements of R^2; the alias is provided for semantic clarity when the object is a free vector rather than a position).Public Functions
-
inline constexpr TPoint2D_()
Default constructor. Initializes to zeros
-
template<typename U>
inline TPoint2D_(const TPoint2D_data<U> &p) Explicit constructor from coordinates.
-
template<typename U>
inline explicit TPoint2D_(const mrpt::math::CMatrixFixed<U, 2, 1> &m) Constructor from column vector.
-
explicit TPoint2D_(const TPose2D &p)
Constructor from TPose2D, retaining only the translational part (x,y); phi is discarded.
See also
-
explicit TPoint2D_(const TPoint3D_<T> &p)
Constructor from TPoint3D, retaining only (x,y); z is discarded.
See also
-
explicit TPoint2D_(const TPose3D &p)
Constructor from TPose3D, retaining only the translational (x,y) part; z and all angular coordinates are discarded.
See also
-
template<typename U>
inline TPoint2D_<U> cast() const Return a copy of this object using type U for coordinates
-
template<typename Vector>
inline void asVector(Vector &v) const Gets the pose as a vector of doubles.
- Template Parameters:
Vector – It can be std::vector<double>, Eigen::VectorXd, etc.
-
template<typename Vector>
inline Vector asVector() const This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
inline void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: “[0.02 1.04]” )
See also
-
inline 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]” )
See also
- Throws:
std::exception – On invalid format
Public Static Functions
Public Static Attributes
-
static constexpr std::size_t static_size = 2
-
inline constexpr TPoint2D_()