-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
70 lines (53 loc) · 1.22 KB
/
main.cpp
File metadata and controls
70 lines (53 loc) · 1.22 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*!
* \file main.cpp
* \author Gabriel Urbain <gurbain@mit.edu> - Visiting student at MIT SSL
* \date June 2014
* \version 0.1
* \brief Main program
*
* License: The MIT License (MIT)
* Copyright (c) 2014, Massachussets Institute of Technology
*/
// Project libs
#include "main.h"
#include "utils.h"
#include "defines.h"
#include "halo.h"
using namespace std;
using namespace cv;
// Allocate variables
Halo halo;
// Create a CTRL-C handler
void exit_handler(int s){
InterruptVisualizationThread();
halo.close();
exit(1);
}
int main(int argc, char **argv) {
init();
// For catching a CTRL-C
signal(SIGINT,exit_handler);
// Initialize
int retVal = halo.init("../examples/halo_calib_dataset/");
if (retVal !=0 )
exit_handler(0);
// Launch vizualization (you can give the pixel dimensions)
RunVisualizationThread(2);
// Main loop
while(true) {
// Capture cloud
vector<Point3d> pointcloud;
vector<Vec3b> rgbcloud;
retVal = halo.capture3Dcloud(pointcloud, rgbcloud);
if (retVal !=0 )
exit_handler(0);
sleep(1);
// Display cloud
ShowClouds(pointcloud, rgbcloud);
}
// Wait for updating vizualization
WaitForVisualizationThread();
// Close cameras
halo.close();
return 0;
}