Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExamplePMD.cpp
1 #include <pmdsdk2.h>
2 #include <VideoSource/VideoSource_PMD.hh>
3 
4 int
5 main(int argc, char** argv)
6 {
7  /* The handle is used to identify a connection */
8  //PMDHandle hnd1;
9  PMDHandle hnd2;
10  /* Result code for PMDSDK2 calls */
11  int res;
12 
13 
14  res = pmdOpen(&hnd2, BIAS_PMD_PMDTec_SOURCEPLUGIN, "",
15  BIAS_PMD_PMDTec_PROCPLUGIN, "");
16 
17  /* Check if the call succeeded */
18  if (res != PMD_OK)
19  {
20  std::cout << "result 2 = " << res << std::endl;
21  char err[256];
22  /* The handle parameter in pmdGetLastError is 0
23  because no connection was established */
24  pmdGetLastError(0, err, 256);
25  fprintf(stderr, "Could not connect: %s\n", err);
26  /* Close the connection */
27  pmdClose(hnd2);
28  return 1;
29  } else {
30  std::cout << "OK" << std::endl;
31  }
32 
33 
34 
35 
36  pmdClose(hnd2);
37 
38  return 0;
39 }