Problem zooming in pcd viewer

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Problem zooming in pcd viewer

This post has NOT been accepted by the mailing list yet.
I am new to pcl. I wrote a code to show xyz coordinates of point clicked by mouse on pcd viewer using online resources however I am unable to zoom in the pcd viewer window after a certain extent. It is giving the xyz coordinates but due to zooming in problem i am unable to identify the objects I need the coordinates of. The code is given below

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/visualization/point_picking_event.h>

pp_callback(const pcl::visualization::PointPickingEvent& event, void* viewer_void)
   std::cout << "Picking event active" << std::endl;
         float x,y,z;
         std::cout << x<< ";" << y<<";" << z << std::endl;
main (int argc, char** argv)
  pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);

  if (pcl::io::loadPCDFile<pcl::PointXYZ> ("Lab_View.pcd", *cloud) == -1) //* load the file
    PCL_ERROR ("Couldn't read file test_pcd.pcd \n");
    return (-1);
  std::cout << "Loaded "
            << cloud->width * cloud->height
            << std::endl;

  boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer (new pcl::visualization::PCLVisualizer ("3D Viewer"));
  pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZ> single_color(cloud, 0, 255, 0);
  viewer->addPointCloud<pcl::PointXYZ> (cloud, single_color, "sample cloud");
  viewer->registerPointPickingCallback (pp_callback,(void*)&viewer);
  while (!viewer->wasStopped ())
     viewer->spinOnce (100);
     boost::this_thread::sleep (boost::posix_time::microseconds (100000));