15 for (
unsigned int i = 0; i <=
TYPE_MAX; ++i)
17 return static_cast<Type>(i);
24 if (type <= TYPE_MAX && type >= 0)
36 const Eigen::Vector4d &
color)
42 if (dimensions.size() != 2)
46 if (dimensions.size() != 1)
58 const Eigen::Vector4d &
color)
64 const Eigen::Vector4d &
color)
67 if (points.
size() < 3)
96 const Eigen::Vector4d &
color)
114 for (
const auto &p :
points)
115 ss <<
"(" << p(0) <<
"," << p(1) <<
")";
Eigen::Isometry2d offset
Offset of geometry from base frame.
Eigen::VectorXd dimensions
The geometry's dimensions.
const Type type
Type of geometry.
bool isSimple(const Geometry &geometry)
Checks if a polygon is simple, that is, it has no holes.
std::string printFrame(const Eigen::Isometry2d &frame)
Returns a string "[x, y, t]" of the translation (x, y) and rotation (t) component of a transform...
tf::EigenVector< Eigen::Vector2d > points
Point list for polygons.
static const unsigned int TYPE_MAX
Maximum value a geometry type can have.
static Type stringToType(const std::string &geometry)
Try to convert a string into a geometry type. Not case-sensitive.
double transformDistance(const Eigen::Isometry2d &t1, const Eigen::Isometry2d &t2=Eigen::Isometry2d::Identity(), double alpha=0.75)
Return the transform distance between two transformations, w is the weight of the euclidean distance...
static const std::string & typeToString(const Type &type)
Converts a geometry type into its string representation.
A shared pointer wrapper for se2ez::Geometry.
Eigen::Isometry2d toIsometry(double x, double y, double theta)
Converts a translation (x, y) and rotation from X-axis (theta) into a transform.
A simple polygon (no holes).
void makeCounterClockwise(Geometry &geometry)
If not counterclockwise, reorders polygon vertices to be in counterclockwise orientation.
Geometry(const GeometryPtr &g)
Constructor.
std::string printVector(const Eigen::VectorXd &v, unsigned int precision=4)
Returns a string of a vector's contents.
bool isOffset
Is this geometry offset?
bool isConvex(const Geometry &geometry)
Checks if a polygon is convex.
static const std::string TYPE_STRINGS[]
String representation of geometry type.
std::string printGeometry() const
Returns a string representation of the geometry.
Eigen::Vector4d color
The color to display this geometry as.