| 211 | } |
| 212 | |
| 213 | void VisualizerWindow::initialize(const std::shared_ptr<SurfelMapping>& fusion, const ParameterList& params) { |
| 214 | params_ = params; |
| 215 | fusion_ = fusion; |
| 216 | ui_.wCanvas->initialize(params); |
| 217 | ui_.wCanvas->setMap(fusion->getMap()); |
| 218 | |
| 219 | uint32_t max_history = 10; |
| 220 | uint32_t max_history_points = 150000; |
| 221 | if (params.hasParam("history size")) max_history = params["history size"]; |
| 222 | if (params.hasParam("history points")) max_history_points = params["history points"]; |
| 223 | if (params.hasParam("history stride")) history_stride_ = params["history stride"]; |
| 224 | if (params.hasParam("confidence_threshold")) |
| 225 | ui_.spinConfidenceThreshold->setValue((float)params["confidence_threshold"]); |
| 226 | |
| 227 | // get parameters. |
| 228 | ui_.spinIcpMaxAngle->setValue((float)params["icp-max-angle"]); |
| 229 | ui_.spinIcpMaxDistance->setValue((float)params["icp-max-distance"]); |
| 230 | ui_.spinIcpMaxIterations->setValue((int)params["max iterations"]); |
| 231 | ui_.chkWarmStart->setChecked(!((bool)params["initialize_identity"])); |
| 232 | ui_.spinOptFactor->setValue((float)params["factor"]); |
| 233 | |
| 234 | ui_.spinProbStable->setValue((float)params["p_stable"]); |
| 235 | ui_.spinProbPrior->setValue((float)params["p_prior"]); |
| 236 | |
| 237 | ui_.spinSigmaAngle->setValue((float)params["sigma_angle"]); |
| 238 | ui_.spinSigmaDistance->setValue((float)params["sigma_distance"]); |
| 239 | |
| 240 | ui_.spinMapMaxDistance->setValue((float)params["map-max-distance"]); |
| 241 | ui_.spinMapMaxAngle->setValue((float)params["map-max-angle"]); |
| 242 | // ui_.chkIterativeCutoff->setChecked((bool) params["iterative_cutoff"]); |
| 243 | |
| 244 | if (params.hasParam("filter_vertexmap")) { |
| 245 | ui_.chkBilateralFiltering->setChecked((bool)params["filter_vertexmap"]); |
| 246 | ui_.chkFilterVertices->setChecked((bool)params["use_filtered_vertexmap"]); |
| 247 | ui_.spinBilateralSigmaRange->setValue((float)params["bilateral_sigma_range"]); |
| 248 | ui_.spinBilateralSigmaSpace->setValue((float)params["bilateral_sigma_space"]); |
| 249 | } |
| 250 | |
| 251 | std::string weightingMethod = (std::string)params["weighting"]; |
| 252 | int32_t idx = 0; |
| 253 | if (weightingMethod == "huber") idx = 1; |
| 254 | if (weightingMethod == "turkey") idx = 2; |
| 255 | |
| 256 | ui_.cmbOptWeighting->setCurrentIndex(idx); |
| 257 | |
| 258 | parameterUpdateNeeded_ = false; |
| 259 | |
| 260 | acc_ = std::make_shared<ScanAccumulator>(max_history, max_history_points); |
| 261 | ui_.spinHistorySize->setMaximum(max_history); |
| 262 | |
| 263 | ui_.wCanvas->setScanAccumualator(acc_); |
| 264 | |
| 265 | if (params.hasParam("show robot")) { |
| 266 | ui_.chkShowRobot->setChecked(params["show robot"]); |
| 267 | } |
| 268 | |
| 269 | ui_.wCanvas->setPosegraph(fusion_->getPosegraph()); |
| 270 |
no test coverage detected