LVR_KinFu.cpp
Go to the documentation of this file.
1 #include <boost/program_options.hpp>
2 // Program options for this tool
3 #include <kfusion/Options.hpp>
4 #include "KinFuApp.hpp"
5 
6 namespace po = boost::program_options;
8 
9 int main (int argc, char* argv[])
10 {
11 
13  try
14  {
15  // Parse command line arguments
16  options = new kfusion::Options(argc, argv);
17 
18  // Exit if options had to generate a usage message
19  // (this means required parameters are missing)
20  if ( options->printUsage() )
21  {
22  return 0;
23  }
24 
25  ::std::cout << *options << ::std::endl;
26  }
27  catch(exception& e)
28  {
29  cout << e.what() << endl;
30  return 0;
31  }
32 
33  OpenNISource capture;
34  string device = options->getInputDevice();
35  if(device.find_first_not_of("0123456789") == std::string::npos)
36  {
37  cuda::setDevice (atoi(device.c_str()));
38  cuda::printShortCudaDeviceInfo (atoi(device.c_str()));
39 
40  if(cuda::checkIfPreFermiGPU(atoi(device.c_str())))
41  return std::cout << std::endl << "Kinfu is not supported for pre-Fermi GPU architectures, and not built for them by default. Exiting..." << std::endl, 1;
42  capture.open(atoi(device.c_str()));
43  }
44  else
45  {
46  capture.open(device);
47  capture.triggerPause();
48  }
49 
50  KinFuApp app (capture, options);
51 
52  // executing
53  try { app.execute (); }
54  catch (const std::bad_alloc& /*e*/) { std::cout << "Bad alloc" << std::endl; }
55  catch (const std::exception& /*e*/) { std::cout << "Exception" << std::endl; }
56 
57  return 0;
58 }
int main(int argc, char *argv[])
Definition: LVR_KinFu.cpp:9
const kaboom::Options * options
bool execute()
Definition: KinFuApp.hpp:314
A class to parse the program options for the reconstruction executable.
KF_EXPORTS bool checkIfPreFermiGPU(int device)
string getInputDevice() const
Returns the output file name.
KF_EXPORTS void printShortCudaDeviceInfo(int device)
bool printUsage() const
Prints a usage message to stdout.
void open(int device)
Definition: capture.cpp:45
char ** argv
KF_EXPORTS void setDevice(int device)


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08