| 51 | } |
| 52 | |
| 53 | class SLOAMTest : public ::testing::Test |
| 54 | { |
| 55 | protected: |
| 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; |
nothing calls this directly
no outgoing calls
no test coverage detected