-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnite_b.cpp
More file actions
45 lines (34 loc) · 857 Bytes
/
nite_b.cpp
File metadata and controls
45 lines (34 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Alexandre Coninx
// Imperial College London, 20/05/2014
#include "nite_b.hpp"
#include <iostream>
bool NiTE_b::initialized = false;
bool NiTE_b::initialize()
{
nite::Status niteRc;
if(initialized)
{
std::cerr << "System already initialized" << std::endl;
return false;
}
/* OK, it is documented nowhere but it looks like NiTE2 sometimes
throw exceptions when failing to init -_- */
try
{
niteRc = nite::NiTE::initialize();
if(niteRc != nite::STATUS_OK)
{
std::cerr << "Couldn't initialize NiTE" << std::endl;
return false;
}
initialized = true;
return true;
} catch (std::exception& e) {
std::cout << "The freenect/OpenNI2/NiTE2 stack somehow refused to initialize and threw me an exception. Here it is : " << e.what() << std::endl;
return false;
}
}
void NiTE_b::shutdown()
{
nite::NiTE::shutdown();
}