MCPcopy Create free account
hub / github.com/KumarRobotics/sloam / SLOAMTest

Class SLOAMTest

sloam/src/tests/core_test.cpp:53–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53class SLOAMTest : public ::testing::Test
54{
55protected:
56 void SetUp() override
57 {
58 setupParams();
59
60 // t0
61 readInputData(t0Input, "still", "t0");
62 t0Input.poseEstimate = SE3();
63
64 // t1
65 readInputData(t1Input, "still", "t1");
66 t1Input.poseEstimate = SE3();
67
68 if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug))
69 ros::console::notifyLoggerLevelsChanged();
70 }
71
72 void readInputData(SloamInput& inp, std::string prefix, std::string stamp){
73 std::string base_dir = "/opt/sloam_ws/src/sloam/src/tests/aux/";
74 std::string landmarks_path = base_dir + prefix + "_landmarks_" + stamp;
75 std::string ground_path = base_dir + prefix + "_ground_" + stamp + std::string(".pcd");
76
77 // read class state from archive
78 std::ifstream ifs(landmarks_path);
79 boost::archive::text_iarchive ia(ifs);
80 ia >> inp.landmarks;
81
82 for(auto& tree : inp.landmarks){
83 for(auto& vtx : tree){
84 vtx.points.resize(5);
85 }
86 }
87
88 // CloudT::Ptr rawGround(new CloudT);
89 // pcl::io::loadPCDFile<PointT>(ground_path, *rawGround);
90 // filterPC(rawGround, inp.groundCloud, 1);
91 pcl::io::loadPCDFile<PointT>(ground_path, *inp.groundCloud);
92 }
93
94 void setupParams()
95 {
96
97 params.scansPerSweep = 1;
98 params.maxLidarDist = 15.0;
99 params.maxGroundLidarDist = 30.0;
100 params.minGroundLidarDist = 0.0;
101
102 params.groundRadiiBins = 1;
103 params.groundThetaBins = 18;
104 params.groundMatchThresh = 2.0;
105 params.groundRetainThresh = 0.05;
106
107 params.maxTreeRadius = 0.3;
108 params.maxAxisTheta = 10;
109 params.maxFocusOutlierDistance = 0.5;
110 params.roughTreeMatchThresh = 3.0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected