Sync refactoring for multiple platforms
[mardrone] / mardrone / dronelib / navdata.h
1 #ifndef NAVDATA_H
2 #define NAVDATA_H
3
4 #include <QObject>
5 #undef _GNU_SOURCE // just get rid of error message double definition
6 #include <navdata_common.h>
7 #include "config.h"
8
9 struct tag_t {
10     unsigned int type;
11     unsigned int xc;
12     unsigned int yc;
13     unsigned int width;
14     unsigned int height;
15     unsigned int dist;
16 };
17
18 class NavData : public QObject
19 {
20     Q_OBJECT
21 public:
22     explicit NavData(QObject *parent = 0);
23     void parseRawNavData(char *buf,unsigned int len);
24     void parseOption(navdata_option_t *op);
25     void setState(QString state);
26     QString decodeState(unsigned int state,int level);
27
28     unsigned int state,oldState;
29     QString decodedState;
30     float vbat;
31     float pitch;
32     float roll;
33     float yaw;
34     float altitude;
35     float vx;
36     float vy;
37     float vf;
38     float vz;
39     float current_motor1;
40     float current_motor2;
41     float current_motor3;
42     float current_motor4;
43     int pwm_motor1;
44     int pwm_motor2;
45     int pwm_motor3;
46     int pwm_motor4;
47     tag_t tags[4];
48     int navSeq;
49 signals:
50     void navDataUpdated();
51     void stateUpdated();
52 public slots:
53
54 };
55
56 #endif // NAVDATA_H