MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / main

Function main

tools/davidsdk_viewer.cpp:70–108  ·  view source on GitHub ↗

@brief Main function * @param[in] argc * @param[in] argv * @return Exit status */

Source from the content-addressed store, hash-verified

68 * @param[in] argv
69 * @return Exit status */
70int
71main (int argc,
72 char *argv[])
73{
74 if (argc != 2)
75 {
76 PCL_ERROR ("Usage:\n%s 192.168.100.65\n", argv[0]);
77 return (-1);
78 }
79
80 viewer_ptr.reset (new CloudViewer ("davidSDK 3D cloud viewer"));
81 davidsdk_ptr.reset (new pcl::DavidSDKGrabber);
82 davidsdk_ptr->connect (argv[1]);
83
84 if (!davidsdk_ptr->isConnected ())
85 return (-1);
86 PCL_WARN ("davidSDK connected\n");
87
88#ifndef _WIN32// || _WIN64
89 PCL_WARN ("Linux / Mac OSX detected, setting local_path_ to /var/tmp/davidsdk/ and remote_path_ to \\\\m6700\\davidsdk\\\n");
90 davidsdk_ptr->setLocalAndRemotePaths ("/var/tmp/davidsdk/", "\\\\m6700\\davidsdk\\");
91#endif
92
93 //davidsdk_ptr->setFileFormatToPLY();
94 std::cout << "Using " << davidsdk_ptr->getFileFormat () << " file format" << std::endl;
95
96 std::function<void (const PointCloudXYZ::Ptr&)> f = [] (const PointCloudXYZ::Ptr& cloud) { grabberCallback (cloud); };
97 davidsdk_ptr->registerCallback (f);
98 davidsdk_ptr->start ();
99
100 while (!viewer_ptr->wasStopped ())
101 {
102 std::this_thread::sleep_for(20s);
103 std::cout << "FPS: " << davidsdk_ptr->getFramesPerSecond () << std::endl;
104 }
105
106 davidsdk_ptr->stop ();
107 return (0);
108}
109

Callers

nothing calls this directly

Calls 11

isConnectedMethod · 0.80
getFileFormatMethod · 0.80
grabberCallbackFunction · 0.70
resetMethod · 0.45
connectMethod · 0.45
registerCallbackMethod · 0.45
startMethod · 0.45
wasStoppedMethod · 0.45
getFramesPerSecondMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected