diff --git a/src/remove_below_ground_filter.cpp b/src/remove_below_ground_filter.cpp index 67cc6a0..e133f64 100644 --- a/src/remove_below_ground_filter.cpp +++ b/src/remove_below_ground_filter.cpp @@ -3,30 +3,29 @@ namespace mrs_pcl_tools { - void RemoveBelowGroundFilter::initialize(ros::NodeHandle& nh, const std::shared_ptr common_handlers) - { - keep_organized = common_handlers->param_loader->loadParamReusable("keep_organized", false); - common_handlers->param_loader->loadParam("ground_removal/plane_offset", plane_offset, 1.0); - const auto pfx = common_handlers->param_loader->getPrefix(); +void RemoveBelowGroundFilter::initialize(ros::NodeHandle& nh, const std::shared_ptr common_handlers) { + common_handlers->param_loader->loadParamReusable("keep_organized", keep_organized, false); + common_handlers->param_loader->loadParam("ground_removal/plane_offset", plane_offset, 1.0); + const auto pfx = common_handlers->param_loader->getPrefix(); - if (common_handlers->transformer == nullptr) - { - common_handlers->param_loader->setPrefix(""); - const std::string uav_name = common_handlers->param_loader->loadParamReusable("uav_name"); - common_handlers->param_loader->setPrefix(pfx); - this->transformer = std::make_shared("RemoveBelowGroundFilter"); - this->transformer->setDefaultPrefix(uav_name); - this->transformer->setLookupTimeout(ros::Duration(0.3)); - this->transformer->retryLookupNewest(true); - } else - { - this->transformer = common_handlers->transformer; - } + if (common_handlers->transformer == nullptr) { + common_handlers->param_loader->setPrefix(""); + std::string uav_name; + common_handlers->param_loader->loadParamReusable("uav_name", uav_name); + common_handlers->param_loader->setPrefix(pfx); + this->transformer = std::make_shared("RemoveBelowGroundFilter"); + this->transformer->setDefaultPrefix(uav_name); + this->transformer->setLookupTimeout(ros::Duration(0.3)); + this->transformer->retryLookupNewest(true); + } else { + this->transformer = common_handlers->transformer; + } - m_ground_detector.initialize(nh, this->transformer, GroundplaneDetector::groundplane_detection_config_t(*common_handlers->param_loader, pfx+"ground_removal/")); + m_ground_detector.initialize(nh, this->transformer, + GroundplaneDetector::groundplane_detection_config_t(*common_handlers->param_loader, pfx + "ground_removal/")); - initialized = true; - } + initialized = true; +} } // namespace mrs_pcl_tools