| 15 | namespace grid_map_pcl { |
| 16 | |
| 17 | void PclLoaderParameters::handleYamlNode(const YAML::Node& yamlNode) { |
| 18 | const std::string prefix = "pcl_grid_map_extraction"; |
| 19 | |
| 20 | parameters_.numThreads_ = yamlNode[prefix]["num_processing_threads"].as<int>(); |
| 21 | |
| 22 | parameters_.cloudTransformation_.translation_.x() = yamlNode[prefix]["cloud_transform"]["translation"]["x"].as<double>(); |
| 23 | parameters_.cloudTransformation_.translation_.y() = yamlNode[prefix]["cloud_transform"]["translation"]["y"].as<double>(); |
| 24 | parameters_.cloudTransformation_.translation_.z() = yamlNode[prefix]["cloud_transform"]["translation"]["z"].as<double>(); |
| 25 | |
| 26 | parameters_.cloudTransformation_.rpyIntrinsic_.x() = yamlNode[prefix]["cloud_transform"]["rotation"]["r"].as<double>(); |
| 27 | parameters_.cloudTransformation_.rpyIntrinsic_.y() = yamlNode[prefix]["cloud_transform"]["rotation"]["p"].as<double>(); |
| 28 | parameters_.cloudTransformation_.rpyIntrinsic_.z() = yamlNode[prefix]["cloud_transform"]["rotation"]["y"].as<double>(); |
| 29 | |
| 30 | parameters_.clusterExtraction_.useMaxHeightAsCellElevation_ = |
| 31 | yamlNode[prefix]["cluster_extraction"]["use_max_height_as_cell_elevation"].as<bool>(); |
| 32 | parameters_.clusterExtraction_.clusterTolerance_ = yamlNode[prefix]["cluster_extraction"]["cluster_tolerance"].as<double>(); |
| 33 | parameters_.clusterExtraction_.minNumPoints_ = yamlNode[prefix]["cluster_extraction"]["min_num_points"].as<int>(); |
| 34 | parameters_.clusterExtraction_.maxNumPoints_ = yamlNode[prefix]["cluster_extraction"]["max_num_points"].as<int>(); |
| 35 | |
| 36 | parameters_.outlierRemoval_.isRemoveOutliers_ = yamlNode[prefix]["outlier_removal"]["is_remove_outliers"].as<bool>(); |
| 37 | parameters_.outlierRemoval_.meanK_ = yamlNode[prefix]["outlier_removal"]["mean_K"].as<int>(); |
| 38 | parameters_.outlierRemoval_.stddevThreshold_ = yamlNode[prefix]["outlier_removal"]["stddev_threshold"].as<double>(); |
| 39 | |
| 40 | parameters_.gridMap_.resolution_ = yamlNode[prefix]["grid_map"]["resolution"].as<double>(); |
| 41 | parameters_.gridMap_.minCloudPointsPerCell_ = yamlNode[prefix]["grid_map"]["min_num_points_per_cell"].as<int>(); |
| 42 | |
| 43 | parameters_.downsampling_.isDownsampleCloud_ = yamlNode[prefix]["downsampling"]["is_downsample_cloud"].as<bool>(); |
| 44 | parameters_.downsampling_.voxelSize_.x() = yamlNode[prefix]["downsampling"]["voxel_size"]["x"].as<double>(); |
| 45 | parameters_.downsampling_.voxelSize_.y() = yamlNode[prefix]["downsampling"]["voxel_size"]["y"].as<double>(); |
| 46 | parameters_.downsampling_.voxelSize_.z() = yamlNode[prefix]["downsampling"]["voxel_size"]["z"].as<double>(); |
| 47 | } |
| 48 | |
| 49 | bool PclLoaderParameters::loadParameters(const std::string& filename) { |
| 50 | YAML::Node yamlNode = YAML::LoadFile(filename); |
nothing calls this directly
no outgoing calls
no test coverage detected