-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIPGTrack.h
47 lines (38 loc) · 899 Bytes
/
IPGTrack.h
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
/*
* IPGTrack.h
*
* Created on: Jun 8, 2017
* Author: may
*/
#ifndef _IPGTRACK_H_
#define _IPGTRACK_H_
#include <string>
#include <tcl.h>
#include <boost/thread/thread.hpp>
#include <glm/gtx/quaternion.hpp>
// RawHID transfers floats as bytes
typedef union data {
float num_f[16];
uint32_t num_d[16];
uint8_t raw[64];
} data_t;
class IPGTrack : public DeviceBase {
private:
bool _running = false;
bool _start = false;
bool _export = false;
boost::thread *_rxThread = nullptr;
glm::quat _quat_ref = glm::quat(), _quat = glm::quat();
void SetQuat(data_t &rx_data);
void TaskLoop();
public:
IPGTrack();
IPGTrack(std::string &cmd);
int Init();
int Send(char keycode);
int Terminate();
int GetMVMatrix(Tcl_Interp* interp, Tcl_Obj* tcl_ret);
void Export(bool state);
void ResetCamera();
};
#endif /* _IPGTRACK_H_ */