#include <SimPolygon2D.h>
|
static bool | anyContains (const Point2 &p, const std::vector< SimPolygon2D > &obstacles) |
|
static bool | anyOverlaps (const SimPolygon2D &p, const std::vector< SimPolygon2D > &obstacles) |
|
static SimPolygon2D | createRectangle (const Point2 &p, double height, double width) |
|
static SimPolygon2D | createTriangle (const Point2 &pA, const Point2 &pB, const Point2 &pC) |
|
static bool | insideBox (double s, const Point2 &p) |
|
static bool | nearExisting (const Point2Vector &S, const Point2 &p, double threshold) |
|
static Rot2 | randomAngle () |
|
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 double | randomDistance (double mu, double sigma, double min_dist=-1.0) |
|
static Pose2 | randomFreePose (double boundary_size, const std::vector< SimPolygon2D > &obstacles) |
|
static Point2 | randomPoint2 (double s) |
|
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 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 void | seedGenerator (unsigned long seed) |
|
|
static std::minstd_rand | rng |
|
General polygon class for convex polygons
Definition at line 20 of file SimPolygon2D.h.
gtsam::SimPolygon2D::SimPolygon2D |
( |
| ) |
|
|
inline |
Don't use this constructor, use a named one instead
Definition at line 28 of file SimPolygon2D.h.
bool gtsam::SimPolygon2D::anyContains |
( |
const Point2 & |
p, |
|
|
const std::vector< SimPolygon2D > & |
obstacles |
|
) |
| |
|
static |
returns true iff p is contained in any of a set of polygons
Definition at line 106 of file SimPolygon2D.cpp.
returns true iff polygon p overlaps with any of a set of polygons
Definition at line 114 of file SimPolygon2D.cpp.
bool gtsam::SimPolygon2D::contains |
( |
const Point2 & |
p | ) |
const |
Core function for randomly generating scenarios. Polygons are closed, convex shapes.
- Returns
- true if the given point is contained by this polygon
Definition at line 68 of file SimPolygon2D.cpp.
SimPolygon2D gtsam::SimPolygon2D::createRectangle |
( |
const Point2 & |
p, |
|
|
double |
height, |
|
|
double |
width |
|
) |
| |
|
static |
Named constructor for creating axis-aligned rectangles
- Parameters
-
p | is the lower-left corner |
Definition at line 33 of file SimPolygon2D.cpp.
bool gtsam::SimPolygon2D::equals |
( |
const SimPolygon2D & |
p, |
|
|
double |
tol = 1e-5 |
|
) |
| const |
bool gtsam::SimPolygon2D::insideBox |
( |
double |
s, |
|
|
const Point2 & |
p |
|
) |
| |
|
static |
returns true iff p is inside a square centered at zero with side s
Definition at line 312 of file SimPolygon2D.cpp.
const Point2& gtsam::SimPolygon2D::landmark |
( |
size_t |
i | ) |
const |
|
inline |
bool gtsam::SimPolygon2D::nearExisting |
( |
const Point2Vector & |
S, |
|
|
const Point2 & |
p, |
|
|
double |
threshold |
|
) |
| |
|
static |
returns true iff p is within threshold of any point in S
Definition at line 317 of file SimPolygon2D.cpp.
bool gtsam::SimPolygon2D::overlaps |
( |
const SimPolygon2D & |
p | ) |
const |
Checks two polygons to determine if they overlap
- Returns
- true iff at least one vertex of one polygon is contained in the other
Definition at line 95 of file SimPolygon2D.cpp.
void gtsam::SimPolygon2D::print |
( |
const std::string & |
s = "" | ) |
const |
Rot2 gtsam::SimPolygon2D::randomAngle |
( |
| ) |
|
|
static |
Point2 gtsam::SimPolygon2D::randomBoundedPoint2 |
( |
double |
boundary_size, |
|
|
const Point2Vector & |
landmarks, |
|
|
double |
min_landmark_dist |
|
) |
| |
|
static |
pick a random point within a box that is further than dist d away from existing landmarks
Definition at line 264 of file SimPolygon2D.cpp.
Point2 gtsam::SimPolygon2D::randomBoundedPoint2 |
( |
double |
boundary_size, |
|
|
const Point2Vector & |
landmarks, |
|
|
const std::vector< SimPolygon2D > & |
obstacles, |
|
|
double |
min_landmark_dist |
|
) |
| |
|
static |
pick a random point within a box that meets above requirements, as well as staying out of obstacles
Definition at line 276 of file SimPolygon2D.cpp.
Point2 gtsam::SimPolygon2D::randomBoundedPoint2 |
( |
double |
boundary_size, |
|
|
const std::vector< SimPolygon2D > & |
obstacles |
|
) |
| |
|
static |
pick a random point in box defined by lower left and upper right corners
Definition at line 289 of file SimPolygon2D.cpp.
double gtsam::SimPolygon2D::randomDistance |
( |
double |
mu, |
|
|
double |
sigma, |
|
|
double |
min_dist = -1.0 |
|
) |
| |
|
static |
generate a distance from a normal distribution given a mean and sigma
Definition at line 237 of file SimPolygon2D.cpp.
Pose2 gtsam::SimPolygon2D::randomFreePose |
( |
double |
boundary_size, |
|
|
const std::vector< SimPolygon2D > & |
obstacles |
|
) |
| |
|
static |
pick a random pose in a bounded area that is not in an obstacle
Definition at line 307 of file SimPolygon2D.cpp.
Point2 gtsam::SimPolygon2D::randomPoint2 |
( |
double |
s | ) |
|
|
static |
pick a random point uniformly over a box of side s
Definition at line 224 of file SimPolygon2D.cpp.
SimPolygon2D gtsam::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 |
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
Definition at line 177 of file SimPolygon2D.cpp.
SimPolygon2D gtsam::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 |
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
Definition at line 122 of file SimPolygon2D.cpp.
void gtsam::SimPolygon2D::seedGenerator |
( |
unsigned long |
seed | ) |
|
|
static |
seed the random number generator - only needs to be done once
Definition at line 19 of file SimPolygon2D.cpp.
size_t gtsam::SimPolygon2D::size |
( |
| ) |
const |
|
inline |
vector< SimWall2D > gtsam::SimPolygon2D::walls |
( |
| ) |
const |
std::minstd_rand gtsam::SimPolygon2D::rng |
|
staticprotected |
The documentation for this class was generated from the following files: