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
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 }
kfusion::cuda::setDevice
KF_EXPORTS void setDevice(int device)
kfusion::cuda::checkIfPreFermiGPU
KF_EXPORTS bool checkIfPreFermiGPU(int device)
KinFuApp
Definition: KinFuApp.hpp:16
kfusion::OpenNISource
Definition: capture.hpp:10
kfusion::OpenNISource::triggerPause
void triggerPause()
Definition: capture.cpp:164
main
int main(int argc, char *argv[])
Definition: LVR_KinFu.cpp:9
options
const kaboom::Options * options
Definition: src/tools/lvr2_kaboom/Main.cpp:45
Options.hpp
KinFuApp::execute
bool execute()
Definition: KinFuApp.hpp:314
kfusion::cuda::printShortCudaDeviceInfo
KF_EXPORTS void printShortCudaDeviceInfo(int device)
argc
int argc
Definition: tests_high_five_parallel.cpp:27
KinFuApp.hpp
kfusion::Options
A class to parse the program options for the reconstruction executable.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:51
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
kfusion::OpenNISource::open
void open(int device)
Definition: capture.cpp:45


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 Wed Mar 2 2022 00:37:24