| 36 | |
| 37 | template<typename PointT> |
| 38 | class PatchWork { |
| 39 | |
| 40 | public: |
| 41 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
| 42 | |
| 43 | typedef std::vector<pcl::PointCloud<PointT> > Ring; |
| 44 | typedef std::vector<Ring> Zone; |
| 45 | |
| 46 | PatchWork() {}; |
| 47 | |
| 48 | PatchWork(ros::NodeHandle *nh) : node_handle_(*nh) { |
| 49 | // Init ROS related |
| 50 | // ROS_INFO("Inititalizing PatchWork..."); |
| 51 | |
| 52 | node_handle_.param<double>("/sensor_height", sensor_height_, 1.723); |
| 53 | node_handle_.param<bool>("/patchwork/verbose", verbose_, false); |
| 54 | |
| 55 | node_handle_.param("/patchwork/num_iter", num_iter_, 3); |
| 56 | node_handle_.param("/patchwork/num_lpr", num_lpr_, 20); |
| 57 | node_handle_.param("/patchwork/num_min_pts", num_min_pts_, 10); |
| 58 | node_handle_.param("/patchwork/th_seeds", th_seeds_, 0.4); |
| 59 | node_handle_.param("/patchwork/th_dist", th_dist_, 0.3); |
| 60 | node_handle_.param("/patchwork/max_r", max_range_, 80.0); |
| 61 | node_handle_.param("/patchwork/min_r", min_range_, 2.7); // It indicates bodysize of the car. |
| 62 | node_handle_.param("/patchwork/uniform/num_rings", num_rings_, 30); |
| 63 | node_handle_.param("/patchwork/uniform/num_sectors", num_sectors_, 108); |
| 64 | node_handle_.param("/patchwork/uprightness_thr", uprightness_thr_, 0.5); // The larger, the more strict |
| 65 | node_handle_.param("/patchwork/adaptive_seed_selection_margin", adaptive_seed_selection_margin_, |
| 66 | -1.1); // The more larger, the more soft |
| 67 | |
| 68 | // It is not in the paper |
| 69 | // It is also not matched our philosophy, but it is employed to reject some FPs easily & intuitively. |
| 70 | // For patchwork, it is only applied on Z3 and Z4 |
| 71 | node_handle_.param<bool>("/patchwork/using_global_elevation", using_global_thr_, true); |
| 72 | node_handle_.param("/patchwork/global_elevation_threshold", global_elevation_thr_, 0.0); |
| 73 | |
| 74 | if (using_global_thr_) { |
| 75 | cout << "\033[1;33m[Warning] Global elevation threshold is turned on :" << global_elevation_thr_ << "\033[0m" << endl; |
| 76 | } else { cout << "Global thr. is not in use" << endl; } |
| 77 | |
| 78 | // ROS_INFO("Sensor Height: %f", sensor_height_); |
| 79 | // ROS_INFO("Num of Iteration: %d", num_iter_); |
| 80 | // ROS_INFO("Num of LPR: %d", num_lpr_); |
| 81 | // ROS_INFO("Num of min. points: %d", num_min_pts_); |
| 82 | // ROS_INFO("Seeds Threshold: %f", th_seeds_); |
| 83 | // ROS_INFO("Distance Threshold: %f", th_dist_); |
| 84 | // ROS_INFO("Max. range:: %f", max_range_); |
| 85 | // ROS_INFO("Min. range:: %f", min_range_); |
| 86 | // ROS_INFO("Num. rings: %d", num_rings_); |
| 87 | // ROS_INFO("Num. sectors: %d", num_sectors_); |
| 88 | // ROS_INFO("adaptive_seed_selection_margin: %f", adaptive_seed_selection_margin_); |
| 89 | |
| 90 | // CZM denotes 'Concentric Zone Model'. Please refer to our paper |
| 91 | node_handle_.getParam("/patchwork/czm/num_zones", num_zones_); |
| 92 | node_handle_.getParam("/patchwork/czm/num_sectors_each_zone", num_sectors_each_zone_); |
| 93 | node_handle_.getParam("/patchwork/czm/num_rings_each_zone", num_rings_each_zone_); |
| 94 | node_handle_.getParam("/patchwork/czm/min_ranges_each_zone", min_ranges_); |
| 95 | node_handle_.getParam("/patchwork/czm/elevation_thresholds", elevation_thr_); |
nothing calls this directly
no outgoing calls
no test coverage detected