summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-20 12:16:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-20 15:30:17 +0200
commit1c9e60221a52e9419780e81aedfe076ad157d014 (patch)
treed4474e79d454fe5807c5f0ca415bbacbabd84fe4 /ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
parent5d8cdde055947ef9c8e157047f090b19e368140c (diff)
reformat only
Diffstat (limited to 'ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp')
-rw-r--r--ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
index 811a08d9..3a63df6e 100644
--- a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
+++ b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
@@ -21,27 +21,28 @@ void TrackerImpl::run() {
float rot[6];
struct {
float pad[9];
- float rot[6];
+ float rot[6];
} raw_rot;
};
} data;
-
+
enum F {
flag_Raw = 1 << 0,
flag_Orient = 1 << 1,
Mask = flag_Raw | flag_Orient
};
- while (1) {
+ while (1) {
if (should_quit)
break;
{
float* orient = nullptr;
-
- while (sock.hasPendingDatagrams()) {
+
+ while (sock.hasPendingDatagrams())
+ {
data = decltype(data){0,0, 0,0,0};
(void) sock.readDatagram(reinterpret_cast<char*>(&data), sizeof(data));
-
+
int flags = data.flags & F::Mask;
switch (flags)
{
@@ -62,14 +63,14 @@ void TrackerImpl::run() {
pose[Yaw + i] = orient[i];
}
}
- usleep(4000);
- }
+ usleep(4000);
+ }
}
void TrackerImpl::StartTracker(QFrame*)
{
(void) sock.bind(QHostAddress::Any, (int) s.port, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint);
- start();
+ start();
}
void TrackerImpl::GetHeadPoseData(double *data)