f46ed61f137666722c8f53995551740713fc2e8f
[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     QString decodeState(unsigned int state,int level);
26
27     unsigned int state,oldState;
28     QString decodedState;
29     float vbat;
30     float pitch;
31     float roll;
32     float yaw;
33     float altitude;
34     float vx;
35     float vy;
36     float vf;
37     float vz;
38     float current_motor1;
39     float current_motor2;
40     float current_motor3;
41     float current_motor4;
42     int pwm_motor1;
43     int pwm_motor2;
44     int pwm_motor3;
45     int pwm_motor4;
46     tag_t tags[4];
47 signals:
48     void navDataUpdated();
49     void stateUpdated();
50 public slots:
51
52 };
53
54 #endif // NAVDATA_H