Navigation Menu

Skip to content

Commit

Permalink
Fixed sac_model_plane to make sure a valid plane is optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
sdmiller committed Jul 11, 2013
1 parent 77f87e9 commit 02ca563
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -248,6 +248,12 @@ pcl::SampleConsensusModelPlane<PointT>::optimizeModelCoefficients (
optimized_coefficients[2] = eigen_vector [2];
optimized_coefficients[3] = 0;
optimized_coefficients[3] = -1 * optimized_coefficients.dot (xyz_centroid);

// Make sure it results in a valid model
if (!isModelValid (optimized_coefficients))
{
optimized_coefficients = model_coefficients;
}
}

//////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 02ca563

Please sign in to comment.