MCPcopy Create free account
hub / github.com/LimHyungTae/patchwork / PatchWork

Class PatchWork

include/patchwork/patchwork.hpp:130–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129template <typename PointT>
130class 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 &param_name,
144 T &param_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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected