-
Notifications
You must be signed in to change notification settings - Fork 5
/
TestHRM3DAblation.cpp
60 lines (48 loc) · 2.08 KB
/
TestHRM3DAblation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/** \author Sipu Ruan */
#include "hrm/config.h"
#include "hrm/planners/HRM3DAblation.h"
#include "hrm/test/util/GTestUtils.h"
#include "hrm/test/util/ParsePlanningSettings.h"
TEST(TestHRMPlanning3D, HRMAblation) {
// Setup environment config
hrm::parsePlanningConfig("superquadrics", "sparse", "rabbit", "3D");
const int NUM_SURF_PARAM = 10;
const double MAX_PLAN_TIME = 5.0;
hrm::PlannerSetting3D env3D(NUM_SURF_PARAM);
env3D.loadEnvironment(CONFIG_PATH "/");
// Using fixed orientations from Icosahedral symmetry group
const std::string quatFile =
RESOURCES_PATH "/SO3_sequence/q_icosahedron_60.csv";
// Setup robot
const auto robot =
hrm::loadRobotMultiBody3D(CONFIG_PATH "/", quatFile, NUM_SURF_PARAM);
// Planning requests
hrm::PlanningRequest req;
req.start = env3D.getEndPoints().at(0);
req.goal = env3D.getEndPoints().at(1);
hrm::defineParameters(robot, env3D, req.parameters);
// Main algorithm
std::cout << "Highway RoadMap for 3D rigid-body planning" << std::endl;
std::cout << "----------" << std::endl;
std::cout << "Input number of C-slices: " << req.parameters.numSlice
<< std::endl;
std::cout << "Input number of sweep lines {X,Y}: {"
<< req.parameters.numLineX << ',' << req.parameters.numLineY
<< '}' << std::endl;
std::cout << "----------" << std::endl;
std::cout << "Start planning..." << std::endl;
hrm::planners::HRM3DAblation<hrm::planners::HRM3D> hrmAblated(
robot, env3D.getArena(), env3D.getObstacle(), req);
hrmAblated.plan(MAX_PLAN_TIME);
hrm::PlanningResult res = hrmAblated.getPlanningResult();
// Planning results: Time and Path Cost
std::cout << "----------" << std::endl;
std::cout << "Final number of sweep lines {X,Y}: {"
<< hrmAblated.getPlannerParameters().numLineX << ','
<< hrmAblated.getPlannerParameters().numLineY << '}' << std::endl;
hrm::evaluateResult(res);
}
int main(int ac, char* av[]) {
testing::InitGoogleTest(&ac, av);
return RUN_ALL_TESTS();
}