libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
geometricComputations.hpp
1 #ifndef GEOMETRICTOOLS_HPP
2 #define GEOMETRICTOOLS_HPP
3 
4 #include "P3d-pkg.h"
5 #include "API/Device/robot.hpp"
6 #include "Logging/Logger.h"
7 
8 
10 
11 
13 {
14  MOVE3D_STATIC_LOGGER;
15 public:
17 
18  p3d_point getRandomPointInTriangle(p3d_point A, p3d_point B, p3d_point C);
19 
20 
27  p3d_point getRandomPointInRectangle(p3d_point A, p3d_point B, p3d_point C, p3d_point D);
28 
32  std::vector<p3d_point> getLowerPointsInObject(Robot* obj, double steepness);
33 
37  std::vector<p3d_point> getUpperPointsInObject(Robot* obj, double steepness);
38 
39 
43  p3d_point getCenterOfObj(Robot* obje);
44 
48  p3d_point getBotomCenterOfObj(Robot* obje, double threshhold);
49 
50  double compute_triangle_area_x_y2(p3d_point a, p3d_point b, p3d_point c);
51 
58  bool point_in_rect2(p3d_point a, p3d_point b, p3d_point c, p3d_point d, p3d_point x);
59 
63  bool point_in_segment2d(p3d_point a, p3d_point b, p3d_point x);
64 
68  double distBetweenPoints(p3d_point a, p3d_point b);
69 
73  double distBetweenMatrix4(p3d_matrix4 a, p3d_matrix4 b);
74 
78  double distBetweenPoints2D(p3d_point a, p3d_point b);
79 
83  bool hexahedron_in_hexahedron(p3d_point x1,p3d_point x2, p3d_point x3, p3d_point x4,
84  p3d_point x5, p3d_point x6, p3d_point x7, p3d_point x8,
85  p3d_point y1,p3d_point y2, p3d_point y3, p3d_point y4,
86  p3d_point y5, p3d_point y6, p3d_point y7, p3d_point y8);
87 
95  bool point_in_hexahedron(p3d_point a, p3d_point b, p3d_point c, p3d_point d,
96  p3d_point e, p3d_point f, p3d_point g, p3d_point h,
97  p3d_point x);
98 
105  double compute_pyramid_area(p3d_point a, p3d_point b, p3d_point c, p3d_point d, p3d_point h);
106 
107  std::vector<p3d_point> getRandomPointsInHexahedron(double nbPoints, p3d_point a, p3d_point b, p3d_point c, p3d_point d, p3d_point e, p3d_point f, p3d_point g, p3d_point h);
108 
109  p3d_point getClosestBBPointFromPoint(Robot* e, p3d_point s);
110 
111  ParallelepipedForm getBoxFromObjects(std::vector<Robot*> vr, Robot* gripper);
112 
116  double distConfs(confPtr_t q1, confPtr_t q2);
117 
121  std::vector<p3d_point> getSampled(std::vector<p3d_point> vp, double sampleRate);
122 
127  double computeCost(std::vector<p3d_point> vHP, std::vector<p3d_point> vp, double angleWeight, double distHWeight, double distWeight);
128 
129 
134  std::vector<p3d_point> smoothTraj(std::vector<p3d_point> origTraj, std::vector<p3d_point> vHP, Robot *r, int nbIterMax, double gainLim, double trajDistWeight, double distToHWeight, double angleWeight);
135 
136 };
137 
138 
139 
140 
141 
142 
143 
144 #endif // GEOMETRICTOOLS_HPP
bool hexahedron_in_hexahedron(p3d_point x1, p3d_point x2, p3d_point x3, p3d_point x4, p3d_point x5, p3d_point x6, p3d_point x7, p3d_point x8, p3d_point y1, p3d_point y2, p3d_point y3, p3d_point y4, p3d_point y5, p3d_point y6, p3d_point y7, p3d_point y8)
test if four points of hexahedron y are in hexahedron x
Definition: geometricComputations.cpp:349
std::vector< p3d_point > getLowerPointsInObject(Robot *obj, double steepness)
get lower BB points of the object
Definition: geometricComputations.cpp:51
double distConfs(confPtr_t q1, confPtr_t q2)
The euclidian distance between 2 confs.
Definition: geometricComputations.cpp:458
double compute_pyramid_area(p3d_point a, p3d_point b, p3d_point c, p3d_point d, p3d_point h)
a-—b | .h | c-—d b and c should be opposite
Definition: geometricComputations.cpp:295
p3d_point getRandomPointInRectangle(p3d_point A, p3d_point B, p3d_point C, p3d_point D)
a-—b | | c-—d .p b and c should be opposite
Definition: geometricComputations.cpp:41
double distBetweenPoints(p3d_point a, p3d_point b)
Definition: geometricComputations.cpp:264
double computeCost(std::vector< p3d_point > vHP, std::vector< p3d_point > vp, double angleWeight, double distHWeight, double distWeight)
vHP is the list of human positions (z is the orientation) and vp is the list of points to asses (can ...
Definition: geometricComputations.cpp:593
p3d_point getBotomCenterOfObj(Robot *obje, double threshhold)
Definition: geometricComputations.cpp:186
bool point_in_segment2d(p3d_point a, p3d_point b, p3d_point x)
a-—b .x
Definition: geometricComputations.cpp:258
p3d_point getCenterOfObj(Robot *obje)
Definition: geometricComputations.cpp:174
std::vector< p3d_point > getRandomPointsInHexahedron(double nbPoints, p3d_point a, p3d_point b, p3d_point c, p3d_point d, p3d_point e, p3d_point f, p3d_point g, p3d_point h)
b-—d / /| a-f–c h |/ |/ e-—g b and c should be opposite
Definition: geometricComputations.cpp:384
c-—d /| /| a-—b h |/g |/ e-—f b and c should be opposite
Definition: parallelepipedForm.hpp:14
Definition: geometricComputations.hpp:12
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
This file implements macros to help with the logging, in a way similar to ROS, using log4cxx...
std::vector< p3d_point > getUpperPointsInObject(Robot *obj, double steepness)
get higher BB points of the object
Definition: geometricComputations.cpp:102
double distBetweenPoints2D(p3d_point a, p3d_point b)
Definition: geometricComputations.cpp:283
std::vector< p3d_point > getSampled(std::vector< p3d_point > vp, double sampleRate)
sample more finely a list of points
Definition: geometricComputations.cpp:562
bool point_in_rect2(p3d_point a, p3d_point b, p3d_point c, p3d_point d, p3d_point x)
a-—b | | c-—d .x b and c should be opposite
Definition: geometricComputations.cpp:219
std::vector< p3d_point > smoothTraj(std::vector< p3d_point > origTraj, std::vector< p3d_point > vHP, Robot *r, int nbIterMax, double gainLim, double trajDistWeight, double distToHWeight, double angleWeight)
vHP is the list of human positions (z is the orientation) and origTraj is the list of points to smoot...
Definition: geometricComputations.cpp:640
bool point_in_hexahedron(p3d_point a, p3d_point b, p3d_point c, p3d_point d, p3d_point e, p3d_point f, p3d_point g, p3d_point h, p3d_point x)
c-—d /| /| a-—b h |/g |/ e-—f .x b and c should be opposite
Definition: geometricComputations.cpp:325
double distBetweenMatrix4(p3d_matrix4 a, p3d_matrix4 b)
distance between the points in the p3d_matrix4
Definition: geometricComputations.cpp:269