Skip to content

Commit

Permalink
[sample_consensus] Changed segmentation collinear check precision fro…
Browse files Browse the repository at this point in the history
…m float to double. (#6175)

* Changed segmentation collinear check precision from float to double.

* Reverted change for cone, ellipse3d, plane and torus.
  • Loading branch information
ralphieraccoon authored Nov 22, 2024
1 parent 0932486 commit 75ef8c5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pcl::SampleConsensusModelCircle3D<PointT>::isSampleGood (
// Check if the squared norm of the cross-product is non-zero, otherwise
// common_helper_vec, which plays an important role in computeModelCoefficients,
// would likely be ill-formed.
if ((p1 - p0).cross(p1 - p2).squaredNorm() < Eigen::NumTraits<float>::dummy_precision ())
if ((p1 - p0).cross(p1 - p2).squaredNorm() < Eigen::NumTraits<double>::dummy_precision ())
{
PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::isSampleGood] Sample points too similar or collinear!\n");
return (false);
Expand Down Expand Up @@ -102,7 +102,7 @@ pcl::SampleConsensusModelCircle3D<PointT>::computeModelCoefficients (const Indic

// The same check is implemented in isSampleGood, so be sure to look there too
// if you find the need to change something here.
if (common_helper_vec.squaredNorm() < Eigen::NumTraits<float>::dummy_precision ())
if (common_helper_vec.squaredNorm() < Eigen::NumTraits<double>::dummy_precision ())
{
PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::computeModelCoefficients] Sample points too similar or collinear!\n");
return (false);
Expand Down

0 comments on commit 75ef8c5

Please sign in to comment.