-
Notifications
You must be signed in to change notification settings - Fork 0
/
nibble.cpp
executable file
·50 lines (35 loc) · 999 Bytes
/
nibble.cpp
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
/*
* File: nibble.cpp
* Author: sondra
*
* Created on June 15, 2014, 12:38 PM
*/
#include <common/mavlink.h>
#include <pthread.h>
#include <stdio.h>
#include "BalloonLocation.h"
#include "Comm.h"
#include "ComputerVision.h"
pthread_mutex_t locationLock = PTHREAD_MUTEX_INITIALIZER;
balloonLocation_t location;
int main(int argc, char **argv) {
Mission mission;
Comm comm;
comm.Startup(argc, argv);
pthread_t cvThread;
int rc;
printf( "Starting Computer Vision pthread.");
//pthread_mutex_init(&locationLock, NULL);
location.range = -1.0;
location.phi = 0.0;
location.theta = 0.0;
gettimeofday(&location.timestamp, NULL);
rc = pthread_create(&cvThread, NULL, ComputerVision::RunCV, NULL);
if (rc) {
printf("**************Error starting CV thread, return code from pthread_create is %d****************\n", rc);
}
while (true) {
comm.ReadMessages(&mission);
mission.HandleMission(&comm);
}
}