| 128 | |
| 129 | template <typename PointT> |
| 130 | class PatchWork { |
| 131 | public: |
| 132 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
| 133 | |
| 134 | typedef std::vector<Patch<PointT>> Ring; |
| 135 | typedef std::vector<Ring> RegionwisePatches; |
| 136 | |
| 137 | PatchWork() {} |
| 138 | |
| 139 | std::string frame_patchwork = "map"; |
| 140 | |
| 141 | template <typename T> |
| 142 | bool condParam(ros::NodeHandle *nh, |
| 143 | const std::string ¶m_name, |
| 144 | T ¶m_val, |
| 145 | const T &default_val, |
| 146 | const std::string &prefix = "/patchwork") const { |
| 147 | if (nh->hasParam(prefix + "/" + param_name)) { |
| 148 | if (nh->getParam(prefix + "/" + param_name, param_val)) { |
| 149 | ROS_INFO_STREAM("param '" << prefix << "/" << param_name << "' -> '" << param_val << "'"); |
| 150 | return true; |
| 151 | } |
| 152 | } else if (nh->hasParam(ros::this_node::getName() + "/" + param_name)) { |
| 153 | if (nh->getParam(ros::this_node::getName() + "/" + param_name, param_val)) { |
| 154 | ROS_INFO_STREAM("param '" << ros::this_node::getName() << "/" << param_name << "' -> '" |
| 155 | << param_val << "'"); |
| 156 | return true; |
| 157 | } |
| 158 | } |
| 159 | param_val = default_val; |
| 160 | ROS_INFO_STREAM("param '" << param_name << "' -> '" << param_val << "' (default)"); |
| 161 | return false; |
| 162 | } |
| 163 | |
| 164 | explicit PatchWork(ros::NodeHandle *nh) { |
| 165 | // Init ROS related |
| 166 | ROS_INFO("Inititalizing PatchWork..."); |
| 167 | condParam(nh, "verbose", verbose_, false); |
| 168 | condParam(nh, "sensor_height", sensor_height_, 1.723, ""); |
| 169 | condParam(nh, "sensor_model", sensor_model_, std::string("HDL-64E"), ""); |
| 170 | |
| 171 | condParam(nh, "ATAT/ATAT_ON", ATAT_ON_, false); |
| 172 | condParam(nh, "ATAT/max_r_for_ATAT", max_r_for_ATAT_, 5.0); |
| 173 | condParam(nh, "ATAT/num_sectors_for_ATAT", num_sectors_for_ATAT_, 20); |
| 174 | condParam(nh, "ATAT/noise_bound", noise_bound_, 0.2); |
| 175 | |
| 176 | condParam(nh, "num_iter", num_iter_, 3); |
| 177 | condParam(nh, "num_lpr", num_lpr_, 20); |
| 178 | condParam(nh, "num_min_pts", num_min_pts_, 10); |
| 179 | condParam(nh, "th_seeds", th_seeds_, 0.4); |
| 180 | condParam(nh, "th_dist", th_dist_, 0.3); |
| 181 | condParam(nh, "max_r", max_range_, 80.0); |
| 182 | condParam(nh, "min_r", min_range_, |
| 183 | 2.7); // It should cover the body size of the car. |
| 184 | condParam(nh, "uniform/num_rings", num_rings_, 30); |
| 185 | condParam(nh, "uniform/num_sectors", num_sectors_, 108); |
| 186 | condParam(nh, "uprightness_thr", uprightness_thr_, |
| 187 | 0.5); // The larger, the more strict |
nothing calls this directly
no outgoing calls
no test coverage detected