12 using namespace gtsam;
17 TEST(testPolygon, triangle_basic) {
30 vector<SimWall2D> actWalls = actTriangle.
walls();
31 vector<SimWall2D> expWalls;
50 TEST(testPolygon, rectangle_basic) {
53 double height = 3.0, width = 2.0;
54 Point2 pA(1.0, 0.0),
pB(3.0, 0.0), pC(3.0, 3.0), pD(1.0, 3.0);
57 SimPolygon2D actRectangle = SimPolygon2D::createRectangle(
pA, height, width);
65 vector<SimWall2D> actWalls = actRectangle.
walls();
66 vector<SimWall2D> expWalls;
87 TEST(testPolygon, triangle_generator) {
89 double side_len = 10.0;
90 double mean_side_len = 2.0;
91 double sigma_side_len = 0.5;
92 double min_vertex_dist = 0.4;
93 double min_side_len = 0.1;
96 SimPolygon2D::seedGenerator(42u);
98 vector<SimPolygon2D> existing_polys;
100 SimPolygon2D actual = SimPolygon2D::randomTriangle(side_len, mean_side_len, sigma_side_len,
101 min_vertex_dist, min_side_len, existing_polys);
104 SimPolygon2D bounding_rect = SimPolygon2D::createRectangle(
Point2(-5.0,-5.0), side_len, side_len);
112 TEST(testPolygon, rectangle_generator) {
114 double side_len = 10.0;
115 double mean_side_len = 2.0;
116 double sigma_side_len = 0.5;
117 double min_vertex_dist = 0.4;
118 double min_side_len = 0.1;
121 SimPolygon2D::seedGenerator(42u);
123 vector<SimPolygon2D> existing_polys;
125 SimPolygon2D actual = SimPolygon2D::randomRectangle(side_len, mean_side_len, sigma_side_len,
126 min_vertex_dist, min_side_len, existing_polys);
129 SimPolygon2D bounding_rect = SimPolygon2D::createRectangle(
Point2(-5.0,-5.0), side_len, side_len);
Provides additional testing facilities for common data structures.
std::vector< SimWall2D > walls() const
static int runAllTests(TestResult &result)
TEST(testPolygon, triangle_basic)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
const Point2 & landmark(size_t i) const
Polygons for simulation use.
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool assert_container_equal(const std::map< V1, V2 > &expected, const std::map< V1, V2 > &actual, double tol=1e-9)
#define LONGS_EQUAL(expected, actual)
bool contains(const Point2 &p) const