ed_sensor_integration
test
test_convex_hull.cpp
Go to the documentation of this file.
1
#include <
ed/convex_hull.h
>
2
#include <
ed/convex_hull_calc.h
>
3
4
int
main
(
int
argc,
char
**argv)
5
{
6
ed::ConvexHull
c1;
7
c1.
z_min
= -0.5;
8
c1.
z_max
= 0.5;
9
10
c1.
points
.push_back(
geo::Vec2f
(0.0640089, 0.0461254));
11
c1.
points
.push_back(
geo::Vec2f
(0.0315182, 0.050766));
12
c1.
points
.push_back(
geo::Vec2f
(0.0154809, 0.0444589));
13
c1.
points
.push_back(
geo::Vec2f
(-0.0493098, -0.00545931));
14
c1.
points
.push_back(
geo::Vec2f
(-0.050205, -0.0308552));
15
c1.
points
.push_back(
geo::Vec2f
(-0.0349846, -0.0335279));
16
c1.
points
.push_back(
geo::Vec2f
(-0.0346048, -0.0335526));
17
c1.
points
.push_back(
geo::Vec2f
(0.0120594, -0.0250401));
18
c1.
points
.push_back(
geo::Vec2f
(0.0460369, -0.0129151));
19
20
21
ed::ConvexHull
c2;
22
c2.
z_min
= -0.5;
23
c2.
z_max
= 0.5;
24
25
c2.
points
.push_back(
geo::Vec2f
(0.0868937, 0.149448));
26
c2.
points
.push_back(
geo::Vec2f
(0.0662393, 0.152538));
27
c2.
points
.push_back(
geo::Vec2f
(0.0023579, 0.162071));
28
c2.
points
.push_back(
geo::Vec2f
(-0.0376225, 0.158206));
29
c2.
points
.push_back(
geo::Vec2f
(-0.0583535, 0.151631));
30
c2.
points
.push_back(
geo::Vec2f
(-0.0845235, -0.0181588));
31
c2.
points
.push_back(
geo::Vec2f
(-0.0863414, -0.0758137));
32
c2.
points
.push_back(
geo::Vec2f
(-0.0698329, -0.167838));
33
c2.
points
.push_back(
geo::Vec2f
(-0.0300491, -0.17906));
34
c2.
points
.push_back(
geo::Vec2f
(0.0547022, -0.161849));
35
c2.
points
.push_back(
geo::Vec2f
(0.0759892, -0.146899));
36
c2.
points
.push_back(
geo::Vec2f
(0.0805406, -0.024275));
37
38
39
ed::convex_hull::calculateEdgesAndNormals
(c1);
40
ed::convex_hull::calculateEdgesAndNormals
(c2);
41
42
std::cout
<<
ed::convex_hull::collide
(c1,
geo::Vector3
(3.14171, 5.07719, 0), c2,
geo::Vector3
(3.42953, 3.63333, 0), 0.1, 0.1) <<
std::endl
;
43
44
return
0;
45
}
ed::ConvexHull::z_min
float z_min
ed::ConvexHull
ed::convex_hull::calculateEdgesAndNormals
void calculateEdgesAndNormals(ConvexHull &chull)
convex_hull.h
std::cout
ed::convex_hull::collide
bool collide(const ConvexHull &c1, const geo::Vector3 &pos1, const ConvexHull &c2, const geo::Vector3 &pos2, float xy_padding, float z_padding)
main
int main(int argc, char **argv)
Definition:
test_convex_hull.cpp:4
geo::Vector3
std::endl
T endl(T... args)
ed::ConvexHull::z_max
float z_max
convex_hull_calc.h
geo::Vec2T
ed::ConvexHull::points
std::vector< geo::Vec2f > points
Generated on Sat Apr 19 2025 04:35:36 for ed_sensor_integration by
1.8.17