GTSAM
4.0.2
C++ library for smoothing and mapping (SAM)
|
#include <SimPolygon2D.h>
Public Member Functions | |
SimPolygon2D () | |
const Point2 & | landmark (size_t i) const |
size_t | size () const |
const Point2Vector & | vertices () const |
bool | equals (const SimPolygon2D &p, double tol=1e-5) const |
void | print (const std::string &s="") const |
std::vector< SimWall2D > | walls () const |
bool | contains (const Point2 &p) const |
bool | overlaps (const SimPolygon2D &p) const |
Static Public Member Functions | |
static void | seedGenerator (unsigned long seed) |
static SimPolygon2D | createTriangle (const Point2 &pA, const Point2 &pB, const Point2 &pC) |
static SimPolygon2D | createRectangle (const Point2 &p, double height, double width) |
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) |
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) |
static bool | anyContains (const Point2 &p, const std::vector< SimPolygon2D > &obstacles) |
static bool | anyOverlaps (const SimPolygon2D &p, const std::vector< SimPolygon2D > &obstacles) |
static bool | insideBox (double s, const Point2 &p) |
static bool | nearExisting (const Point2Vector &S, const Point2 &p, double threshold) |
static Point2 | randomPoint2 (double s) |
static Rot2 | randomAngle () |
static double | randomDistance (double mu, double sigma, double min_dist=-1.0) |
static Point2 | randomBoundedPoint2 (double boundary_size, const Point2Vector &landmarks, double min_landmark_dist) |
static Point2 | randomBoundedPoint2 (double boundary_size, const Point2Vector &landmarks, const std::vector< SimPolygon2D > &obstacles, double min_landmark_dist) |
static Point2 | randomBoundedPoint2 (double boundary_size, const std::vector< SimPolygon2D > &obstacles) |
static Point2 | randomBoundedPoint2 (const Point2 &LL_corner, const Point2 &UR_corner, const Point2Vector &landmarks, const std::vector< SimPolygon2D > &obstacles, double min_landmark_dist) |
static Pose2 | randomFreePose (double boundary_size, const std::vector< SimPolygon2D > &obstacles) |
Protected Attributes | |
Point2Vector | landmarks_ |
Static Protected Attributes | |
static std::minstd_rand | rng |
General polygon class for convex polygons
|
inline |
Don't use this constructor, use a named one instead
|
static |
returns true iff p is contained in any of a set of polygons
|
static |
returns true iff polygon p overlaps with any of a set of polygons
bool gtsam::SimPolygon2D::contains | ( | const Point2 & | p | ) | const |
Core function for randomly generating scenarios. Polygons are closed, convex shapes.
|
static |
Named constructor for creating axis-aligned rectangles
p | is the lower-left corner |
|
static |
Named constructor for creating triangles
|
static |
returns true iff p is inside a square centered at zero with side s
|
static |
returns true iff p is within threshold of any point in S
bool gtsam::SimPolygon2D::overlaps | ( | const SimPolygon2D & | p | ) | const |
Checks two polygons to determine if they overlap
|
static |
randomly generate a Rot2 with a uniform distribution over theta
|
static |
pick a random point within a box that is further than dist d away from existing landmarks
|
static |
pick a random point within a box that meets above requirements, as well as staying out of obstacles
|
static |
pick a random point that only avoid obstacles
|
static |
pick a random point in box defined by lower left and upper right corners
|
static |
generate a distance from a normal distribution given a mean and sigma
|
static |
pick a random pose in a bounded area that is not in an obstacle
|
static |
pick a random point uniformly over a box of side s
|
static |
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 |
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 |
seed the random number generator - only needs to be done once
std::vector<SimWall2D> gtsam::SimPolygon2D::walls | ( | ) | const |
Get a set of walls along the edges