-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
42 lines (31 loc) · 873 Bytes
/
main.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
#include <iostream>
#include <csignal>
#include "falcon_c.h"
bool stop = false;
void sigproc(int i)
{
if(!stop)
{
stop = true;
std::cout << "Quitting" << std::endl;
}
else exit(0);
}
int main(int argc, char *argv[]) {
signal(SIGINT, sigproc);
void * falcon_ref = falcon_init(0);
printf("init\n");
int error = falcon_load_firmware(falcon_ref, "firmware/novint_T2.bin");
printf("firmware %d\n", error);
while(!stop) {
error = falcon_run_io_loop(falcon_ref);
printf("%d ", error);
double x = falcon_get_pos_x(falcon_ref);
double y = falcon_get_pos_y(falcon_ref);
double z = falcon_get_pos_z(falcon_ref);
printf("%f %f %f\n", x, y, z);
}
//void falcon_set_force(void * falcon_ref, float x, float y, float z);
falcon_exit(falcon_ref);
return 0;
}