38 Polygon(std::vector<Position> vertices);
151 Eigen::VectorXd& b)
const;
183 const int nVertices = 20);
196 const int nVertices = 20);
220 static bool sortVertices(
const Eigen::Vector2d& vector1,
221 const Eigen::Vector2d& vector2);
229 const Eigen::Vector2d& vector2);
238 const Eigen::Vector2d& pointA,
239 const Eigen::Vector2d& pointB);
251 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
static Polygon convexHullOfTwoCircles(const Position center1, const Position center2, const double radius, const int nVertices=20)
std::vector< Polygon > triangulate(const TriangulationMethods &method=TriangulationMethods::FAN) const
static double computeCrossProduct2D(const Eigen::Vector2d &vector1, const Eigen::Vector2d &vector2)
const std::string & getFrameId() const
Position getCentroid() const
static Polygon monotoneChainConvexHullOfPoints(const std::vector< Position > &points)
uint64_t timestamp_
Timestamp of the polygon (nanoseconds).
bool convertToInequalityConstraints(Eigen::MatrixXd &A, Eigen::VectorXd &b) const
static Polygon fromCircle(const Position center, const double radius, const int nVertices=20)
const Position & operator[](const size_t index) const
bool thickenLine(const double thickness)
const Position & getVertex(const size_t index) const
bool isInside(const Position &point) const
std::string frameId_
Frame id of the polygon.
void addVertex(const Position &vertex)
std::vector< Position > vertices_
Vertices of the polygon.
static Polygon convexHull(Polygon &polygon1, Polygon &polygon2)
static bool sortVertices(const Eigen::Vector2d &vector1, const Eigen::Vector2d &vector2)
void getBoundingBox(Position ¢er, Length &length) const
static double vectorsMakeClockwiseTurn(const Eigen::Vector2d &pointO, const Eigen::Vector2d &pointA, const Eigen::Vector2d &pointB)
void setFrameId(const std::string &frameId)
uint64_t getTimestamp() const
bool offsetInward(const double margin)
const std::vector< Position > & getVertices() const
void setTimestamp(const uint64_t timestamp)