Go to the documentation of this file.
56 constexpr
TPose2D(
double xx,
double yy,
double Phi) :
x(xx),
y(yy),
phi(Phi)
75 throw std::out_of_range(
"index out of range");
90 throw std::out_of_range(
"index out of range");
107 void asString(std::string& s)
const;
147 return (p1.
x == p2.
x) && (p1.
y == p2.
y) &&
154 return (p1.
x != p2.
x) || (p1.
y != p2.
y) ||
static constexpr TPose2D Identity()
Returns the identity transformation.
constexpr bool operator!=(const TPoint2D_< T > &p1, const TPoint2D_< T > &p2)
Exact comparison between 2D points.
Base template for TPoint3D and TPoint3Df.
constexpr bool operator==(const TPoint2D_< T > &p1, const TPoint2D_< T > &p2)
Exact comparison between 2D points.
double phi
Orientation (rads)
mrpt::math::TPose2D operator-(const mrpt::math::TPose2D &b) const
Operator "ominus" pose composition: "ret=this \ominus b".
mrpt::math::TPoint2D inverseComposePoint(const TPoint2D g) const
double norm() const
Returns the norm of the (x,y) vector (phi is not used)
T wrapTo2Pi(T a)
Modifies the given angle to translate it into the [0,2pi[ range.
T hypot_fast(const T x, const T y)
Faster version of std::hypot(), to use when overflow is not an issue and we prefer fast code.
Base type of all TPoseXX and TPointXX classes in mrpt::math.
static TPose2D FromString(const std::string &s)
constexpr TPose2D(double xx, double yy, double Phi)
Constructor from coordinates.
#define MRPT_DECLARE_TTYPENAME_NO_NAMESPACE(_TYPE, __NS)
Declares a typename to be "type" (without the NS prefix)
T wrapToPi(T a)
Modifies the given angle to translate it into the ]-pi,pi] range.
mrpt::math::TPose2D operator+(const mrpt::math::TPose2D &b) const
Operator "oplus" pose composition: "ret=this \oplus b".
void normalizePhi()
Forces "phi" to be in the range [-pi,pi].
std::string asString() const
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
void asVector(std::vector< double > &v) const
Transformation into vector.
constexpr TPose2D()=default
Default fast constructor.
Provided for STL and matrices/vectors compatibility.
double & operator[](size_t i)
Coordinate access using operator[].
constexpr double operator[](size_t i) const
Coordinate access using operator[].
This base provides a set of functions for maths stuff.
mrpt::math::TPoint2D composePoint(const TPoint2D l) const
void fromString(const std::string &s)
Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -45....
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020 | |