8 float simulationStep=BOX2DRANGE;
10 std::vector <BodyFeatures> world_objects;
14 enum CLUSTERING{BOX=0, KMEANS=1, PARTITION=2};
20 if (fabs(atan2(b1.pose.p.y, b1.pose.p.x))< fabs(atan2(b2.pose.p.y, b2.pose.p.x)) && b1.pose.p.Length()<= b2.pose.p.Length()){
27 std::pair <CoordinateContainer, bool> salientPoints(b2Transform,
const CoordinateContainer &, std::pair <Pointf, Pointf>);
36 std::vector <BodyFeatures>
processData(
const CoordinateContainer&,
const b2Transform&);
38 std::vector <BodyFeatures> cluster_data(
const CoordinateContainer &,
const b2Transform&, CLUSTERING clustering=PARTITION);
40 bool checkDisturbance(
Pointf,
bool&,
Task * curr =NULL,
float range=0.025);
42 std::vector <BodyFeatures> getFeatures(
const CoordinateContainer &, b2Transform, CLUSTERING clustering=PARTITION);
52 void buildWorld(b2World&,b2Transform, Direction,
Disturbance disturbance=
Disturbance(),
float halfWindowWidth=0.15, CLUSTERING clustering=CLUSTERING::PARTITION,
Task * task=NULL);
55 std::pair <Pointf, Pointf> bounds(Direction, b2Transform t,
float boxLength,
float halfWindowWidth,std::vector <Pointf> *_bounds=NULL);
66 b2PolygonShape
object_filtering_box(
float halfWindowWidth,
float boxLength, b2Transform start, Direction d);
69 std::pair <bool, BodyFeatures> bounding_approx_poly(std::vector <cv::Point2f>nb);
76 std::vector <std::vector<cv::Point2f>>
kmeans_clusters( std::vector <cv::Point2f>, std::vector <cv::Point2f>&);
85 b2Vec2 averagePoint(
const CoordinateContainer &,
Disturbance &,
float rad = 0.025);
99 void add_iteration(
int i=1){
103 b2Body * get_robot(b2World *);
105 b2Fixture * get_chassis(b2Body *);
107 b2AABB makeRobotSensor(b2Body*,
Disturbance *goal);
110 std::vector <BodyFeatures>& get_world_objects(){
111 return world_objects;
114 void set_world_objects(
const std::vector <BodyFeatures>& wo){
Definition: disturbance.h:45
Definition: configurator.h:17
Wrapper around cv::Point2f for customisation purposes.
Definition: sensor.h:12
Definition: worldbuilder.h:5
std::vector< std::vector< cv::Point2f > > partition_clusters(std::vector< cv::Point2f >)
Clusters points using the partition algorithm.
Definition: worldbuilder.cpp:74
std::vector< std::vector< cv::Point2f > > kmeans_clusters(std::vector< cv::Point2f >, std::vector< cv::Point2f > &)
Clusters points using k-means algorithm.
Definition: worldbuilder.cpp:58
std::vector< BodyFeatures > processData(const CoordinateContainer &, const b2Transform &)
returns a bounding box encompassing all points provided
Definition: worldbuilder.cpp:93
b2PolygonShape object_filtering_box(float halfWindowWidth, float boxLength, b2Transform start, Direction d)
Makes a box.
Definition: worldbuilder.cpp:41
void buildWorld(b2World &, b2Transform, Direction, Disturbance disturbance=Disturbance(), float halfWindowWidth=0.15, CLUSTERING clustering=CLUSTERING::PARTITION, Task *task=NULL)
Creates bodies (objects) in the box2d world.
Definition: worldbuilder.cpp:223
Definition: disturbance.h:112
Definition: worldbuilder.h:15