LocalGuidance
A library that generates velocity references to follow a path.
robot_utils::geometry::Tetragon Class Reference

#include <Tetragon.hpp>

Inheritance diagram for robot_utils::geometry::Tetragon:
Inheritance graph

Public Member Functions

 Tetragon (const VertexList &vertices, robot_utils::geometry::VertexOrder vertexOrder)
 
 ~Tetragon () override=default
 
- Public Member Functions inherited from robot_utils::geometry::Polygon
 Polygon ()
 
 Polygon (const VertexList &vertices, robot_utils::geometry::VertexOrder vertexOrder=robot_utils::geometry::VertexOrder::Undefined)
 
 Polygon (VertexList &&vertices, robot_utils::geometry::VertexOrder vertexOrder=robot_utils::geometry::VertexOrder::Undefined)
 
 Polygon (const Position2d &vertexCenter, unsigned int numOfVertices, double polygonSize)
 
 Polygon (const Position2d &vertexCenter, unsigned int numOfVertices, double polygonSize, const Eigen::Matrix2d &RotationMatrix2d)
 
 Polygon (const Polygon &polygon)
 
 Polygon (Polygon &&rhs)=default
 
Polygonoperator= (const Polygon &rhs)
 
Polygonoperator= (Polygon &&rhs)=default
 
virtual ~Polygon ()=default
 
virtual double getArea () const
 Get the area of the polygon (is negative if order is clock wise). More...
 
double getPerimeter () const
 Get the perimeter of the polygon. More...
 
size_t getNumVertices () const
 Get the number of vertices. More...
 
void setVertex (const Position2d &vertex, unsigned int vertexId)
 Copy a vertex to the vertex list at a specific index. More...
 
const Position2dgetVertex (unsigned int vertexId) const
 Copy a vertex to the vertex list at a specific index. More...
 
void pushVertex (const Position2d &vertex)
 Add a vertex to the vertex list. More...
 
bool reorderVertices (VertexOrder vertexOrder)
 Reorder the vertices in clockwise or counter-clockwise order. More...
 
VertexOrder getVertexOrder () const
 Get the order in which the vertices are stored. More...
 
virtual bool updateLineCoefficients ()
 Compute the line coefficients of all edges of the polygon. More...
 
const LineCoefficientListgetLineCoefficients () const
 Get the set of line coefficients of all edges of the polygon. More...
 
const VertexListgetVertices () const
 Get the set of vertices. More...
 
virtual bool isPointInPolygon (const Position2d &point, double tol=1e-6) const
 Check if a point is in the polygon. More...
 
bool resizePolygonTowardsInCenter (double lengthLineToLine)
 The edges of the polygon are moved with towards the incenter with a certain distance. More...
 
bool resizeVerticesTowardsCentroid (double percent)
 The polygon center is defined to be the centroid (average of all vertices). Vertices are. More...
 
bool resizeAreaTriangleBased (double percent)
 For each polygon, we extract one (random) triangle and move its vertices towards the incenter. More...
 
void resetVertices (unsigned int numOfVertices=0u)
 Emtpy the vertex list. More...
 
void print () const
 Print information about the polygon. More...
 
bool computePolygonCentroid (Eigen::Vector2d &center) const
 Compute centroid (polygon center). More...
 

Additional Inherited Members

- Public Types inherited from robot_utils::geometry::Polygon
using VertexList = std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d >>
 
using LineCoefficientList = std::vector< std::vector< double >>
 
- Static Public Member Functions inherited from robot_utils::geometry::Polygon
static bool doPolygonsIntersect (const Polygon &polygonA, const Polygon &polygonB)
 
static void projectPolygonToRange (const Polygon &polygon, const Position2d &axisDirection, Eigen::Vector2d &range)
 Project the vertices of a polygon to a scalar range directed along an axis. More...
 
static bool doRangesOverlap (const Position2d &rangeA, const Position2d &rangeB)
 Check if two scalar ranges A = {a, b} and B = {c, d} overlap. More...
 
- Protected Attributes inherited from robot_utils::geometry::Polygon
VertexList vertices_
 A list of vertices. More...
 
robot_utils::geometry::VertexOrder vertexOrder_
 The order in which the vertices are stored. More...
 
LineCoefficientList lineCoefficients_
 The set of coefficients of the edges of the polygon. More...
 

Constructor & Destructor Documentation

robot_utils::geometry::Tetragon::Tetragon ( const VertexList vertices,
robot_utils::geometry::VertexOrder  vertexOrder 
)
robot_utils::geometry::Tetragon::~Tetragon ( )
overridedefault

The documentation for this class was generated from the following file: