PCL not updating
I am able to view my lidar pointcloud using this script but not update it. viewer-> spin() does not seem to be work. Any help will be appreciated.
void callback(const ImageConstPtr& image1, const boost::shared_ptr<const sensor_msgs::PointCloud2>& input)
pcl::PCLPointCloud2 pcl_pc2;
pcl_conversions::toPCL(*input,pcl_pc2);
pcl::PointCloud<pcl::PointXYZ>::Ptr temp_cloud(new pcl::PointCloud<pcl::PointXYZ>);
pcl::fromPCLPointCloud2(pcl_pc2,*temp_cloud);
pcl::visualization::CloudViewer viewer ("Simple Cloud Viewer");
viewer.showCloud(temp_cloud);
while (!viewer.wasStopped ())
{
{