コード例 #1
0
/** @brief Main function
 * @param argc
 * @param argv
 * @return Exit status */
int
main (int argc,
      char *argv[])
{
  if (argc != 2)
  {
    PCL_ERROR ("Usage:\n%s 192.168.100.65\n", argv[0]);
    return (-1);
  }

  davidsdk_ptr.reset (new pcl::DavidSDKGrabber);
  davidsdk_ptr->connect (argv[1]);

  if (!davidsdk_ptr->isConnected ())
    return (-1);
  PCL_WARN ("davidSDK connected\n");

  boost::function<void
  (const boost::shared_ptr<pcl::PCLImage> &)> f = boost::bind (&grabberCallback, _1);
  davidsdk_ptr->registerCallback (f);
  davidsdk_ptr->start ();
  waitForUser ("Press enter to quit");

  return (0);
}
コード例 #2
0
ファイル: davidsdk_viewer.cpp プロジェクト: Siincy/pcl
/** @brief Main function
 * @param[in] argc
 * @param[in] argv
 * @return Exit status */
int
main (int argc,
      char *argv[])
{
    if (argc != 2)
    {
        PCL_ERROR ("Usage:\n%s 192.168.100.65\n", argv[0]);
        return (-1);
    }

    viewer_ptr.reset (new CloudViewer ("davidSDK 3D cloud viewer"));
    davidsdk_ptr.reset (new pcl::DavidSDKGrabber);
    davidsdk_ptr->connect (argv[1]);

    if (!davidsdk_ptr->isConnected ())
        return (-1);
    PCL_WARN ("davidSDK connected\n");

#ifndef _WIN32// || _WIN64
    PCL_WARN ("Linux / Mac OSX detected, setting local_path_ to /var/tmp/davidsdk/ and remote_path_ to \\\\m6700\\davidsdk\\\n");
    davidsdk_ptr->setLocalAndRemotePaths ("/var/tmp/davidsdk/", "\\\\m6700\\davidsdk\\");
#endif

    //davidsdk_ptr->setFileFormatToPLY();
    std::cout << "Using " << davidsdk_ptr->getFileFormat () << " file format" << std::endl;

    boost::function<void
    (const PointCloudXYZ::Ptr&)> f = boost::bind (&grabberCallback, _1);
    davidsdk_ptr->registerCallback (f);
    davidsdk_ptr->start ();

    while (!viewer_ptr->wasStopped ())
    {
        boost::this_thread::sleep (boost::posix_time::seconds (20));
        std::cout << "FPS: " << davidsdk_ptr->getFramesPerSecond () << std::endl;
    }

    davidsdk_ptr->stop ();
    return (0);
}