Skip to content

Commit

Permalink
Merge pull request #2265 from taketwo/visualizer-normal-check
Browse files Browse the repository at this point in the history
Warn and skip adding normal cloud if it is empty
  • Loading branch information
SergioRAgostinho authored Mar 27, 2018
2 parents a9ea343 + fe2af49 commit 3abf9a9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,13 @@ pcl::visualization::PCLVisualizer::addPointCloudNormals (
PCL_ERROR ("[addPointCloudNormals] The number of points differs from the number of normals!\n");
return (false);
}

if (normals->empty ())
{
PCL_WARN ("[addPointCloudNormals] An empty normal cloud is given! Nothing to display.\n");
return (false);
}

if (contains (id))
{
PCL_WARN ("[addPointCloudNormals] The id <%s> already exists! Please choose a different id and retry.\n", id.c_str ());
Expand Down

0 comments on commit 3abf9a9

Please sign in to comment.