1

I am trying to get surface normal from my kinect2 data using PCL in ROS. I am having trouble in visualizing normal data.

I am using Following Viewer to view real time point cloud.

I have added point normal code of PCL to this code to calculate and visualize normal.

I am getting following runtime error:

ERROR: In /home/chandan_main/Downloads/VTK-7.1.0/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx, line 1794
vtkOpenGLPolyDataMapper (0xa1ea5e0): failed after UpdateShader 1 OpenGL errors detected
  0 : (1281) Invalid value


[pcl::IntegralImageNormalEstimation::setInputCloud] Input dataset is not organized (height = 1).
[pcl::IntegralImageNormalEstimation::initCompute] Input dataset is not organized (height = 1).
[addPointCloudNormals] The number of points differs from the number of normals!
[pcl::IntegralImageNormalEstimation::setInputCloud] Input dataset is not organized (height = 1).
[pcl::IntegralImageNormalEstimation::initCompute] Input dataset is not organized (height = 1).
[addPointCloudNormals] The number of points differs from the number of normals!
[pcl::IntegralImageNormalEstimation::setInputCloud] Input dataset is not organized (height = 1).
[pcl::IntegralImageNormalEstimation::initCompute] Input dataset is not organized (height = 1).
[addPointCloudNormals] The number of points differs from the number of normals! 
Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
  • Could you post the actual code you've included into your viewer? It seems like you didn't properly set your input cloud; or that Kinect2 data are not organized (in which case you can't use the normal estimation with integral images but use the "regular" method of normal estimation in PCL). – calocedrus Aug 20 '18 at 08:34
  • I am able to get the normal now...I have just used while(!viewer->wasStopped()) { viewer->spinOnce (100); boost::this_thread::sleep (boost::posix_time::microseconds (100000)); } becuse I was trying to get normal in real time...It was showing errors...I also rebuilt VTK library which had issues – Chandan Lal Aug 21 '18 at 08:25

1 Answers1

0

I am able to get the normal now.I have just used

while(!viewer->wasStopped()) { viewer->spinOnce (100); boost::this_thread::sleep(boost::posix_time::microseconds (100000)); }

becuse I was trying to get normal in real time.It was showing errors.I also rebuilt VTK library which had issues.