-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuatTester.cpp
52 lines (46 loc) · 1.3 KB
/
QuatTester.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
49
50
51
52
#include "Vector/Vector.h"
#include "Comm/Comm.h"
#include <time.h>
int main(int argc, char *argv[])
{
if (argc != 3)
{
cerr << "Wrong number of arguments" << endl;
return 1;
}
// UDP sender object
UDPSender snd(argv[1], argv[2]);
PlaneState p;
usleep(1000000);
while(true)
{
double i = 0, j=0, k=0;
//for (double j=0; j<360; j++)
for (k=0; k<360; k++)
{
double yaw=DEG2RAD(i), pitch=DEG2RAD(j), roll=DEG2RAD(k);
p.orientation = Quaternion(yaw, pitch, roll);
snd.sendPlaneState(p);
usleep(5000);
}
usleep(1000000);
i=0, k = 0;
for (j=0; j<360; j++)
{
double yaw=DEG2RAD(i), pitch=DEG2RAD(j), roll=DEG2RAD(k);
p.orientation = Quaternion(yaw, pitch, roll);
snd.sendPlaneState(p);
usleep(5000);
}
usleep(1000000);
j=0, k = 0;
for (i=0; i<360; i++)
{
double yaw=DEG2RAD(i), pitch=DEG2RAD(j), roll=DEG2RAD(k);
p.orientation = Quaternion(yaw, pitch, roll);
snd.sendPlaneState(p);
usleep(5000);
}
usleep(1000000);
}
}