Function autoware_utils_geometry::random_convex_polygon

Function Documentation

Polygon2d autoware_utils_geometry::random_convex_polygon(const size_t vertices, const double max)

generate a random convex polygon

algorithm from https://cglab.ca/~sander/misc/ConvexGeneration/convex.html

Parameters:
  • vertices – number of vertices for the desired polygon

  • max – points will be generated in the range [-max,max]