Skip to content

Commit f2492bd

Browse files
authored
Merge pull request #5796 from mvieth/deprecate_stick_model
Deprecate SampleConsensusModelStick
2 parents 11a6627 + 6ae8c88 commit f2492bd

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

sample_consensus/include/pcl/sample_consensus/sac_model_stick.h

+5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,16 @@ namespace pcl
5656
* - \b line_direction.z : the Z coordinate of a line's direction
5757
* - \b line_width : the width of the line
5858
*
59+
* \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.
5960
* \author Radu B. Rusu
6061
* \ingroup sample_consensus
6162
*/
6263
template <typename PointT>
64+
#ifdef SAC_MODEL_STICK_DONT_WARN_DEPRECATED
6365
class SampleConsensusModelStick : public SampleConsensusModel<PointT>
66+
#else
67+
class PCL_DEPRECATED(1, 17, "Use line or cylinder model instead") SampleConsensusModelStick : public SampleConsensusModel<PointT>
68+
#endif
6469
{
6570
public:
6671
using SampleConsensusModel<PointT>::model_name_;

sample_consensus/src/sac_model_stick.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
*/
3838

3939
#include <pcl/pcl_config.h>
40+
#define SAC_MODEL_STICK_DONT_WARN_DEPRECATED
4041
#include <pcl/sample_consensus/impl/sac_model_stick.hpp>
4142

4243
#ifndef PCL_NO_PRECOMPILE

segmentation/include/pcl/segmentation/impl/sac_segmentation.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868
#include <pcl/sample_consensus/sac_model_plane.h>
6969
#include <pcl/sample_consensus/sac_model_sphere.h>
7070
#include <pcl/sample_consensus/sac_model_normal_sphere.h>
71+
#define SAC_MODEL_STICK_DONT_WARN_DEPRECATED
7172
#include <pcl/sample_consensus/sac_model_stick.h>
73+
#undef SAC_MODEL_STICK_DONT_WARN_DEPRECATED
7274
#include <pcl/sample_consensus/sac_model_ellipse3d.h>
7375

7476
#include <pcl/memory.h> // for static_pointer_cast
@@ -155,6 +157,7 @@ pcl::SACSegmentation<PointT>::initSACModel (const int model_type)
155157
}
156158
case SACMODEL_STICK:
157159
{
160+
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 ());
158161
PCL_DEBUG ("[pcl::%s::initSACModel] Using a model of type: SACMODEL_STICK\n", getClassName ().c_str ());
159162
model_.reset (new SampleConsensusModelStick<PointT> (input_, *indices_));
160163
double min_radius, max_radius;

0 commit comments

Comments
 (0)