diff --git a/sample_consensus/include/pcl/sample_consensus/sac_model_stick.h b/sample_consensus/include/pcl/sample_consensus/sac_model_stick.h index 14805c67e94..3d8babdff42 100644 --- a/sample_consensus/include/pcl/sample_consensus/sac_model_stick.h +++ b/sample_consensus/include/pcl/sample_consensus/sac_model_stick.h @@ -56,11 +56,16 @@ namespace pcl * - \b line_direction.z : the Z coordinate of a line's direction * - \b line_width : the width of the line * + * \warning This model is considered deprecated. The coefficients are used inconsistently in the methods, and the last coefficient (line width) is unused. We recommend to use the line or cylinder model instead. * \author Radu B. Rusu * \ingroup sample_consensus */ template +#ifdef SAC_MODEL_STICK_DONT_WARN_DEPRECATED class SampleConsensusModelStick : public SampleConsensusModel +#else + class PCL_DEPRECATED(1, 17, "Use line or cylinder model instead") SampleConsensusModelStick : public SampleConsensusModel +#endif { public: using SampleConsensusModel::model_name_; diff --git a/sample_consensus/src/sac_model_stick.cpp b/sample_consensus/src/sac_model_stick.cpp index 0b00fba0ddd..db48a7f0ea4 100644 --- a/sample_consensus/src/sac_model_stick.cpp +++ b/sample_consensus/src/sac_model_stick.cpp @@ -37,6 +37,7 @@ */ #include +#define SAC_MODEL_STICK_DONT_WARN_DEPRECATED #include #ifndef PCL_NO_PRECOMPILE diff --git a/segmentation/include/pcl/segmentation/impl/sac_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/sac_segmentation.hpp index 11686ae1dce..e701b5ef752 100644 --- a/segmentation/include/pcl/segmentation/impl/sac_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/sac_segmentation.hpp @@ -68,7 +68,9 @@ #include #include #include +#define SAC_MODEL_STICK_DONT_WARN_DEPRECATED #include +#undef SAC_MODEL_STICK_DONT_WARN_DEPRECATED #include #include // for static_pointer_cast @@ -155,6 +157,7 @@ pcl::SACSegmentation::initSACModel (const int model_type) } case SACMODEL_STICK: { + PCL_WARN ("[pcl::%s::initSACModel] SACMODEL_STICK is deprecated: Use SACMODEL_LINE instead (It will be removed in PCL 1.17)\n", getClassName ().c_str ()); PCL_DEBUG ("[pcl::%s::initSACModel] Using a model of type: SACMODEL_STICK\n", getClassName ().c_str ()); model_.reset (new SampleConsensusModelStick (input_, *indices_)); double min_radius, max_radius;