From 669652b7e2c39a6949d2fdf24e6bd931bf5195ec Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Sat, 21 Oct 2023 12:04:36 -0700 Subject: [PATCH] Part F of transition to support modernize-use-default-member-init (#5815) * Part F of transition to support modernize-use-default-member-init * Fixed clang-tidy complaint * Made changes per inspection * Fixed CI formatting complaints * Fixed yet more CI formatting complaints * Reverted 3rdparty files per review * Reverted formatting per review * Addressed review comments * Reran clang-tidy after rebase * Addressed further review comments * Addressed latest issues flagged in review * Fixed clang-format complaint * Fixed omitted review item --- .../recognition/cg/geometric_consistency.h | 30 +++++----- .../include/pcl/recognition/cg/hough_3d.h | 28 ++++----- .../pcl/recognition/color_gradient_modality.h | 14 ++--- .../include/pcl/recognition/distance_map.h | 34 +++++------ .../recognition/impl/implicit_shape_model.hpp | 35 +---------- .../impl/ransac_based/simple_octree.hpp | 6 +- .../pcl/recognition/implicit_shape_model.h | 53 +++++++++-------- recognition/include/pcl/recognition/linemod.h | 45 +++++++------- .../pcl/recognition/linemod/line_rgbd.h | 29 +++++----- .../pcl/recognition/ransac_based/hypothesis.h | 12 ++-- .../recognition/ransac_based/model_library.h | 2 +- .../recognition/ransac_based/obj_rec_ransac.h | 18 +++--- .../pcl/recognition/ransac_based/orr_octree.h | 26 ++++----- .../ransac_based/orr_octree_zprojection.h | 10 ++-- .../ransac_based/rigid_transform_space.h | 9 +-- .../recognition/ransac_based/simple_octree.h | 8 +-- .../recognition/ransac_based/trimmed_icp.h | 6 +- .../include/pcl/recognition/region_xy.h | 14 ++--- .../sparse_quantized_multi_mod_template.h | 26 ++++----- .../pcl/recognition/surface_normal_modality.h | 58 ++++++++----------- recognition/src/linemod.cpp | 7 +-- .../src/ransac_based/model_library.cpp | 3 +- .../src/ransac_based/obj_rec_ransac.cpp | 11 +--- recognition/src/ransac_based/orr_octree.cpp | 7 +-- .../registration/correspondence_estimation.h | 12 ++-- ...correspondence_estimation_backprojection.h | 4 +- ...orrespondence_estimation_normal_shooting.h | 4 +- ...pondence_estimation_organized_projection.h | 10 +--- .../registration/correspondence_rejection.h | 8 +-- ...correspondence_rejection_median_distance.h | 6 +- ...respondence_rejection_organized_boundary.h | 10 ++-- .../correspondence_rejection_poly.h | 17 ++---- ...orrespondence_rejection_sample_consensus.h | 17 ++---- .../correspondence_rejection_surface_normal.h | 4 +- .../correspondence_rejection_trimmed.h | 9 +-- .../correspondence_rejection_var_trimmed.h | 11 ++-- .../default_convergence_criteria.h | 33 ++++------- registration/include/pcl/registration/elch.h | 3 +- registration/include/pcl/registration/gicp.h | 21 +++---- .../include/pcl/registration/ia_fpcs.h | 32 +++++----- .../include/pcl/registration/ia_kfpcs.h | 8 +-- .../include/pcl/registration/ia_ransac.h | 13 ++--- registration/include/pcl/registration/icp.h | 19 ++---- .../include/pcl/registration/impl/ia_fpcs.hpp | 42 +++----------- .../pcl/registration/impl/ia_kfpcs.hpp | 6 +- .../include/pcl/registration/impl/ndt.hpp | 8 +-- .../include/pcl/registration/impl/ndt_2d.hpp | 6 +- .../impl/pyramid_feature_matching.hpp | 7 +-- .../impl/transformation_estimation_lm.hpp | 6 +- ...ion_estimation_point_to_plane_weighted.hpp | 4 +- registration/include/pcl/registration/lum.h | 6 +- registration/include/pcl/registration/ndt.h | 10 ++-- .../pcl/registration/ppf_registration.h | 12 ++-- .../registration/pyramid_feature_matching.h | 4 +- .../include/pcl/registration/registration.h | 36 ++++-------- .../sample_consensus_prerejective.h | 9 +-- .../transformation_estimation_lm.h | 8 +-- ...ation_estimation_point_to_plane_weighted.h | 12 ++-- ..._estimation_symmetric_point_to_plane_lls.h | 5 +- .../transformation_validation_euclidean.h | 3 +- search/include/pcl/search/flann_search.h | 14 ++--- .../include/pcl/search/impl/flann_search.hpp | 3 +- .../include/pcl/simulation/range_likelihood.h | 32 +++++----- simulation/src/range_likelihood.cpp | 15 ----- test/common/test_transforms.cpp | 8 +-- test/octree/test_octree_iterator.cpp | 3 +- test/outofcore/test_outofcore.cpp | 4 +- 67 files changed, 373 insertions(+), 622 deletions(-) diff --git a/recognition/include/pcl/recognition/cg/geometric_consistency.h b/recognition/include/pcl/recognition/cg/geometric_consistency.h index 41d3ef5f35f..d1936b1d971 100644 --- a/recognition/include/pcl/recognition/cg/geometric_consistency.h +++ b/recognition/include/pcl/recognition/cg/geometric_consistency.h @@ -3,7 +3,7 @@ * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2010-2012, Willow Garage, Inc. - * + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,7 @@ namespace pcl { - + /** \brief Class implementing a 3D correspondence grouping enforcing geometric consistency among feature correspondences * * \author Federico Tombari, Tommaso Cavallari, Aitor Aldoma @@ -61,14 +61,10 @@ namespace pcl using SceneCloudConstPtr = typename pcl::CorrespondenceGrouping::SceneCloudConstPtr; /** \brief Constructor */ - GeometricConsistencyGrouping () - : gc_threshold_ (3) - , gc_size_ (1.0) - {} + GeometricConsistencyGrouping () = default; - /** \brief Sets the minimum cluster size - * \param[in] threshold the minimum cluster size + * \param[in] threshold the minimum cluster size */ inline void setGCThreshold (int threshold) @@ -77,7 +73,7 @@ namespace pcl } /** \brief Gets the minimum cluster size. - * + * * \return the minimum cluster size used by GC. */ inline int @@ -87,7 +83,7 @@ namespace pcl } /** \brief Sets the consensus set resolution. This should be in metric units. - * + * * \param[in] gc_size consensus set resolution. */ inline void @@ -97,7 +93,7 @@ namespace pcl } /** \brief Gets the consensus set resolution. - * + * * \return the consensus set resolution. */ inline double @@ -107,7 +103,7 @@ namespace pcl } /** \brief The main function, recognizes instances of the model into the scene set by the user. - * + * * \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene. * * \return true if the recognition had been successful or false if errors have occurred. @@ -116,7 +112,7 @@ namespace pcl recognize (std::vector > &transformations); /** \brief The main function, recognizes instances of the model into the scene set by the user. - * + * * \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene. * \param[out] clustered_corrs a vector containing the correspondences for each instance of the model found within the input data (the same output of clusterCorrespondences). * @@ -131,19 +127,19 @@ namespace pcl using CorrespondenceGrouping::model_scene_corrs_; /** \brief Minimum cluster size. It shouldn't be less than 3, since at least 3 correspondences are needed to compute the 6DOF pose */ - int gc_threshold_; + int gc_threshold_{3}; /** \brief Resolution of the consensus set used to cluster correspondences together*/ - double gc_size_; + double gc_size_{1.0}; /** \brief Transformations found by clusterCorrespondences method. */ std::vector > found_transformations_; /** \brief Cluster the input correspondences in order to distinguish between different instances of the model into the scene. - * + * * \param[out] model_instances a vector containing the clustered correspondences for each model found on the scene. * \return true if the clustering had been successful or false if errors have occurred. - */ + */ void clusterCorrespondences (std::vector &model_instances) override; }; diff --git a/recognition/include/pcl/recognition/cg/hough_3d.h b/recognition/include/pcl/recognition/cg/hough_3d.h index cd18a78b267..2a736805e3c 100644 --- a/recognition/include/pcl/recognition/cg/hough_3d.h +++ b/recognition/include/pcl/recognition/cg/hough_3d.h @@ -118,10 +118,10 @@ namespace pcl Eigen::Vector3i bin_count_; /** \brief Used to access hough_space_ as if it was a matrix. */ - int partial_bin_products_[4]; + int partial_bin_products_[4]{}; /** \brief Total number of bins in the Hough Space. */ - int total_bins_count_; + int total_bins_count_{0}; /** \brief The Hough Space. */ std::vector hough_space_; @@ -166,14 +166,6 @@ namespace pcl Hough3DGrouping () : input_rf_ () , scene_rf_ () - , needs_training_ (true) - ,hough_threshold_ (-1) - , hough_bin_size_ (1.0) - , use_interpolation_ (true) - , use_distance_weight_ (false) - , local_rf_normals_search_radius_ (0.0f) - , local_rf_search_radius_ (0.0f) - , hough_space_initialized_ (false) {} /** \brief Provide a pointer to the input dataset. @@ -445,28 +437,28 @@ namespace pcl SceneRfCloudConstPtr scene_rf_; /** \brief If the training of the Hough space is needed; set on change of either the input cloud or the input_rf. */ - bool needs_training_; + bool needs_training_{true}; /** \brief The result of the training. The vector between each model point and the centroid of the model adjusted by its local reference frame.*/ std::vector > model_votes_; /** \brief The minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud. */ - double hough_threshold_; + double hough_threshold_{-1.0}; /** \brief The size of each bin of the hough space. */ - double hough_bin_size_; + double hough_bin_size_{1.0}; /** \brief Use the interpolation between neighboring Hough bins when casting votes. */ - bool use_interpolation_; + bool use_interpolation_{true}; /** \brief Use the weighted correspondence distance when casting votes. */ - bool use_distance_weight_; + bool use_distance_weight_{false}; /** \brief Normals search radius for the potential Rf calculation. */ - float local_rf_normals_search_radius_; + float local_rf_normals_search_radius_{0.0f}; /** \brief Search radius for the potential Rf calculation. */ - float local_rf_search_radius_; + float local_rf_search_radius_{0.0f}; /** \brief The Hough space. */ pcl::recognition::HoughSpace3D::Ptr hough_space_; @@ -477,7 +469,7 @@ namespace pcl /** \brief Whether the Hough space already contains the correct votes for the current input parameters and so the cluster and recognize calls don't need to recompute each value. * Reset on the change of any parameter except the hough_threshold. */ - bool hough_space_initialized_; + bool hough_space_initialized_{false}; /** \brief Cluster the input correspondences in order to distinguish between different instances of the model into the scene. * diff --git a/recognition/include/pcl/recognition/color_gradient_modality.h b/recognition/include/pcl/recognition/color_gradient_modality.h index 7e5bae23a7d..89ca02cb49c 100644 --- a/recognition/include/pcl/recognition/color_gradient_modality.h +++ b/recognition/include/pcl/recognition/color_gradient_modality.h @@ -240,7 +240,7 @@ namespace pcl private: /** \brief Determines whether variable numbers of features are extracted or not. */ - bool variable_feature_nr_; + bool variable_feature_nr_{false}; /** \brief Stores a smoothed version of the input cloud. */ pcl::PointCloud::Ptr smoothed_input_; @@ -249,15 +249,15 @@ namespace pcl FeatureSelectionMethod feature_selection_method_; /** \brief The threshold applied on the gradient magnitudes (for quantization). */ - float gradient_magnitude_threshold_; + float gradient_magnitude_threshold_{10.0f}; /** \brief The threshold applied on the gradient magnitudes for feature extraction. */ - float gradient_magnitude_threshold_feature_extraction_; + float gradient_magnitude_threshold_feature_extraction_{55.0f}; /** \brief The point cloud which holds the max-RGB gradients. */ pcl::PointCloud color_gradients_; /** \brief The spreading size. */ - std::size_t spreading_size_; + std::size_t spreading_size_{8}; /** \brief The map which holds the quantized max-RGB gradients. */ pcl::QuantizedMap quantized_color_gradients_; @@ -274,12 +274,8 @@ namespace pcl template pcl::ColorGradientModality:: ColorGradientModality () - : variable_feature_nr_ (false) - , smoothed_input_ (new pcl::PointCloud ()) + : smoothed_input_ (new pcl::PointCloud ()) , feature_selection_method_ (DISTANCE_MAGNITUDE_SCORE) - , gradient_magnitude_threshold_ (10.0f) - , gradient_magnitude_threshold_feature_extraction_ (55.0f) - , spreading_size_ (8) { } diff --git a/recognition/include/pcl/recognition/distance_map.h b/recognition/include/pcl/recognition/distance_map.h index d641265125d..1eb6fc29d61 100644 --- a/recognition/include/pcl/recognition/distance_map.h +++ b/recognition/include/pcl/recognition/distance_map.h @@ -4,7 +4,7 @@ * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2010-2011, Willow Garage, Inc. * - * All rights reserved. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,35 +40,35 @@ namespace pcl { - /** \brief Represents a distance map obtained from a distance transformation. + /** \brief Represents a distance map obtained from a distance transformation. * \author Stefan Holzer */ class DistanceMap { public: /** \brief Constructor. */ - DistanceMap () : data_ (0), width_ (0), height_ (0) {} + DistanceMap () : data_ (0) {} /** \brief Destructor. */ virtual ~DistanceMap () = default; /** \brief Returns the width of the map. */ - inline std::size_t + inline std::size_t getWidth () const { - return (width_); + return (width_); } /** \brief Returns the height of the map. */ - inline std::size_t + inline std::size_t getHeight () const - { - return (height_); + { + return (height_); } - + /** \brief Returns a pointer to the beginning of map. */ - inline float * - getData () - { + inline float * + getData () + { return (data_.data()); } @@ -76,7 +76,7 @@ namespace pcl * \param[in] width the new width of the map. * \param[in] height the new height of the map. */ - void + void resize (const std::size_t width, const std::size_t height) { data_.resize (width*height); @@ -88,7 +88,7 @@ namespace pcl * \param[in] col_index the column index of the element to access. * \param[in] row_index the row index of the element to access. */ - inline float & + inline float & operator() (const std::size_t col_index, const std::size_t row_index) { return (data_[row_index*width_ + col_index]); @@ -98,7 +98,7 @@ namespace pcl * \param[in] col_index the column index of the element to access. * \param[in] row_index the row index of the element to access. */ - inline const float & + inline const float & operator() (const std::size_t col_index, const std::size_t row_index) const { return (data_[row_index*width_ + col_index]); @@ -108,9 +108,9 @@ namespace pcl /** \brief The storage for the distance map data. */ std::vector data_; /** \brief The width of the map. */ - std::size_t width_; + std::size_t width_{0}; /** \brief The height of the map. */ - std::size_t height_; + std::size_t height_{0}; }; } diff --git a/recognition/include/pcl/recognition/impl/implicit_shape_model.hpp b/recognition/include/pcl/recognition/impl/implicit_shape_model.hpp index 94afed0d52b..3830bdbe9b1 100644 --- a/recognition/include/pcl/recognition/impl/implicit_shape_model.hpp +++ b/recognition/include/pcl/recognition/impl/implicit_shape_model.hpp @@ -49,15 +49,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::features::ISMVoteList::ISMVoteList () : - votes_ (new pcl::PointCloud ()), - tree_is_valid_ (false), - votes_origins_ (new pcl::PointCloud ()), - votes_class_ (0), - k_ind_ (0), - k_sqr_dist_ (0) -{ -} +pcl::features::ISMVoteList::ISMVoteList() = default; ////////////////////////////////////////////////////////////////////////////////////////////// template @@ -297,18 +289,7 @@ pcl::features::ISMVoteList::getNumberOfVotes () } ////////////////////////////////////////////////////////////////////////////////////////////// -pcl::features::ISMModel::ISMModel () : - statistical_weights_ (0), - learned_weights_ (0), - classes_ (0), - sigmas_ (0), - clusters_ (0), - number_of_classes_ (0), - number_of_visual_words_ (0), - number_of_clusters_ (0), - descriptors_dimension_ (0) -{ -} +pcl::features::ISMModel::ISMModel () = default; ////////////////////////////////////////////////////////////////////////////////////////////// pcl::features::ISMModel::ISMModel (ISMModel const & copy) @@ -546,17 +527,7 @@ pcl::features::ISMModel::operator = (const pcl::features::ISMModel& other) ////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::ism::ImplicitShapeModelEstimation::ImplicitShapeModelEstimation () : - training_clouds_ (0), - training_classes_ (0), - training_normals_ (0), - training_sigmas_ (0), - sampling_size_ (0.1f), - feature_estimator_ (), - number_of_clusters_ (184), - n_vot_ON_ (true) -{ -} +pcl::ism::ImplicitShapeModelEstimation::ImplicitShapeModelEstimation () = default; ////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp b/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp index bd2e6436010..9e7f2103e0f 100644 --- a/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp +++ b/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp @@ -180,11 +180,7 @@ SimpleOctree::Node::makeNeighbors (Node* node template inline -SimpleOctree::SimpleOctree () -: tree_levels_ (0), - root_ (nullptr) -{ -} +SimpleOctree::SimpleOctree () = default; template inline diff --git a/recognition/include/pcl/recognition/implicit_shape_model.h b/recognition/include/pcl/recognition/implicit_shape_model.h index c32f55150f4..0347eff922a 100644 --- a/recognition/include/pcl/recognition/implicit_shape_model.h +++ b/recognition/include/pcl/recognition/implicit_shape_model.h @@ -128,25 +128,25 @@ namespace pcl protected: /** \brief Stores all votes. */ - pcl::PointCloud::Ptr votes_; + pcl::PointCloud::Ptr votes_{new pcl::PointCloud}; /** \brief Signalizes if the tree is valid. */ - bool tree_is_valid_; + bool tree_is_valid_{false}; /** \brief Stores the origins of the votes. */ - typename pcl::PointCloud::Ptr votes_origins_; + typename pcl::PointCloud::Ptr votes_origins_{new pcl::PointCloud}; /** \brief Stores classes for which every single vote was cast. */ - std::vector votes_class_; + std::vector votes_class_{}; /** \brief Stores the search tree. */ - pcl::KdTreeFLANN::Ptr tree_; + pcl::KdTreeFLANN::Ptr tree_{nullptr}; /** \brief Stores neighbours indices. */ - pcl::Indices k_ind_; + pcl::Indices k_ind_{}; /** \brief Stores square distances to the corresponding neighbours. */ - std::vector k_sqr_dist_; + std::vector k_sqr_dist_{}; }; /** \brief The assignment of this structure is to store the statistical/learned weights and other information @@ -187,16 +187,16 @@ namespace pcl ISMModel & operator = (const ISMModel& other); /** \brief Stores statistical weights. */ - std::vector > statistical_weights_; + std::vector > statistical_weights_{}; /** \brief Stores learned weights. */ - std::vector learned_weights_; + std::vector learned_weights_{}; /** \brief Stores the class label for every direction. */ - std::vector classes_; + std::vector classes_{}; /** \brief Stores the sigma value for each class. This values were used to compute the learned weights. */ - std::vector sigmas_; + std::vector sigmas_{}; /** \brief Stores the directions to objects center for each visual word. */ Eigen::MatrixXf directions_to_center_; @@ -205,19 +205,19 @@ namespace pcl Eigen::MatrixXf clusters_centers_; /** \brief This is an array of clusters. Each cluster stores the indices of the visual words that it contains. */ - std::vector > clusters_; + std::vector > clusters_{}; /** \brief Stores the number of classes. */ - unsigned int number_of_classes_; + unsigned int number_of_classes_{0}; /** \brief Stores the number of visual words. */ - unsigned int number_of_visual_words_; + unsigned int number_of_visual_words_{0}; /** \brief Stores the number of clusters. */ - unsigned int number_of_clusters_; + unsigned int number_of_clusters_{0}; /** \brief Stores descriptors dimension. */ - unsigned int descriptors_dimension_; + unsigned int descriptors_dimension_{0}; PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -316,15 +316,14 @@ namespace pcl { /** \brief Empty constructor with member variables initialization. */ VisualWordStat () : - class_ (-1), - learned_weight_ (0.0f), + dir_to_center_ (0.0f, 0.0f, 0.0f) {}; /** \brief Which class this vote belongs. */ - int class_; + int class_{-1}; /** \brief Weight of the vote. */ - float learned_weight_; + float learned_weight_{0.0f}; /** \brief Expected direction to center. */ pcl::PointXYZ dir_to_center_; @@ -583,30 +582,30 @@ namespace pcl protected: /** \brief Stores the clouds used for training. */ - std::vector::Ptr> training_clouds_; + std::vector::Ptr> training_clouds_{}; /** \brief Stores the class number for each cloud from training_clouds_. */ - std::vector training_classes_; + std::vector training_classes_{}; /** \brief Stores the normals for each training cloud. */ - std::vector::Ptr> training_normals_; + std::vector::Ptr> training_normals_{}; /** \brief This array stores the sigma values for each training class. If this array has a size equals 0, then * sigma values will be calculated automatically. */ - std::vector training_sigmas_; + std::vector training_sigmas_{}; /** \brief This value is used for the simplification. It sets the size of grid bin. */ - float sampling_size_; + float sampling_size_{0.1f}; /** \brief Stores the feature estimator. */ typename Feature::Ptr feature_estimator_; /** \brief Number of clusters, is used for clustering descriptors during the training. */ - unsigned int number_of_clusters_; + unsigned int number_of_clusters_{184}; /** \brief If set to false then Nvot coeff from [Knopp et al., 2010, (4)] is equal 1.0. */ - bool n_vot_ON_; + bool n_vot_ON_{true}; /** \brief This const value is used for indicating that for k-means clustering centers must * be generated as described in diff --git a/recognition/include/pcl/recognition/linemod.h b/recognition/include/pcl/recognition/linemod.h index fb771d75bb4..aac1e517b3f 100644 --- a/recognition/include/pcl/recognition/linemod.h +++ b/recognition/include/pcl/recognition/linemod.h @@ -55,10 +55,7 @@ namespace pcl { public: /** \brief Constructor. */ - EnergyMaps () : width_ (0), height_ (0), nr_bins_ (0) - { - } - + EnergyMaps () = default; /** \brief Destructor. */ virtual ~EnergyMaps () = default; @@ -182,11 +179,11 @@ namespace pcl private: /** \brief The width of the energy maps. */ - std::size_t width_; + std::size_t width_{0}; /** \brief The height of the energy maps. */ - std::size_t height_; + std::size_t height_{0}; /** \brief The number of quantization bins (== the number of internally stored energy maps). */ - std::size_t nr_bins_; + std::size_t nr_bins_{0}; /** \brief Storage for the energy maps. */ std::vector maps_; }; @@ -198,9 +195,7 @@ namespace pcl { public: /** \brief Constructor. */ - LinearizedMaps () : width_ (0), height_ (0), mem_width_ (0), mem_height_ (0), step_size_ (0) - { - } + LinearizedMaps () = default; /** \brief Destructor. */ virtual ~LinearizedMaps () = default; @@ -290,15 +285,15 @@ namespace pcl private: /** \brief the original width of the data represented by the map. */ - std::size_t width_; + std::size_t width_{0}; /** \brief the original height of the data represented by the map. */ - std::size_t height_; + std::size_t height_{0}; /** \brief the actual width of the linearized map. */ - std::size_t mem_width_; + std::size_t mem_width_{0}; /** \brief the actual height of the linearized map. */ - std::size_t mem_height_; + std::size_t mem_height_{0}; /** \brief the step-size used for sampling the original data. */ - std::size_t step_size_; + std::size_t step_size_{0}; /** \brief a vector containing all the linearized maps. */ std::vector maps_; }; @@ -309,18 +304,18 @@ namespace pcl struct PCL_EXPORTS LINEMODDetection { /** \brief Constructor. */ - LINEMODDetection () : x (0), y (0), template_id (0), score (0.0f), scale (1.0f) {} + LINEMODDetection () = default; /** \brief x-position of the detection. */ - int x; + int x{0}; /** \brief y-position of the detection. */ - int y; + int y{0}; /** \brief ID of the detected template. */ - int template_id; + int template_id{0}; /** \brief score of the detection. */ - float score; + float score{0.0f}; /** \brief scale at which the template was detected. */ - float scale; + float scale{1.0f}; }; /** @@ -461,13 +456,13 @@ namespace pcl private: /** template response threshold */ - float template_threshold_; + float template_threshold_{0.75f}; /** states whether non-max-suppression on detections is enabled or not */ - bool use_non_max_suppression_; + bool use_non_max_suppression_{false}; /** states whether to return an averaged detection */ - bool average_detections_; + bool average_detections_{false}; /** template storage */ - std::vector templates_; + std::vector templates_{}; }; } diff --git a/recognition/include/pcl/recognition/linemod/line_rgbd.h b/recognition/include/pcl/recognition/linemod/line_rgbd.h index 08f7292f3e9..d9f9cd5dec8 100644 --- a/recognition/include/pcl/recognition/linemod/line_rgbd.h +++ b/recognition/include/pcl/recognition/linemod/line_rgbd.h @@ -48,21 +48,21 @@ namespace pcl struct BoundingBoxXYZ { /** \brief Constructor. */ - BoundingBoxXYZ () : x (0.0f), y (0.0f), z (0.0f), width (0.0f), height (0.0f), depth (0.0f) {} + BoundingBoxXYZ () = default; /** \brief X-coordinate of the upper left front point */ - float x; + float x{0.0f}; /** \brief Y-coordinate of the upper left front point */ - float y; + float y{0.0f}; /** \brief Z-coordinate of the upper left front point */ - float z; + float z{0.0f}; /** \brief Width of the bounding box */ - float width; + float width{0.0f}; /** \brief Height of the bounding box */ - float height; + float height{0.0f}; /** \brief Depth of the bounding box */ - float depth; + float depth{0.0f}; }; /** \brief High-level class for template matching using the LINEMOD approach based on RGB and Depth data. @@ -77,16 +77,16 @@ namespace pcl struct Detection { /** \brief Constructor. */ - Detection () : template_id (0), object_id (0), detection_id (0), response (0.0f) {} + Detection () = default; /** \brief The ID of the template. */ - std::size_t template_id; + std::size_t template_id{0}; /** \brief The ID of the object corresponding to the template. */ - std::size_t object_id; + std::size_t object_id{0}; /** \brief The ID of this detection. This is only valid for the last call of the method detect (...). */ - std::size_t detection_id; + std::size_t detection_id{0}; /** \brief The response of this detection. Responses are between 0 and 1, where 1 is best. */ - float response; + float response{0.0f}; /** \brief The 3D bounding box of the detection. */ BoundingBoxXYZ bounding_box; /** \brief The 2D template region of the detection. */ @@ -95,8 +95,7 @@ namespace pcl /** \brief Constructor */ LineRGBD () - : intersection_volume_threshold_ (1.0f) - , color_gradient_mod_ () + : color_gradient_mod_ () , surface_normal_mod_ () , cloud_xyz_ () , cloud_rgb_ () @@ -281,7 +280,7 @@ namespace pcl readLTMHeader (int fd, pcl::io::TARHeader &header); /** \brief Intersection volume threshold. */ - float intersection_volume_threshold_; + float intersection_volume_threshold_{1.0f}; /** \brief LINEMOD instance. */ public: pcl::LINEMOD linemod_; diff --git a/recognition/include/pcl/recognition/ransac_based/hypothesis.h b/recognition/include/pcl/recognition/ransac_based/hypothesis.h index dafdef9e6d2..a8a2a681415 100644 --- a/recognition/include/pcl/recognition/ransac_based/hypothesis.h +++ b/recognition/include/pcl/recognition/ransac_based/hypothesis.h @@ -74,17 +74,15 @@ namespace pcl } public: - float rigid_transform_[12]; - const ModelLibrary::Model* obj_model_; + float rigid_transform_[12]{}; + const ModelLibrary::Model* obj_model_{nullptr}; }; class Hypothesis: public HypothesisBase { public: Hypothesis (const ModelLibrary::Model* obj_model = nullptr) - : HypothesisBase (obj_model), - match_confidence_ (-1.0f), - linear_id_ (-1) + : HypothesisBase (obj_model) { } @@ -149,9 +147,9 @@ namespace pcl } public: - float match_confidence_; + float match_confidence_{-1.0f}; std::set explained_pixels_; - int linear_id_; + int linear_id_{-1}; }; } // namespace recognition } // namespace pcl diff --git a/recognition/include/pcl/recognition/ransac_based/model_library.h b/recognition/include/pcl/recognition/ransac_based/model_library.h index 71b083fffba..a1c8ac673e5 100644 --- a/recognition/include/pcl/recognition/ransac_based/model_library.h +++ b/recognition/include/pcl/recognition/ransac_based/model_library.h @@ -258,7 +258,7 @@ namespace pcl float pair_width_; float voxel_size_; float max_coplanarity_angle_; - bool ignore_coplanar_opps_; + bool ignore_coplanar_opps_{true}; std::map models_; HashTable hash_table_; diff --git a/recognition/include/pcl/recognition/ransac_based/obj_rec_ransac.h b/recognition/include/pcl/recognition/ransac_based/obj_rec_ransac.h index c2aa6173262..c4d3723e0bf 100644 --- a/recognition/include/pcl/recognition/ransac_based/obj_rec_ransac.h +++ b/recognition/include/pcl/recognition/ransac_based/obj_rec_ransac.h @@ -454,15 +454,15 @@ namespace pcl float position_discretization_; float rotation_discretization_; float abs_zdist_thresh_; - float relative_obj_size_; - float visibility_; - float relative_num_of_illegal_pts_; - float intersection_fraction_; + float relative_obj_size_{0.05f}; + float visibility_{0.2f}; + float relative_num_of_illegal_pts_{0.02f}; + float intersection_fraction_{0.03f}; float max_coplanarity_angle_; - float scene_bounds_enlargement_factor_; - bool ignore_coplanar_opps_; - float frac_of_points_for_icp_refinement_; - bool do_icp_hypotheses_refinement_; + float scene_bounds_enlargement_factor_{0.25f}; + bool ignore_coplanar_opps_{true}; + float frac_of_points_for_icp_refinement_{0.3f}; + bool do_icp_hypotheses_refinement_{true}; ModelLibrary model_library_; ORROctree scene_octree_; @@ -473,7 +473,7 @@ namespace pcl std::list sampled_oriented_point_pairs_; std::vector accepted_hypotheses_; - Recognition_Mode rec_mode_; + Recognition_Mode rec_mode_{ObjRecRANSAC::FULL_RECOGNITION}; }; } // namespace recognition } // namespace pcl diff --git a/recognition/include/pcl/recognition/ransac_based/orr_octree.h b/recognition/include/pcl/recognition/ransac_based/orr_octree.h index 8c8fd7e354a..870624a228f 100644 --- a/recognition/include/pcl/recognition/ransac_based/orr_octree.h +++ b/recognition/include/pcl/recognition/ransac_based/orr_octree.h @@ -83,7 +83,7 @@ namespace pcl id_y_ (id_y), id_z_ (id_z), lin_id_ (lin_id), - num_points_ (0), + user_data_ (user_data) { n_[0] = n_[1] = n_[2] = p_[0] = p_[1] = p_[2] = 0.0f; @@ -156,17 +156,13 @@ namespace pcl getNeighbors () const { return (neighbors_);} protected: - float n_[3], p_[3]; - int id_x_, id_y_, id_z_, lin_id_, num_points_; + float n_[3]{}, p_[3]{}; + int id_x_{0}, id_y_{0}, id_z_{0}, lin_id_{0}, num_points_{0}; std::set neighbors_; - void *user_data_; + void *user_data_{nullptr}; }; - Node () - : data_ (nullptr), - parent_ (nullptr), - children_(nullptr) - {} + Node () = default; virtual~ Node () { @@ -264,9 +260,9 @@ namespace pcl } protected: - Node::Data *data_; - float center_[3], bounds_[6], radius_; - Node *parent_, *children_; + Node::Data *data_{nullptr}; + float center_[3]{}, bounds_[6]{}, radius_{0.0f}; + Node *parent_{nullptr}, *children_{nullptr}; }; ORROctree (); @@ -472,9 +468,9 @@ namespace pcl } protected: - float voxel_size_, bounds_[6]; - int tree_levels_; - Node* root_; + float voxel_size_{-1.0}, bounds_[6]; + int tree_levels_{-1}; + Node* root_{nullptr}; std::vector full_leaves_; }; } // namespace recognition diff --git a/recognition/include/pcl/recognition/ransac_based/orr_octree_zprojection.h b/recognition/include/pcl/recognition/ransac_based/orr_octree_zprojection.h index d485fc65cea..e05addd73fe 100644 --- a/recognition/include/pcl/recognition/ransac_based/orr_octree_zprojection.h +++ b/recognition/include/pcl/recognition/ransac_based/orr_octree_zprojection.h @@ -113,10 +113,8 @@ namespace pcl }; public: - ORROctreeZProjection () - : pixels_(nullptr), - sets_(nullptr) - {} + ORROctreeZProjection () = default; + virtual ~ORROctreeZProjection (){ this->clear();} void @@ -200,8 +198,8 @@ namespace pcl protected: float pixel_size_, inv_pixel_size_, bounds_[4], extent_x_, extent_y_; int num_pixels_x_, num_pixels_y_, num_pixels_; - Pixel ***pixels_; - Set ***sets_; + Pixel ***pixels_{nullptr}; + Set ***sets_{nullptr}; std::list full_sets_; std::list full_pixels_; }; diff --git a/recognition/include/pcl/recognition/ransac_based/rigid_transform_space.h b/recognition/include/pcl/recognition/ransac_based/rigid_transform_space.h index 3e92dd984f8..a47a30748a5 100644 --- a/recognition/include/pcl/recognition/ransac_based/rigid_transform_space.h +++ b/recognition/include/pcl/recognition/ransac_based/rigid_transform_space.h @@ -62,7 +62,6 @@ namespace pcl { public: Entry () - : num_transforms_ (0) { aux::set3 (axis_angle_, 0.0f); aux::set3 (translation_, 0.0f); @@ -134,7 +133,7 @@ namespace pcl protected: float axis_angle_[3], translation_[3]; - int num_transforms_; + int num_transforms_{0}; };// class Entry public: @@ -293,9 +292,7 @@ namespace pcl class RotationSpaceCreator { public: - RotationSpaceCreator() - : counter_ (0) - {} + RotationSpaceCreator() = default; virtual ~RotationSpaceCreator() = default; @@ -331,7 +328,7 @@ namespace pcl protected: float discretization_; - int counter_; + int counter_{0}; std::list rotation_spaces_; }; diff --git a/recognition/include/pcl/recognition/ransac_based/simple_octree.h b/recognition/include/pcl/recognition/ransac_based/simple_octree.h index 5084c7dbc51..fde0ff0e76e 100644 --- a/recognition/include/pcl/recognition/ransac_based/simple_octree.h +++ b/recognition/include/pcl/recognition/ransac_based/simple_octree.h @@ -198,11 +198,11 @@ namespace pcl insertNeighbors (Node* node); protected: - Scalar voxel_size_, bounds_[6]; - int tree_levels_; - Node* root_; + Scalar voxel_size_{0.0f}, bounds_[6]{}; + int tree_levels_{0}; + Node* root_{nullptr}; std::vector full_leaves_; - NodeDataCreator* node_data_creator_; + NodeDataCreator* node_data_creator_{nullptr}; }; } // namespace recognition } // namespace pcl diff --git a/recognition/include/pcl/recognition/ransac_based/trimmed_icp.h b/recognition/include/pcl/recognition/ransac_based/trimmed_icp.h index a26bca5b5db..ee731eba107 100644 --- a/recognition/include/pcl/recognition/ransac_based/trimmed_icp.h +++ b/recognition/include/pcl/recognition/ransac_based/trimmed_icp.h @@ -68,9 +68,7 @@ namespace pcl using Matrix4 = typename Eigen::Matrix; public: - TrimmedICP () - : new_to_old_energy_ratio_ (0.99f) - {} + TrimmedICP () = default; ~TrimmedICP () override = default; @@ -177,7 +175,7 @@ namespace pcl protected: PointCloudConstPtr target_points_; pcl::KdTreeFLANN kdtree_; - float new_to_old_energy_ratio_; + float new_to_old_energy_ratio_{0.99f}; }; } // namespace recognition } // namespace pcl diff --git a/recognition/include/pcl/recognition/region_xy.h b/recognition/include/pcl/recognition/region_xy.h index 78d413cdeb0..38260f1dd5c 100644 --- a/recognition/include/pcl/recognition/region_xy.h +++ b/recognition/include/pcl/recognition/region_xy.h @@ -4,7 +4,7 @@ * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2010-2011, Willow Garage, Inc. * - * All rights reserved. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -81,16 +81,16 @@ namespace pcl struct PCL_EXPORTS RegionXY { /** \brief Constructor. */ - RegionXY () : x (0), y (0), width (0), height (0) {} + RegionXY () = default; /** \brief x-position of the region. */ - int x; + int x{0}; /** \brief y-position of the region. */ - int y; + int y{0}; /** \brief width of the region. */ - int width; + int width{0}; /** \brief height of the region. */ - int height; + int height{0}; /** \brief Serializes the object to the specified stream. * \param[out] stream the stream the object will be serialized to. */ @@ -105,7 +105,7 @@ namespace pcl /** \brief Deserializes the object from the specified stream. * \param[in] stream the stream the object will be deserialized from. */ - void + void deserialize (::std::istream & stream) { read (stream, x); diff --git a/recognition/include/pcl/recognition/sparse_quantized_multi_mod_template.h b/recognition/include/pcl/recognition/sparse_quantized_multi_mod_template.h index a626933ce63..70364c3a521 100644 --- a/recognition/include/pcl/recognition/sparse_quantized_multi_mod_template.h +++ b/recognition/include/pcl/recognition/sparse_quantized_multi_mod_template.h @@ -4,7 +4,7 @@ * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2010-2011, Willow Garage, Inc. * - * All rights reserved. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,24 +44,24 @@ namespace pcl { - /** \brief Feature that defines a position and quantized value in a specific modality. + /** \brief Feature that defines a position and quantized value in a specific modality. * \author Stefan Holzer */ struct QuantizedMultiModFeature { /** \brief Constructor. */ - QuantizedMultiModFeature () : x (0), y (0), modality_index (0), quantized_value (0) {} + QuantizedMultiModFeature () = default; /** \brief x-position. */ - int x; + int x{0}; /** \brief y-position. */ - int y; + int y{0}; /** \brief the index of the corresponding modality. */ - std::size_t modality_index; + std::size_t modality_index{0u}; /** \brief the quantized value attached to the feature. */ - unsigned char quantized_value; + unsigned char quantized_value{0u}; - /** \brief Compares whether two features are the same. + /** \brief Compares whether two features are the same. * \param[in] base the feature to compare to. */ bool @@ -81,7 +81,7 @@ namespace pcl /** \brief Serializes the object to the specified stream. * \param[out] stream the stream the object will be serialized to. */ - void + void serialize (std::ostream & stream) const { write (stream, x); @@ -92,7 +92,7 @@ namespace pcl /** \brief Deserializes the object from the specified stream. * \param[in] stream the stream the object will be deserialized from. */ - void + void deserialize (std::istream & stream) { read (stream, x); @@ -103,7 +103,7 @@ namespace pcl }; /** \brief A multi-modality template constructed from a set of quantized multi-modality features. - * \author Stefan Holzer + * \author Stefan Holzer */ struct SparseQuantizedMultiModTemplate { @@ -118,7 +118,7 @@ namespace pcl /** \brief Serializes the object to the specified stream. * \param[out] stream the stream the object will be serialized to. */ - void + void serialize (std::ostream & stream) const { const int num_of_features = static_cast (features.size ()); @@ -133,7 +133,7 @@ namespace pcl /** \brief Deserializes the object from the specified stream. * \param[in] stream the stream the object will be deserialized from. */ - void + void deserialize (std::istream & stream) { features.clear (); diff --git a/recognition/include/pcl/recognition/surface_normal_modality.h b/recognition/include/pcl/recognition/surface_normal_modality.h index 3e0c7866b77..538e88c598d 100644 --- a/recognition/include/pcl/recognition/surface_normal_modality.h +++ b/recognition/include/pcl/recognition/surface_normal_modality.h @@ -63,7 +63,7 @@ namespace pcl { public: /** \brief Constructor. */ - inline LINEMOD_OrientationMap () : width_ (0), height_ (0) {} + inline LINEMOD_OrientationMap () = default; /** \brief Destructor. */ inline ~LINEMOD_OrientationMap () = default; @@ -118,9 +118,9 @@ namespace pcl private: /** \brief The width of the map. */ - std::size_t width_; + std::size_t width_{0}; /** \brief The height of the map. */ - std::size_t height_; + std::size_t height_{0}; /** \brief Storage for the data of the map. */ std::vector map_; @@ -132,35 +132,31 @@ namespace pcl struct QuantizedNormalLookUpTable { /** \brief The range of the LUT in x-direction. */ - int range_x; + int range_x{-1}; /** \brief The range of the LUT in y-direction. */ - int range_y; + int range_y{-1}; /** \brief The range of the LUT in z-direction. */ - int range_z; + int range_z{-1}; /** \brief The offset in x-direction. */ - int offset_x; + int offset_x{-1}; /** \brief The offset in y-direction. */ - int offset_y; + int offset_y{-1}; /** \brief The offset in z-direction. */ - int offset_z; + int offset_z{-1}; /** \brief The size of the LUT in x-direction. */ - int size_x; + int size_x{-1}; /** \brief The size of the LUT in y-direction. */ - int size_y; + int size_y{-1}; /** \brief The size of the LUT in z-direction. */ - int size_z; + int size_z{-1}; /** \brief The LUT data. */ - unsigned char * lut; + unsigned char * lut{nullptr}; /** \brief Constructor. */ - QuantizedNormalLookUpTable () : - range_x (-1), range_y (-1), range_z (-1), - offset_x (-1), offset_y (-1), offset_z (-1), - size_x (-1), size_y (-1), size_z (-1), lut (nullptr) - {} + QuantizedNormalLookUpTable () = default; /** \brief Destructor. */ ~QuantizedNormalLookUpTable () @@ -306,20 +302,20 @@ namespace pcl struct Candidate { /** \brief Constructor. */ - Candidate () : distance (0.0f), bin_index (0), x (0), y (0) {} + Candidate () = default; /** \brief Normal. */ Normal normal; /** \brief Distance to the next different quantized value. */ - float distance; + float distance{0.0f}; /** \brief Quantized value. */ - unsigned char bin_index; + unsigned char bin_index{0}; /** \brief x-position of the feature. */ - std::size_t x; + std::size_t x{0}; /** \brief y-position of the feature. */ - std::size_t y; + std::size_t y{0}; /** \brief Compares two candidates based on their distance to the next different quantized value. * \param[in] rhs the candidate to compare with. @@ -463,18 +459,18 @@ namespace pcl private: /** \brief Determines whether variable numbers of features are extracted or not. */ - bool variable_feature_nr_; + bool variable_feature_nr_{false}; /** \brief The feature distance threshold. */ - float feature_distance_threshold_; + float feature_distance_threshold_{2.0f}; /** \brief Minimum distance of a feature to a border. */ - float min_distance_to_border_; + float min_distance_to_border_{2.0f}; /** \brief Look-up-table for quantizing surface normals. */ QuantizedNormalLookUpTable normal_lookup_; /** \brief The spreading size. */ - std::size_t spreading_size_; + std::size_t spreading_size_{8}; /** \brief Point cloud holding the computed surface normals. */ pcl::PointCloud surface_normals_; @@ -495,13 +491,7 @@ namespace pcl ////////////////////////////////////////////////////////////////////////////////////////////// template pcl::SurfaceNormalModality:: -SurfaceNormalModality () - : variable_feature_nr_ (false) - , feature_distance_threshold_ (2.0f) - , min_distance_to_border_ (2.0f) - , spreading_size_ (8) -{ -} +SurfaceNormalModality () = default; ////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/recognition/src/linemod.cpp b/recognition/src/linemod.cpp index bbdf6be2122..8b47552e2b3 100644 --- a/recognition/src/linemod.cpp +++ b/recognition/src/linemod.cpp @@ -48,12 +48,7 @@ //#define LINEMOD_USE_SEPARATE_ENERGY_MAPS ////////////////////////////////////////////////////////////////////////////////////////////// -pcl::LINEMOD::LINEMOD () - : template_threshold_ (0.75f) - , use_non_max_suppression_ (false) - , average_detections_ (false) -{ -} +pcl::LINEMOD::LINEMOD () = default; ////////////////////////////////////////////////////////////////////////////////////////////// pcl::LINEMOD::~LINEMOD() = default; diff --git a/recognition/src/ransac_based/model_library.cpp b/recognition/src/ransac_based/model_library.cpp index 2f7bad0d9dd..dd3d3efdabc 100644 --- a/recognition/src/ransac_based/model_library.cpp +++ b/recognition/src/ransac_based/model_library.cpp @@ -51,8 +51,7 @@ using namespace pcl::recognition; ModelLibrary::ModelLibrary (float pair_width, float voxel_size, float max_coplanarity_angle) : pair_width_ (pair_width), voxel_size_ (voxel_size), - max_coplanarity_angle_ (max_coplanarity_angle), - ignore_coplanar_opps_ (true) + max_coplanarity_angle_ (max_coplanarity_angle) { num_of_cells_[0] = 60; num_of_cells_[1] = 60; diff --git a/recognition/src/ransac_based/obj_rec_ransac.cpp b/recognition/src/ransac_based/obj_rec_ransac.cpp index 7ba4c5137e8..a57b2d4bc6f 100644 --- a/recognition/src/ransac_based/obj_rec_ransac.cpp +++ b/recognition/src/ransac_based/obj_rec_ransac.cpp @@ -48,17 +48,8 @@ pcl::recognition::ObjRecRANSAC::ObjRecRANSAC (float pair_width, float voxel_size position_discretization_ (5.0f*voxel_size_), rotation_discretization_ (5.0f*AUX_DEG_TO_RADIANS), abs_zdist_thresh_ (1.5f*voxel_size_), - relative_obj_size_ (0.05f), - visibility_ (0.2f), - relative_num_of_illegal_pts_ (0.02f), - intersection_fraction_ (0.03f), max_coplanarity_angle_ (3.0f*AUX_DEG_TO_RADIANS), - scene_bounds_enlargement_factor_ (0.25f), // 25% enlargement - ignore_coplanar_opps_ (true), - frac_of_points_for_icp_refinement_ (0.3f), - do_icp_hypotheses_refinement_ (true), - model_library_ (pair_width, voxel_size, max_coplanarity_angle_), - rec_mode_ (ObjRecRANSAC::FULL_RECOGNITION) + model_library_ (pair_width, voxel_size, max_coplanarity_angle_) { } diff --git a/recognition/src/ransac_based/orr_octree.cpp b/recognition/src/ransac_based/orr_octree.cpp index e1b2fd48657..07e2ea88191 100644 --- a/recognition/src/ransac_based/orr_octree.cpp +++ b/recognition/src/ransac_based/orr_octree.cpp @@ -47,12 +47,7 @@ using namespace pcl::recognition; -pcl::recognition::ORROctree::ORROctree () -: voxel_size_ (-1.0), - tree_levels_ (-1), - root_ (nullptr) -{ -} +pcl::recognition::ORROctree::ORROctree () = default; //================================================================================================================================================================ diff --git a/registration/include/pcl/registration/correspondence_estimation.h b/registration/include/pcl/registration/correspondence_estimation.h index 3837e3ba5ea..bb1db6aab3a 100644 --- a/registration/include/pcl/registration/correspondence_estimation.h +++ b/registration/include/pcl/registration/correspondence_estimation.h @@ -98,10 +98,6 @@ class CorrespondenceEstimationBase : public PCLBase { , target_() , point_representation_() , input_transformed_() - , target_cloud_updated_(true) - , source_cloud_updated_(true) - , force_no_recompute_(false) - , force_no_recompute_reciprocal_(false) {} /** \brief Empty destructor */ @@ -354,18 +350,18 @@ class CorrespondenceEstimationBase : public PCLBase { /** \brief Variable that stores whether we have a new target cloud, meaning we need to * pre-process it again. This way, we avoid rebuilding the kd-tree for the target * cloud every time the determineCorrespondences () method is called. */ - bool target_cloud_updated_; + bool target_cloud_updated_{true}; /** \brief Variable that stores whether we have a new source cloud, meaning we need to * pre-process it again. This way, we avoid rebuilding the reciprocal kd-tree for the * source cloud every time the determineCorrespondences () method is called. */ - bool source_cloud_updated_; + bool source_cloud_updated_{true}; /** \brief A flag which, if set, means the tree operating on the target cloud * will never be recomputed*/ - bool force_no_recompute_; + bool force_no_recompute_{false}; /** \brief A flag which, if set, means the tree operating on the source cloud * will never be recomputed*/ - bool force_no_recompute_reciprocal_; + bool force_no_recompute_reciprocal_{false}; }; /** \brief @b CorrespondenceEstimation represents the base class for diff --git a/registration/include/pcl/registration/correspondence_estimation_backprojection.h b/registration/include/pcl/registration/correspondence_estimation_backprojection.h index eb695201c93..479b5a60386 100644 --- a/registration/include/pcl/registration/correspondence_estimation_backprojection.h +++ b/registration/include/pcl/registration/correspondence_estimation_backprojection.h @@ -99,7 +99,7 @@ class CorrespondenceEstimationBackProjection * Sets the number of neighbors to be considered in the target point cloud (k_) to 10. */ CorrespondenceEstimationBackProjection() - : source_normals_(), source_normals_transformed_(), target_normals_(), k_(10) + : source_normals_(), source_normals_transformed_(), target_normals_() { corr_name_ = "CorrespondenceEstimationBackProjection"; } @@ -250,7 +250,7 @@ class CorrespondenceEstimationBackProjection NormalsConstPtr target_normals_; /** \brief The number of neighbours to be considered in the target point cloud */ - unsigned int k_; + unsigned int k_{10}; }; } // namespace registration } // namespace pcl diff --git a/registration/include/pcl/registration/correspondence_estimation_normal_shooting.h b/registration/include/pcl/registration/correspondence_estimation_normal_shooting.h index e0e8ab424b5..cab09d4b43d 100644 --- a/registration/include/pcl/registration/correspondence_estimation_normal_shooting.h +++ b/registration/include/pcl/registration/correspondence_estimation_normal_shooting.h @@ -132,7 +132,7 @@ class CorrespondenceEstimationNormalShooting * Sets the number of neighbors to be considered in the target point cloud (k_) to 10. */ CorrespondenceEstimationNormalShooting() - : source_normals_(), source_normals_transformed_(), k_(10) + : source_normals_(), source_normals_transformed_() { corr_name_ = "CorrespondenceEstimationNormalShooting"; } @@ -248,7 +248,7 @@ class CorrespondenceEstimationNormalShooting NormalsPtr source_normals_transformed_; /** \brief The number of neighbours to be considered in the target point cloud */ - unsigned int k_; + unsigned int k_{10}; }; } // namespace registration } // namespace pcl diff --git a/registration/include/pcl/registration/correspondence_estimation_organized_projection.h b/registration/include/pcl/registration/correspondence_estimation_organized_projection.h index 97bf14ab188..e7e39e85cc0 100644 --- a/registration/include/pcl/registration/correspondence_estimation_organized_projection.h +++ b/registration/include/pcl/registration/correspondence_estimation_organized_projection.h @@ -90,11 +90,7 @@ class CorrespondenceEstimationOrganizedProjection /** \brief Empty constructor that sets all the intrinsic calibration to the default * Kinect values. */ CorrespondenceEstimationOrganizedProjection() - : fx_(525.f) - , fy_(525.f) - , cx_(319.5f) - , cy_(239.5f) - , src_to_tgt_transformation_(Eigen::Matrix4f::Identity()) + : src_to_tgt_transformation_(Eigen::Matrix4f::Identity()) , depth_threshold_(std::numeric_limits::max()) , projection_matrix_(Eigen::Matrix3f::Identity()) {} @@ -223,8 +219,8 @@ class CorrespondenceEstimationOrganizedProjection bool initCompute(); - float fx_, fy_; - float cx_, cy_; + float fx_{525.f}, fy_{525.f}; + float cx_{319.5f}, cy_{239.5f}; Eigen::Matrix4f src_to_tgt_transformation_; float depth_threshold_; diff --git a/registration/include/pcl/registration/correspondence_rejection.h b/registration/include/pcl/registration/correspondence_rejection.h index 1392d6f6e9b..f68882ab665 100644 --- a/registration/include/pcl/registration/correspondence_rejection.h +++ b/registration/include/pcl/registration/correspondence_rejection.h @@ -198,7 +198,7 @@ class CorrespondenceRejector { protected: /** \brief The name of the rejection method. */ - std::string rejection_name_; + std::string rejection_name_{}; /** \brief The input correspondences. */ CorrespondencesConstPtr input_correspondences_; @@ -254,8 +254,6 @@ class DataContainer : public DataContainerInterface { , tree_(new pcl::search::KdTree) , class_name_("DataContainer") , needs_normals_(needs_normals) - , target_cloud_updated_(true) - , force_no_recompute_(false) {} /** \brief Empty destructor */ @@ -420,11 +418,11 @@ class DataContainer : public DataContainerInterface { /** \brief Variable that stores whether we have a new target cloud, meaning we need to * pre-process it again. This way, we avoid rebuilding the kd-tree */ - bool target_cloud_updated_; + bool target_cloud_updated_{true}; /** \brief A flag which, if set, means the tree operating on the target cloud * will never be recomputed*/ - bool force_no_recompute_; + bool force_no_recompute_{false}; /** \brief Get a string representation of the name of this class. */ inline const std::string& diff --git a/registration/include/pcl/registration/correspondence_rejection_median_distance.h b/registration/include/pcl/registration/correspondence_rejection_median_distance.h index 0d5f00c60bd..16edbbbca95 100644 --- a/registration/include/pcl/registration/correspondence_rejection_median_distance.h +++ b/registration/include/pcl/registration/correspondence_rejection_median_distance.h @@ -68,7 +68,7 @@ class PCL_EXPORTS CorrespondenceRejectorMedianDistance : public CorrespondenceRe using ConstPtr = shared_ptr; /** \brief Empty constructor. */ - CorrespondenceRejectorMedianDistance() : median_distance_(0), factor_(1.0) + CorrespondenceRejectorMedianDistance() { rejection_name_ = "CorrespondenceRejectorMedianDistance"; } @@ -193,12 +193,12 @@ class PCL_EXPORTS CorrespondenceRejectorMedianDistance : public CorrespondenceRe /** \brief The median distance threshold between two correspondent points in source * <-> target. */ - double median_distance_; + double median_distance_{0}; /** \brief The factor for correspondence rejection. Points with distance greater than * median times factor will be rejected */ - double factor_; + double factor_{1.0}; using DataContainerPtr = DataContainerInterface::Ptr; diff --git a/registration/include/pcl/registration/correspondence_rejection_organized_boundary.h b/registration/include/pcl/registration/correspondence_rejection_organized_boundary.h index 25ec0d9581e..23662a515a5 100644 --- a/registration/include/pcl/registration/correspondence_rejection_organized_boundary.h +++ b/registration/include/pcl/registration/correspondence_rejection_organized_boundary.h @@ -59,9 +59,7 @@ class PCL_EXPORTS CorrespondenceRejectionOrganizedBoundary : public CorrespondenceRejector { public: /** @brief Empty constructor. */ - CorrespondenceRejectionOrganizedBoundary() - : boundary_nans_threshold_(8), window_size_(5), depth_step_threshold_(0.025f) - {} + CorrespondenceRejectionOrganizedBoundary() = default; void getRemainingCorrespondences(const pcl::Correspondences& original_correspondences, @@ -141,9 +139,9 @@ class PCL_EXPORTS CorrespondenceRejectionOrganizedBoundary getRemainingCorrespondences(*input_correspondences_, correspondences); } - int boundary_nans_threshold_; - int window_size_; - float depth_step_threshold_; + int boundary_nans_threshold_{8}; + int window_size_{5}; + float depth_step_threshold_{0.025f}; using DataContainerPtr = DataContainerInterface::Ptr; DataContainerPtr data_container_; diff --git a/registration/include/pcl/registration/correspondence_rejection_poly.h b/registration/include/pcl/registration/correspondence_rejection_poly.h index a5615118c97..16ad6ca841b 100644 --- a/registration/include/pcl/registration/correspondence_rejection_poly.h +++ b/registration/include/pcl/registration/correspondence_rejection_poly.h @@ -78,14 +78,7 @@ class PCL_EXPORTS CorrespondenceRejectorPoly : public CorrespondenceRejector { using PointCloudTargetConstPtr = typename PointCloudTarget::ConstPtr; /** \brief Empty constructor */ - CorrespondenceRejectorPoly() - : iterations_(10000) - , cardinality_(3) - , similarity_threshold_(0.75f) - , similarity_threshold_squared_(0.75f * 0.75f) - { - rejection_name_ = "CorrespondenceRejectorPoly"; - } + CorrespondenceRejectorPoly() { rejection_name_ = "CorrespondenceRejectorPoly"; } /** \brief Get a list of valid correspondences after rejection from the original set * of correspondences. @@ -371,17 +364,17 @@ class PCL_EXPORTS CorrespondenceRejectorPoly : public CorrespondenceRejector { PointCloudTargetConstPtr target_; /** \brief Number of iterations to run */ - int iterations_; + int iterations_{10000}; /** \brief The polygon cardinality used during rejection */ - int cardinality_; + int cardinality_{3}; /** \brief Lower edge length threshold in [0,1] used for verifying polygon * similarities, where 1 is a perfect match */ - float similarity_threshold_; + float similarity_threshold_{0.75f}; /** \brief Squared value if \ref similarity_threshold_, only for internal use */ - float similarity_threshold_squared_; + float similarity_threshold_squared_{0.75f * 0.75f}; }; } // namespace registration } // namespace pcl diff --git a/registration/include/pcl/registration/correspondence_rejection_sample_consensus.h b/registration/include/pcl/registration/correspondence_rejection_sample_consensus.h index 2920b3325c4..1b464c9bc87 100644 --- a/registration/include/pcl/registration/correspondence_rejection_sample_consensus.h +++ b/registration/include/pcl/registration/correspondence_rejection_sample_consensus.h @@ -67,14 +67,7 @@ class CorrespondenceRejectorSampleConsensus : public CorrespondenceRejector { /** \brief Empty constructor. Sets the inlier threshold to 5cm (0.05m), * and the maximum number of iterations to 1000. */ - CorrespondenceRejectorSampleConsensus() - : inlier_threshold_(0.05) - , max_iterations_(1000) // std::numeric_limits::max () - , input_() - , input_transformed_() - , target_() - , refine_(false) - , save_inliers_(false) + CorrespondenceRejectorSampleConsensus() : input_(), input_transformed_(), target_() { rejection_name_ = "CorrespondenceRejectorSampleConsensus"; } @@ -256,9 +249,9 @@ class CorrespondenceRejectorSampleConsensus : public CorrespondenceRejector { getRemainingCorrespondences(*input_correspondences_, correspondences); } - double inlier_threshold_; + double inlier_threshold_{0.05}; - int max_iterations_; + int max_iterations_{1000}; PointCloudConstPtr input_; PointCloudPtr input_transformed_; @@ -266,9 +259,9 @@ class CorrespondenceRejectorSampleConsensus : public CorrespondenceRejector { Eigen::Matrix4f best_transformation_; - bool refine_; + bool refine_{false}; pcl::Indices inlier_indices_; - bool save_inliers_; + bool save_inliers_{false}; public: PCL_MAKE_ALIGNED_OPERATOR_NEW diff --git a/registration/include/pcl/registration/correspondence_rejection_surface_normal.h b/registration/include/pcl/registration/correspondence_rejection_surface_normal.h index 520276105c1..d2795748e5f 100644 --- a/registration/include/pcl/registration/correspondence_rejection_surface_normal.h +++ b/registration/include/pcl/registration/correspondence_rejection_surface_normal.h @@ -67,7 +67,7 @@ class PCL_EXPORTS CorrespondenceRejectorSurfaceNormal : public CorrespondenceRej using ConstPtr = shared_ptr; /** \brief Empty constructor. Sets the threshold to 1.0. */ - CorrespondenceRejectorSurfaceNormal() : threshold_(1.0) + CorrespondenceRejectorSurfaceNormal() { rejection_name_ = "CorrespondenceRejectorSurfaceNormal"; } @@ -342,7 +342,7 @@ class PCL_EXPORTS CorrespondenceRejectorSurfaceNormal : public CorrespondenceRej /** \brief The median distance threshold between two correspondent points in source * <-> target. */ - double threshold_; + double threshold_{1.0}; using DataContainerPtr = DataContainerInterface::Ptr; /** \brief A pointer to the DataContainer object containing the input and target point diff --git a/registration/include/pcl/registration/correspondence_rejection_trimmed.h b/registration/include/pcl/registration/correspondence_rejection_trimmed.h index 1b037bfe7de..202ca9d566a 100644 --- a/registration/include/pcl/registration/correspondence_rejection_trimmed.h +++ b/registration/include/pcl/registration/correspondence_rejection_trimmed.h @@ -68,10 +68,7 @@ class PCL_EXPORTS CorrespondenceRejectorTrimmed : public CorrespondenceRejector using ConstPtr = shared_ptr; /** \brief Empty constructor. */ - CorrespondenceRejectorTrimmed() : overlap_ratio_(0.5f), nr_min_correspondences_(0) - { - rejection_name_ = "CorrespondenceRejectorTrimmed"; - } + CorrespondenceRejectorTrimmed() { rejection_name_ = "CorrespondenceRejectorTrimmed"; } /** \brief Destructor. */ ~CorrespondenceRejectorTrimmed() override = default; @@ -135,10 +132,10 @@ class PCL_EXPORTS CorrespondenceRejectorTrimmed : public CorrespondenceRejector } /** Overlap Ratio in [0..1] */ - float overlap_ratio_; + float overlap_ratio_{0.5f}; /** Minimum number of correspondences. */ - unsigned int nr_min_correspondences_; + unsigned int nr_min_correspondences_{0}; }; } // namespace registration diff --git a/registration/include/pcl/registration/correspondence_rejection_var_trimmed.h b/registration/include/pcl/registration/correspondence_rejection_var_trimmed.h index e5b5c7a7aa6..7d7607fa9cb 100644 --- a/registration/include/pcl/registration/correspondence_rejection_var_trimmed.h +++ b/registration/include/pcl/registration/correspondence_rejection_var_trimmed.h @@ -73,7 +73,6 @@ class PCL_EXPORTS CorrespondenceRejectorVarTrimmed : public CorrespondenceReject /** \brief Empty constructor. */ CorrespondenceRejectorVarTrimmed() - : trimmed_distance_(0), factor_(), min_ratio_(0.05), max_ratio_(0.95), lambda_(0.95) { rejection_name_ = "CorrespondenceRejectorVarTrimmed"; } @@ -224,26 +223,26 @@ class PCL_EXPORTS CorrespondenceRejectorVarTrimmed : public CorrespondenceReject /** \brief The inlier distance threshold (based on the computed trim factor) between * two correspondent points in source <-> target. */ - double trimmed_distance_; + double trimmed_distance_{0}; /** \brief The factor for correspondence rejection. Only factor times the total points * sorted based on the correspondence distances will be considered as inliers. * Remaining points are rejected. This factor is computed internally */ - double factor_; + double factor_{0.0}; /** \brief The minimum overlap ratio between the input and target clouds */ - double min_ratio_; + double min_ratio_{0.05}; /** \brief The maximum overlap ratio between the input and target clouds */ - double max_ratio_; + double max_ratio_{0.95}; /** \brief part of the term that balances the root mean square difference. This is an * internal parameter */ - double lambda_; + double lambda_{0.95}; using DataContainerPtr = DataContainerInterface::Ptr; diff --git a/registration/include/pcl/registration/default_convergence_criteria.h b/registration/include/pcl/registration/default_convergence_criteria.h index dd742438587..b8cbd795ad6 100644 --- a/registration/include/pcl/registration/default_convergence_criteria.h +++ b/registration/include/pcl/registration/default_convergence_criteria.h @@ -97,17 +97,6 @@ class DefaultConvergenceCriteria : public ConvergenceCriteria { : iterations_(iterations) , transformation_(transform) , correspondences_(correspondences) - , correspondences_prev_mse_(std::numeric_limits::max()) - , correspondences_cur_mse_(std::numeric_limits::max()) - , max_iterations_(100) // 100 iterations - , failure_after_max_iter_(false) - , rotation_threshold_(0.99999) // 0.256 degrees - , translation_threshold_(3e-4 * 3e-4) // 0.0003 meters - , mse_threshold_relative_(0.00001) // 0.001% of the previous MSE (relative error) - , mse_threshold_absolute_(1e-12) // MSE (absolute error) - , iterations_similar_transforms_(0) - , max_iterations_similar_transforms_(0) - , convergence_state_(CONVERGENCE_CRITERIA_NOT_CONVERGED) {} /** \brief Empty destructor */ @@ -291,45 +280,45 @@ class DefaultConvergenceCriteria : public ConvergenceCriteria { const pcl::Correspondences& correspondences_; /** \brief The MSE for the previous set of correspondences. */ - double correspondences_prev_mse_; + double correspondences_prev_mse_{std::numeric_limits::max()}; /** \brief The MSE for the current set of correspondences. */ - double correspondences_cur_mse_; + double correspondences_cur_mse_{std::numeric_limits::max()}; /** \brief The maximum nuyyGmber of iterations that the registration loop is to be * executed. */ - int max_iterations_; + int max_iterations_{100}; /** \brief Specifys if the registration fails or converges when the maximum number of * iterations is reached. */ - bool failure_after_max_iter_; + bool failure_after_max_iter_{false}; /** \brief The rotation threshold is the relative rotation between two iterations (as * angle cosine). */ - double rotation_threshold_; + double rotation_threshold_{0.99999}; /** \brief The translation threshold is the relative translation between two * iterations (0 if no translation). */ - double translation_threshold_; + double translation_threshold_{3e-4 * 3e-4}; // 0.0003 meters /** \brief The relative change from the previous MSE for the current set of * correspondences, e.g. .1 means 10% change. */ - double mse_threshold_relative_; + double mse_threshold_relative_{0.00001}; /** \brief The absolute change from the previous MSE for the current set of * correspondences. */ - double mse_threshold_absolute_; + double mse_threshold_absolute_{1e-12}; /** \brief Internal counter for the number of iterations that the internal * rotation, translation, and MSE differences are allowed to be similar. */ - int iterations_similar_transforms_; + int iterations_similar_transforms_{0}; /** \brief The maximum number of iterations that the internal rotation, * translation, and MSE differences are allowed to be similar. */ - int max_iterations_similar_transforms_; + int max_iterations_similar_transforms_{0}; /** \brief The state of the convergence (e.g., why did the registration converge). */ - ConvergenceState convergence_state_; + ConvergenceState convergence_state_{CONVERGENCE_CRITERIA_NOT_CONVERGED}; public: PCL_MAKE_ALIGNED_OPERATOR_NEW diff --git a/registration/include/pcl/registration/elch.h b/registration/include/pcl/registration/elch.h index 5453b0c8ca9..5e4a897512b 100644 --- a/registration/include/pcl/registration/elch.h +++ b/registration/include/pcl/registration/elch.h @@ -90,7 +90,6 @@ class ELCH : public PCLBase { , loop_start_(0) , loop_end_(0) , reg_(new pcl::IterativeClosestPoint) - , compute_loop_(true) , vd_(){}; /** \brief Empty destructor */ @@ -239,7 +238,7 @@ class ELCH : public PCLBase { /** \brief The transformation between that start and end of the loop. */ Eigen::Matrix4f loop_transform_; - bool compute_loop_; + bool compute_loop_{true}; /** \brief previously added node in the loop_graph_. */ typename boost::graph_traits::vertex_descriptor vd_; diff --git a/registration/include/pcl/registration/gicp.h b/registration/include/pcl/registration/gicp.h index b0fad8046cb..53811b29e99 100644 --- a/registration/include/pcl/registration/gicp.h +++ b/registration/include/pcl/registration/gicp.h @@ -116,14 +116,7 @@ class GeneralizedIterativeClosestPoint PCL_MAKE_ALIGNED_OPERATOR_NEW /** \brief Empty constructor. */ - GeneralizedIterativeClosestPoint() - : k_correspondences_(20) - , gicp_epsilon_(0.001) - , rotation_epsilon_(2e-3) - , mahalanobis_(0) - , max_inner_iterations_(20) - , translation_gradient_tolerance_(1e-2) - , rotation_gradient_tolerance_(1e-2) + GeneralizedIterativeClosestPoint() : mahalanobis_(0) { min_number_correspondences_ = 4; reg_name_ = "GeneralizedIterativeClosestPoint"; @@ -332,19 +325,19 @@ class GeneralizedIterativeClosestPoint /** \brief The number of neighbors used for covariances computation. * default: 20 */ - int k_correspondences_; + int k_correspondences_{20}; /** \brief The epsilon constant for gicp paper; this is NOT the convergence * tolerance * default: 0.001 */ - double gicp_epsilon_; + double gicp_epsilon_{0.001}; /** The epsilon constant for rotation error. (In GICP the transformation epsilon * is split in rotation part and translation part). * default: 2e-3 */ - double rotation_epsilon_; + double rotation_epsilon_{2e-3}; /** \brief base transformation */ Matrix4 base_transformation_; @@ -371,13 +364,13 @@ class GeneralizedIterativeClosestPoint std::vector mahalanobis_; /** \brief maximum number of optimizations */ - int max_inner_iterations_; + int max_inner_iterations_{20}; /** \brief minimal translation gradient for early optimization stop */ - double translation_gradient_tolerance_; + double translation_gradient_tolerance_{1e-2}; /** \brief minimal rotation gradient for early optimization stop */ - double rotation_gradient_tolerance_; + double rotation_gradient_tolerance_{1e-2}; /** \brief compute points covariances matrices according to the K nearest * neighbors. K is set via setCorrespondenceRandomness() method. diff --git a/registration/include/pcl/registration/ia_fpcs.h b/registration/include/pcl/registration/ia_fpcs.h index 220a58b6b20..abff434f527 100644 --- a/registration/include/pcl/registration/ia_fpcs.h +++ b/registration/include/pcl/registration/ia_fpcs.h @@ -470,10 +470,10 @@ class FPCSInitialAlignment : public Registration full cloud). */ - int nr_samples_; + int nr_samples_{0}; /** \brief Maximum normal difference of corresponding point pairs in degrees (standard * = 90). */ - float max_norm_diff_; + float max_norm_diff_{90.f}; /** \brief Maximum allowed computation time in seconds (standard = 0 => ~unlimited). */ - int max_runtime_; + int max_runtime_{0}; /** \brief Resulting fitness score of the best match. */ float fitness_score_; /** \brief Estimated diameter of the target point cloud. */ - float diameter_; + float diameter_{0.0f}; /** \brief Estimated squared metric overlap between source and target. * \note Internally calculated using the estimated overlap and the extent of the * source cloud. It is used to derive the minimum sampling distance of the base points * as well as to calculated the number of tries to reliably find a correct match. */ - float max_base_diameter_sqr_; + float max_base_diameter_sqr_{0.0f}; /** \brief Use normals flag. */ - bool use_normals_; + bool use_normals_{false}; /** \brief Normalize delta flag. */ - bool normalize_delta_; + bool normalize_delta_{true}; /** \brief A pointer to the vector of source point indices to use after sampling. */ pcl::IndicesPtr source_indices_; @@ -529,30 +529,30 @@ class FPCSInitialAlignment : public Registration) , error_functor_() { @@ -313,14 +310,14 @@ class SampleConsensusInitialAlignment : public Registration::ConstPtr& cloud std::vector dists_sqr(2); pcl::utils::ignore(nr_threads); -#pragma omp parallel for \ - default(none) \ - shared(tree, cloud) \ - firstprivate(ids, dists_sqr) \ - reduction(+:mean_dist, num) \ - firstprivate(s, max_dist_sqr) \ - num_threads(nr_threads) +#pragma omp parallel for default(none) shared(tree, cloud) \ + firstprivate(ids, dists_sqr) reduction(+ : mean_dist, num) \ + firstprivate(s, max_dist_sqr) num_threads(nr_threads) for (int i = 0; i < 1000; i++) { tree.nearestKSearch((*cloud)[rand() % s], 2, ids, dists_sqr); if (dists_sqr[1] < max_dist_sqr) { @@ -105,19 +101,11 @@ pcl::getMeanPointDensity(const typename pcl::PointCloud::ConstPtr& cloud pcl::utils::ignore(nr_threads); #if OPENMP_LEGACY_CONST_DATA_SHARING_RULE -#pragma omp parallel for \ - default(none) \ - shared(tree, cloud, indices) \ - firstprivate(ids, dists_sqr) \ - reduction(+:mean_dist, num) \ - num_threads(nr_threads) +#pragma omp parallel for default(none) shared(tree, cloud, indices) \ + firstprivate(ids, dists_sqr) reduction(+ : mean_dist, num) num_threads(nr_threads) #else -#pragma omp parallel for \ - default(none) \ - shared(tree, cloud, indices, s, max_dist_sqr) \ - firstprivate(ids, dists_sqr) \ - reduction(+:mean_dist, num) \ - num_threads(nr_threads) +#pragma omp parallel for default(none) shared(tree, cloud, indices, s, max_dist_sqr) \ + firstprivate(ids, dists_sqr) reduction(+ : mean_dist, num) num_threads(nr_threads) #endif for (int i = 0; i < 1000; i++) { tree.nearestKSearch((*cloud)[indices[rand() % s]], 2, ids, dists_sqr); @@ -136,24 +124,8 @@ pcl::registration::FPCSInitialAlignment::max()) -, nr_samples_(0) -, max_norm_diff_(90.f) -, max_runtime_(0) , fitness_score_(std::numeric_limits::max()) -, diameter_() -, max_base_diameter_sqr_() -, use_normals_(false) -, normalize_delta_(true) -, max_pair_diff_() -, max_edge_diff_() -, coincidation_limit_() -, max_mse_() -, max_inlier_dist_sqr_() -, small_error_(0.00001f) { reg_name_ = "pcl::registration::FPCSInitialAlignment"; max_iterations_ = 0; diff --git a/registration/include/pcl/registration/impl/ia_kfpcs.hpp b/registration/include/pcl/registration/impl/ia_kfpcs.hpp index 7d0973b4265..93a9bc570ee 100644 --- a/registration/include/pcl/registration/impl/ia_kfpcs.hpp +++ b/registration/include/pcl/registration/impl/ia_kfpcs.hpp @@ -46,11 +46,7 @@ namespace registration { template KFPCSInitialAlignment:: KFPCSInitialAlignment() -: lower_trl_boundary_(-1.f) -, upper_trl_boundary_(-1.f) -, lambda_(0.5f) -, use_trl_score_(false) -, indices_validation_(new pcl::Indices) +: indices_validation_(new pcl::Indices) { reg_name_ = "pcl::registration::KFPCSInitialAlignment"; } diff --git a/registration/include/pcl/registration/impl/ndt.hpp b/registration/include/pcl/registration/impl/ndt.hpp index 5b6c15313ff..e3192073d68 100644 --- a/registration/include/pcl/registration/impl/ndt.hpp +++ b/registration/include/pcl/registration/impl/ndt.hpp @@ -46,13 +46,7 @@ namespace pcl { template NormalDistributionsTransform:: NormalDistributionsTransform() -: target_cells_() -, resolution_(1.0f) -, step_size_(0.1) -, outlier_ratio_(0.55) -, gauss_d1_() -, gauss_d2_() -, trans_likelihood_() +: target_cells_(), trans_likelihood_() { reg_name_ = "NormalDistributionsTransform"; diff --git a/registration/include/pcl/registration/impl/ndt_2d.hpp b/registration/include/pcl/registration/impl/ndt_2d.hpp index 1aeb6d1bdb0..a4b5dd42241 100644 --- a/registration/include/pcl/registration/impl/ndt_2d.hpp +++ b/registration/include/pcl/registration/impl/ndt_2d.hpp @@ -99,7 +99,7 @@ class NormalDist { using PointCloud = pcl::PointCloud; public: - NormalDist() : min_n_(3), n_(0) {} + NormalDist() = default; /** \brief Store a point index to use later for estimating distribution parameters. * \param[in] i Point index to store @@ -203,9 +203,9 @@ class NormalDist { } protected: - const std::size_t min_n_; + const std::size_t min_n_{3}; - std::size_t n_; + std::size_t n_{0}; std::vector pt_indices_; Eigen::Vector2d mean_; Eigen::Matrix2d covar_inv_; diff --git a/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp b/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp index 0440178457a..ba7b4eebd0a 100644 --- a/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp +++ b/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp @@ -131,12 +131,7 @@ PyramidFeatureHistogram::comparePyramidFeatureHistograms( template PyramidFeatureHistogram::PyramidFeatureHistogram() -: nr_dimensions(0) -, nr_levels(0) -, nr_features(0) -, feature_representation_(new DefaultPointRepresentation) -, is_computed_(false) -, hist_levels() +: feature_representation_(new DefaultPointRepresentation), hist_levels() {} template diff --git a/registration/include/pcl/registration/impl/transformation_estimation_lm.hpp b/registration/include/pcl/registration/impl/transformation_estimation_lm.hpp index fe01a34a633..21ccee1f76a 100644 --- a/registration/include/pcl/registration/impl/transformation_estimation_lm.hpp +++ b/registration/include/pcl/registration/impl/transformation_estimation_lm.hpp @@ -50,8 +50,6 @@ pcl::registration::TransformationEstimationLM){}; ////////////////////////////////////////////////////////////////////////////////////////////// @@ -294,7 +292,7 @@ pcl::registration::TransformationEstimationLM; +// #define PCL_INSTANTIATE_TransformationEstimationLM(T,U) template class PCL_EXPORTS +// pcl::registration::TransformationEstimationLM; #endif /* PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_LM_HPP_ */ diff --git a/registration/include/pcl/registration/impl/transformation_estimation_point_to_plane_weighted.hpp b/registration/include/pcl/registration/impl/transformation_estimation_point_to_plane_weighted.hpp index ffa983dfd42..a31b8ec010f 100644 --- a/registration/include/pcl/registration/impl/transformation_estimation_point_to_plane_weighted.hpp +++ b/registration/include/pcl/registration/impl/transformation_estimation_point_to_plane_weighted.hpp @@ -53,10 +53,8 @@ pcl::registration::TransformationEstimationPointToPlaneWeighted< MatScalar>::TransformationEstimationPointToPlaneWeighted() : tmp_src_() , tmp_tgt_() -, tmp_idx_src_() -, tmp_idx_tgt_() , warp_point_(new WarpPointRigid6D) -, use_correspondence_weights_(true){}; +{} ////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/registration/include/pcl/registration/lum.h b/registration/include/pcl/registration/lum.h index 97d2df64408..f6354ae047b 100644 --- a/registration/include/pcl/registration/lum.h +++ b/registration/include/pcl/registration/lum.h @@ -139,7 +139,7 @@ class LUM { /** \brief Empty constructor. */ - LUM() : slam_graph_(new SLAMGraph), max_iterations_(5), convergence_threshold_(0.0) {} + LUM() : slam_graph_(new SLAMGraph) {} /** \brief Set the internal SLAM graph structure. * \details All data used and produced by LUM is stored in this boost::adjacency_list. @@ -343,10 +343,10 @@ class LUM { SLAMGraphPtr slam_graph_; /** \brief The maximum number of iterations for the compute() method. */ - int max_iterations_; + int max_iterations_{5}; /** \brief The convergence threshold for the summed vector lengths of all poses. */ - float convergence_threshold_; + float convergence_threshold_{0.0}; }; } // namespace registration } // namespace pcl diff --git a/registration/include/pcl/registration/ndt.h b/registration/include/pcl/registration/ndt.h index 81788ed687d..7fbb6403b32 100644 --- a/registration/include/pcl/registration/ndt.h +++ b/registration/include/pcl/registration/ndt.h @@ -557,18 +557,18 @@ class NormalDistributionsTransform TargetGrid target_cells_; /** \brief The side length of voxels. */ - float resolution_; + float resolution_{1.0f}; /** \brief The maximum step length. */ - double step_size_; + double step_size_{0.1}; /** \brief The ratio of outliers of points w.r.t. a normal distribution, * Equation 6.7 [Magnusson 2009]. */ - double outlier_ratio_; + double outlier_ratio_{0.55}; /** \brief The normalization constants used fit the point distribution to a * normal distribution, Equation 6.8 [Magnusson 2009]. */ - double gauss_d1_, gauss_d2_; + double gauss_d1_{0.0}, gauss_d2_{0.0}; /** \brief The likelihood score of the transform applied to the input cloud, * Equation 6.9 and 6.10 [Magnusson 2009]. */ @@ -577,7 +577,7 @@ class NormalDistributionsTransform 16, "`trans_probability_` has been renamed to `trans_likelihood_`.") double trans_probability_; - double trans_likelihood_; + double trans_likelihood_{0.0}; }; /** \brief Precomputed Angular Gradient diff --git a/registration/include/pcl/registration/ppf_registration.h b/registration/include/pcl/registration/ppf_registration.h index 0e4bacea2ec..fbb5ed39f93 100644 --- a/registration/include/pcl/registration/ppf_registration.h +++ b/registration/include/pcl/registration/ppf_registration.h @@ -92,10 +92,8 @@ class PCL_EXPORTS PPFHashMapSearch { static_cast(M_PI), float distance_discretization_step = 0.01f) : feature_hash_map_(new FeatureHashMapType) - , internals_initialized_(false) , angle_discretization_step_(angle_discretization_step) , distance_discretization_step_(distance_discretization_step) - , max_dist_(-1.0f) {} /** \brief Method that sets the feature cloud to be inserted in the hash map @@ -155,10 +153,10 @@ class PCL_EXPORTS PPFHashMapSearch { private: FeatureHashMapTypePtr feature_hash_map_; - bool internals_initialized_; + bool internals_initialized_{false}; float angle_discretization_step_, distance_discretization_step_; - float max_dist_; + float max_dist_{-1.0f}; }; /** \brief Class that registers two point clouds based on their sets of PPFSignatures. @@ -212,8 +210,6 @@ class PPFRegistration : public Registration { * default values */ PPFRegistration() : Registration() - , scene_reference_point_sampling_rate_(5) - , clustering_position_diff_threshold_(0.01f) , clustering_rotation_diff_threshold_(20.0f / 180.0f * static_cast(M_PI)) {} @@ -323,12 +319,12 @@ class PPFRegistration : public Registration { PPFHashMapSearch::Ptr search_method_; /** \brief parameter for the sampling rate of the scene reference points */ - uindex_t scene_reference_point_sampling_rate_; + uindex_t scene_reference_point_sampling_rate_{5}; /** \brief position and rotation difference thresholds below which two * poses are considered to be in the same cluster (for the clustering phase of the * algorithm) */ - float clustering_position_diff_threshold_, clustering_rotation_diff_threshold_; + float clustering_position_diff_threshold_{0.01f}, clustering_rotation_diff_threshold_; /** \brief use a kd-tree with range searches of range max_dist to skip an O(N) pass * through the point cloud */ diff --git a/registration/include/pcl/registration/pyramid_feature_matching.h b/registration/include/pcl/registration/pyramid_feature_matching.h index 8a243559d59..b16b9a9edd8 100644 --- a/registration/include/pcl/registration/pyramid_feature_matching.h +++ b/registration/include/pcl/registration/pyramid_feature_matching.h @@ -153,10 +153,10 @@ class PyramidFeatureHistogram : public PCLBase { const PyramidFeatureHistogramPtr& pyramid_b); private: - std::size_t nr_dimensions, nr_levels, nr_features; + std::size_t nr_dimensions{0}, nr_levels{0}, nr_features{0}; std::vector> dimension_range_input_, dimension_range_target_; FeatureRepresentationConstPtr feature_representation_; - bool is_computed_; + bool is_computed_{false}; /** \brief Checks for input inconsistencies and initializes the underlying data * structures */ diff --git a/registration/include/pcl/registration/registration.h b/registration/include/pcl/registration/registration.h index e702b944c3c..da80847ff7a 100644 --- a/registration/include/pcl/registration/registration.h +++ b/registration/include/pcl/registration/registration.h @@ -109,27 +109,15 @@ class Registration : public PCLBase { Registration() : tree_(new KdTree) , tree_reciprocal_(new KdTreeReciprocal) - , nr_iterations_(0) - , max_iterations_(10) - , ransac_iterations_(0) , target_() , final_transformation_(Matrix4::Identity()) , transformation_(Matrix4::Identity()) , previous_transformation_(Matrix4::Identity()) - , transformation_epsilon_(0.0) - , transformation_rotation_epsilon_(0.0) , euclidean_fitness_epsilon_(-std::numeric_limits::max()) , corr_dist_threshold_(std::sqrt(std::numeric_limits::max())) - , inlier_threshold_(0.05) - , converged_(false) - , min_number_correspondences_(3) , correspondences_(new Correspondences) , transformation_estimation_() , correspondence_estimation_() - , target_cloud_updated_(true) - , source_cloud_updated_(true) - , force_no_recompute_(false) - , force_no_recompute_reciprocal_(false) , point_representation_() {} @@ -567,15 +555,15 @@ class Registration : public PCLBase { /** \brief The number of iterations the internal optimization ran for (used * internally). */ - int nr_iterations_; + int nr_iterations_{0}; /** \brief The maximum number of iterations the internal optimization should run for. * The default value is 10. */ - int max_iterations_; + int max_iterations_{10}; /** \brief The number of iterations RANSAC should run for. */ - int ransac_iterations_; + int ransac_iterations_{0}; /** \brief The input point cloud dataset target. */ PointCloudTargetConstPtr target_; @@ -594,12 +582,12 @@ class Registration : public PCLBase { /** \brief The maximum difference between two consecutive transformations in order to * consider convergence (user defined). */ - double transformation_epsilon_; + double transformation_epsilon_{0.0}; /** \brief The maximum rotation difference between two consecutive transformations in * order to consider convergence (user defined). */ - double transformation_rotation_epsilon_; + double transformation_rotation_epsilon_{0.0}; /** \brief The maximum allowed Euclidean error between two consecutive steps in the * ICP loop, before the algorithm is considered to have converged. The error is @@ -619,15 +607,15 @@ class Registration : public PCLBase { * target data index and the transformed source index is smaller than the given inlier * distance threshold. The default value is 0.05. */ - double inlier_threshold_; + double inlier_threshold_{0.05}; /** \brief Holds internal convergence state, given user parameters. */ - bool converged_; + bool converged_{false}; /** \brief The minimum number of correspondences that the algorithm needs before * attempting to estimate the transformation. The default value is 3. */ - unsigned int min_number_correspondences_; + unsigned int min_number_correspondences_{3}; /** \brief The set of correspondences determined at this ICP step. */ CorrespondencesPtr correspondences_; @@ -646,18 +634,18 @@ class Registration : public PCLBase { /** \brief Variable that stores whether we have a new target cloud, meaning we need to * pre-process it again. This way, we avoid rebuilding the kd-tree for the target * cloud every time the determineCorrespondences () method is called. */ - bool target_cloud_updated_; + bool target_cloud_updated_{true}; /** \brief Variable that stores whether we have a new source cloud, meaning we need to * pre-process it again. This way, we avoid rebuilding the reciprocal kd-tree for the * source cloud every time the determineCorrespondences () method is called. */ - bool source_cloud_updated_; + bool source_cloud_updated_{true}; /** \brief A flag which, if set, means the tree operating on the target cloud * will never be recomputed*/ - bool force_no_recompute_; + bool force_no_recompute_{false}; /** \brief A flag which, if set, means the tree operating on the source cloud * will never be recomputed*/ - bool force_no_recompute_reciprocal_; + bool force_no_recompute_reciprocal_{false}; /** \brief Callback function to update intermediate source point cloud position during * it's registration to the target point cloud. diff --git a/registration/include/pcl/registration/sample_consensus_prerejective.h b/registration/include/pcl/registration/sample_consensus_prerejective.h index f2b4e8cac6e..3d67b293092 100644 --- a/registration/include/pcl/registration/sample_consensus_prerejective.h +++ b/registration/include/pcl/registration/sample_consensus_prerejective.h @@ -121,11 +121,8 @@ class SampleConsensusPrerejective : public Registration) , correspondence_rejector_poly_(new CorrespondenceRejectorPoly) - , inlier_fraction_(0.0f) { reg_name_ = "SampleConsensusPrerejective"; correspondence_rejector_poly_->setSimilarityThreshold(0.6f); @@ -305,11 +302,11 @@ class SampleConsensusPrerejective : public Registration::Ptr diff --git a/registration/include/pcl/registration/transformation_estimation_point_to_plane_weighted.h b/registration/include/pcl/registration/transformation_estimation_point_to_plane_weighted.h index 8d42452bdbb..6b4453f63b3 100644 --- a/registration/include/pcl/registration/transformation_estimation_point_to_plane_weighted.h +++ b/registration/include/pcl/registration/transformation_estimation_point_to_plane_weighted.h @@ -198,20 +198,20 @@ class TransformationEstimationPointToPlaneWeighted } protected: - bool use_correspondence_weights_; - mutable std::vector correspondence_weights_; + bool use_correspondence_weights_{true}; + mutable std::vector correspondence_weights_{}; /** \brief Temporary pointer to the source dataset. */ - mutable const PointCloudSource* tmp_src_; + mutable const PointCloudSource* tmp_src_{nullptr}; /** \brief Temporary pointer to the target dataset. */ - mutable const PointCloudTarget* tmp_tgt_; + mutable const PointCloudTarget* tmp_tgt_{nullptr}; /** \brief Temporary pointer to the source dataset indices. */ - mutable const pcl::Indices* tmp_idx_src_; + mutable const pcl::Indices* tmp_idx_src_{nullptr}; /** \brief Temporary pointer to the target dataset indices. */ - mutable const pcl::Indices* tmp_idx_tgt_; + mutable const pcl::Indices* tmp_idx_tgt_{nullptr}; /** \brief The parameterized function used to warp the source to the target. */ typename pcl::registration::WarpPointRigid::Ptr diff --git a/registration/include/pcl/registration/transformation_estimation_symmetric_point_to_plane_lls.h b/registration/include/pcl/registration/transformation_estimation_symmetric_point_to_plane_lls.h index 057fa2bb26f..bb22c94aadd 100644 --- a/registration/include/pcl/registration/transformation_estimation_symmetric_point_to_plane_lls.h +++ b/registration/include/pcl/registration/transformation_estimation_symmetric_point_to_plane_lls.h @@ -71,8 +71,7 @@ class TransformationEstimationSymmetricPointToPlaneLLS typename TransformationEstimation::Matrix4; using Vector6 = Eigen::Matrix; - TransformationEstimationSymmetricPointToPlaneLLS() - : enforce_same_direction_normals_(true){}; + TransformationEstimationSymmetricPointToPlaneLLS() = default; ~TransformationEstimationSymmetricPointToPlaneLLS() override = default; /** \brief Estimate a rigid rotation transformation between a source and a target @@ -161,7 +160,7 @@ class TransformationEstimationSymmetricPointToPlaneLLS /** \brief Whether or not to negate source and/or target normals such that they point * in the same direction */ - bool enforce_same_direction_normals_; + bool enforce_same_direction_normals_{true}; }; } // namespace registration } // namespace pcl diff --git a/registration/include/pcl/registration/transformation_validation_euclidean.h b/registration/include/pcl/registration/transformation_validation_euclidean.h index b22ed68adaf..83ffeb2657c 100644 --- a/registration/include/pcl/registration/transformation_validation_euclidean.h +++ b/registration/include/pcl/registration/transformation_validation_euclidean.h @@ -101,7 +101,6 @@ class TransformationValidationEuclidean { : max_range_(std::numeric_limits::max()) , threshold_(std::numeric_limits::quiet_NaN()) , tree_(new pcl::search::KdTree) - , force_no_recompute_(false) {} virtual ~TransformationValidationEuclidean() = default; @@ -229,7 +228,7 @@ class TransformationValidationEuclidean { /** \brief A flag which, if set, means the tree operating on the target cloud * will never be recomputed*/ - bool force_no_recompute_; + bool force_no_recompute_{false}; /** \brief Internal point representation uses only 3D coordinates for L2 */ class MyPointRepresentation : public pcl::PointRepresentation { diff --git a/search/include/pcl/search/flann_search.h b/search/include/pcl/search/flann_search.h index 8d994895c59..f093a572809 100644 --- a/search/include/pcl/search/flann_search.h +++ b/search/include/pcl/search/flann_search.h @@ -348,22 +348,22 @@ namespace pcl /** Epsilon for approximate NN search. */ - float eps_; + float eps_{0.0f}; /** Number of checks to perform for approximate NN search using the multiple randomized tree index */ - int checks_; + int checks_{32}; - bool input_copied_for_flann_; + bool input_copied_for_flann_{false}; - PointRepresentationConstPtr point_representation_; + PointRepresentationConstPtr point_representation_{nullptr}; - int dim_; + int dim_{0}; Indices index_mapping_; - bool identity_mapping_; + bool identity_mapping_{false}; - std::size_t total_nr_points_; + std::size_t total_nr_points_{0}; }; } diff --git a/search/include/pcl/search/impl/flann_search.hpp b/search/include/pcl/search/impl/flann_search.hpp index 218fd690998..2026db79e9b 100644 --- a/search/include/pcl/search/impl/flann_search.hpp +++ b/search/include/pcl/search/impl/flann_search.hpp @@ -76,8 +76,7 @@ pcl::search::FlannSearch::KdTreeMultiIndexCreator::create ////////////////////////////////////////////////////////////////////////////////////////////// template pcl::search::FlannSearch::FlannSearch(bool sorted, FlannIndexCreatorPtr creator) : pcl::search::Search ("FlannSearch",sorted), - index_(), creator_ (creator), eps_ (0), checks_ (32), input_copied_for_flann_ (false), point_representation_ (new DefaultPointRepresentation), - dim_ (0), identity_mapping_() + index_(), creator_ (creator), point_representation_ (new DefaultPointRepresentation) { dim_ = point_representation_->getNumberOfDimensions (); } diff --git a/simulation/include/pcl/simulation/range_likelihood.h b/simulation/include/pcl/simulation/range_likelihood.h index aab4bbb4249..0bd2b8a851b 100644 --- a/simulation/include/pcl/simulation/range_likelihood.h +++ b/simulation/include/pcl/simulation/range_likelihood.h @@ -276,31 +276,31 @@ class PCL_EXPORTS RangeLikelihood { float z_far_; // For caching only, not part of observable state. - mutable bool depth_buffer_dirty_; - mutable bool color_buffer_dirty_; - mutable bool score_buffer_dirty_; + mutable bool depth_buffer_dirty_{true}; + mutable bool color_buffer_dirty_{true}; + mutable bool score_buffer_dirty_{true}; int which_cost_function_; double floor_proportion_; double sigma_; - GLuint fbo_; + GLuint fbo_{0}; GLuint score_fbo_; - GLuint depth_render_buffer_; - GLuint color_render_buffer_; + GLuint depth_render_buffer_{0}; + GLuint color_render_buffer_{0}; GLuint color_texture_; - GLuint depth_texture_; - GLuint score_texture_; - GLuint score_summarized_texture_; - GLuint sensor_texture_; - GLuint likelihood_texture_; - - bool compute_likelihood_on_cpu_; - bool aggregate_on_cpu_; - bool use_instancing_; + GLuint depth_texture_{0}; + GLuint score_texture_{0}; + GLuint score_summarized_texture_{0}; + GLuint sensor_texture_{0}; + GLuint likelihood_texture_{0}; + + bool compute_likelihood_on_cpu_{false}; + bool aggregate_on_cpu_{false}; + bool use_instancing_{false}; bool generate_color_image_; - bool use_color_; + bool use_color_{true}; gllib::Program::Ptr likelihood_program_; GLuint quad_vbo_; diff --git a/simulation/src/range_likelihood.cpp b/simulation/src/range_likelihood.cpp index f09315593dc..34961f9f58d 100644 --- a/simulation/src/range_likelihood.cpp +++ b/simulation/src/range_likelihood.cpp @@ -279,21 +279,6 @@ pcl::simulation::RangeLikelihood::RangeLikelihood( , cols_(cols) , row_height_(row_height) , col_width_(col_width) -, depth_buffer_dirty_(true) -, color_buffer_dirty_(true) -, score_buffer_dirty_(true) -, fbo_(0) -, depth_render_buffer_(0) -, color_render_buffer_(0) -, depth_texture_(0) -, score_texture_(0) -, score_summarized_texture_(0) -, sensor_texture_(0) -, likelihood_texture_(0) -, compute_likelihood_on_cpu_(false) -, aggregate_on_cpu_(false) -, use_instancing_(false) -, use_color_(true) , sum_reduce_(cols * col_width, rows * row_height, max_level(col_width, row_height)) { height_ = rows_ * row_height; diff --git a/test/common/test_transforms.cpp b/test/common/test_transforms.cpp index 36f4a62deed..cfac20d6700 100644 --- a/test/common/test_transforms.cpp +++ b/test/common/test_transforms.cpp @@ -61,10 +61,7 @@ class Transforms : public ::testing::Test { public: using Scalar = typename Transform::Scalar; - Transforms () - : ABS_ERROR (std::numeric_limits::epsilon () * 10) - , CLOUD_SIZE (100) { Eigen::Matrix r = Eigen::Matrix::Random (); Eigen::Transform transform; @@ -93,9 +90,8 @@ class Transforms : public ::testing::Test indices[i] = i * 2; } - const Scalar ABS_ERROR; - const std::size_t CLOUD_SIZE; - + const Scalar ABS_ERROR{std::numeric_limits::epsilon () * 10}; + const std::size_t CLOUD_SIZE{100}; Transform tf; // Random point clouds and their expected transformed versions diff --git a/test/octree/test_octree_iterator.cpp b/test/octree/test_octree_iterator.cpp index 07332be6ab1..a7fbb988cdb 100644 --- a/test/octree/test_octree_iterator.cpp +++ b/test/octree/test_octree_iterator.cpp @@ -1467,7 +1467,6 @@ struct OctreePointCloudSierpinskiTest // Methods OctreePointCloudSierpinskiTest () : oct_ (1) - , depth_ (7) {} void SetUp () override @@ -1597,7 +1596,7 @@ struct OctreePointCloudSierpinskiTest // Members OctreeT oct_; - const unsigned depth_; + const unsigned depth_{7}; }; /** \brief Octree test based on a Sierpinski fractal diff --git a/test/outofcore/test_outofcore.cpp b/test/outofcore/test_outofcore.cpp index fe70dfa7e8c..cb5cfff4aca 100644 --- a/test/outofcore/test_outofcore.cpp +++ b/test/outofcore/test_outofcore.cpp @@ -394,7 +394,7 @@ class OutofcoreTest : public testing::Test { protected: - OutofcoreTest () : smallest_voxel_dim () {} + OutofcoreTest () = default; void SetUp () override { @@ -420,7 +420,7 @@ class OutofcoreTest : public testing::Test } - double smallest_voxel_dim; + double smallest_voxel_dim{3.0f}; };