Class Point

Inheritance Relationships

Derived Type

Class Documentation

class Point

Represents a Point in 2D and contains useful tools to perform operations with them, also to convert them to ROS msgs.

Subclassed by Vector

Public Functions

Point()
Point(const double &x, const double &y)
template<typename T>
Point(const T &point)
Point operator+(const Point &p) const
Point operator-(const Point &p) const
template<typename T>
Point operator*(const T &num) const
template<typename T>
Point operator/(const T &num) const
Point &operator+=(const Point &p)
Point &operator-=(const Point &p)
template<typename T>
Point &operator*=(const T &num)
template<typename T>
Point &operator/=(const T &num)
Point transformed(const Eigen::Affine3d &tf) const

Returns the tranformed Point with an Eigen::Affine3d.

Parameters:

tf[in]

geometry_msgs::msg::Point gmPoint() const

Converts the point to a geometry_msgs::msg::Point.

const double &at(const size_t &ind) const

Returns the coordinate of the position specified by ind.

Parameters:

ind[in]

size_t size() const

Returns 2.

Public Members

double x
double y

Public Static Functions

static inline double distSq(const Point &p1, const Point &p2 = Point())

Performs the squared Euclidean distance between two Point(s).

Parameters:
  • p1[in]

  • p2[in]

static inline double dist(const Point &p1, const Point &p2 = Point())

Performs the Euclidean distance between two Point(s).

Parameters:
  • p1[in]

  • p2[in]

static inline bool ccw(const Point &A, const Point &B, const Point &C)

Checks if the orientation of ordered triplet (A, B, C) is counterclockwise.

Parameters:
  • A[in]

  • B[in]

  • C[in]

static inline bool segmentsIntersect(const Point &A, const Point &B, const Point &C, const Point &D)

Checks if line segments defined by AB and CD intersect.

Parameters:
  • A[in]

  • B[in]

  • C[in]

  • D[in]

Friends

friend std::ostream &operator<<(std::ostream &os, const Point &p)

Prints a Point.

Parameters:
  • os[inout]

  • p[in]