General polygon class for convex polygons.
|
|
static void | seedGenerator (unsigned long seed) |
| | seed the random number generator - only needs to be done once
|
|
static SimPolygon2D | createTriangle (const Point2 &pA, const Point2 &pB, const Point2 &pC) |
| | Named constructor for creating triangles.
|
| static SimPolygon2D | createRectangle (const Point2 &p, double height, double width) |
| | Named constructor for creating axis-aligned rectangles.
|
|
static SimPolygon2D | randomTriangle (double side_len, double mean_side_len, double sigma_side_len, double min_vertex_dist, double min_side_len, const std::vector< SimPolygon2D > &existing_polys) |
| | Randomly generate a triangle that does not conflict with others Uniformly distributed over box area, with normally distributed lengths of edges THROWS: std::runtime_error if can't find a position.
|
|
static SimPolygon2D | randomRectangle (double side_len, double mean_side_len, double sigma_side_len, double min_vertex_dist, double min_side_len, const std::vector< SimPolygon2D > &existing_polys) |
| | Randomly generate a rectangle that does not conflict with others Uniformly distributed over box area, with normally distributed lengths of edges THROWS: std::runtime_error if can't find a position.
|
|
static bool | anyContains (const Point2 &p, const std::vector< SimPolygon2D > &obstacles) |
| | returns true iff p is contained in any of a set of polygons
|
|
static bool | anyOverlaps (const SimPolygon2D &p, const std::vector< SimPolygon2D > &obstacles) |
| | returns true iff polygon p overlaps with any of a set of polygons
|
|
static bool | insideBox (double s, const Point2 &p) |
| | returns true iff p is inside a square centered at zero with side s
|
|
static bool | nearExisting (const Point2Vector &S, const Point2 &p, double threshold) |
| | returns true iff p is within threshold of any point in S
|
|
static Point2 | randomPoint2 (double s) |
| | pick a random point uniformly over a box of side s
|
|
static Rot2 | randomAngle () |
| | randomly generate a Rot2 with a uniform distribution over theta
|
|
static double | randomDistance (double mu, double sigma, double min_dist=-1.0) |
| | generate a distance from a normal distribution given a mean and sigma
|
|
static Point2 | randomBoundedPoint2 (double boundary_size, const Point2Vector &landmarks, double min_landmark_dist) |
| | pick a random point within a box that is further than dist d away from existing landmarks
|
|
static Point2 | randomBoundedPoint2 (double boundary_size, const Point2Vector &landmarks, const std::vector< SimPolygon2D > &obstacles, double min_landmark_dist) |
| | pick a random point within a box that meets above requirements, as well as staying out of obstacles
|
|
static Point2 | randomBoundedPoint2 (double boundary_size, const std::vector< SimPolygon2D > &obstacles) |
| | pick a random point that only avoid obstacles
|
|
static Point2 | randomBoundedPoint2 (const Point2 &LL_corner, const Point2 &UR_corner, const Point2Vector &landmarks, const std::vector< SimPolygon2D > &obstacles, double min_landmark_dist) |
| | pick a random point in box defined by lower left and upper right corners
|
|
static Pose2 | randomFreePose (double boundary_size, const std::vector< SimPolygon2D > &obstacles) |
| | pick a random pose in a bounded area that is not in an obstacle
|