Rev 391 | Rev 442 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
391 | Brean | 1 | #ifndef COPTER_H |
2 | #define COPTER_H |
||
3 | #include <string> |
||
4 | |||
5 | using namespace std; |
||
6 | |||
7 | /** |
||
8 | * This file contains informations and configurations from the Mikrokopter |
||
9 | */ |
||
10 | |||
11 | // version information for the serial connection |
||
12 | static const int VERSION_SERIAL_MAJOR = 10; |
||
13 | static const int VERSION_SERIAL_MINOR = 0; |
||
14 | |||
15 | // Basis-Adresses for different Hardware components |
||
16 | static const int ADDRESS_ALL = 0; |
||
17 | static const int ADDRESS_FC = 1; |
||
18 | static const int ADDRESS_NC = 2; |
||
19 | static const int ADDRESS_MK3MAG = 3; |
||
20 | |||
21 | // settings ID |
||
22 | static const int SETTINGS_ID = 2; |
||
23 | |||
24 | static const string HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"}; |
||
25 | |||
26 | static const int MaxTickerEvents = 5; |
||
27 | |||
28 | static const int MaxAnalog = 32; |
||
29 | static const int MaxPlot = 50000; |
||
30 | |||
31 | static const int MaxNaviPos = 2000; |
||
32 | |||
33 | struct sMotor |
||
34 | { |
||
35 | int Speed[12]; |
||
36 | }; |
||
37 | |||
440 | Brean | 38 | struct MotorData |
39 | { |
||
40 | int motor[16][4]; |
||
41 | string mixerName; |
||
42 | int mixerVersion; |
||
43 | }; |
||
44 | |||
391 | Brean | 45 | struct sMode |
46 | { |
||
47 | int ID; |
||
48 | int VERSION_MAJOR; |
||
49 | int VERSION_MINOR; |
||
50 | int VERSION_PATCH; |
||
51 | int VERSION_SERIAL_MAJOR; |
||
52 | int VERSION_SERIAL_MINOR; |
||
53 | string Hardware; |
||
54 | string Version; |
||
55 | }; |
||
56 | |||
57 | struct sGPS_Pos |
||
58 | { |
||
59 | long Longitude; |
||
60 | long Latitude; |
||
61 | long Altitude; |
||
62 | }; |
||
63 | |||
64 | struct sNaviData |
||
65 | { |
||
66 | sGPS_Pos Current; |
||
67 | sGPS_Pos Target; |
||
68 | sGPS_Pos Home; |
||
69 | |||
70 | long Longitude; |
||
71 | long Latitude; |
||
72 | long Altitude; |
||
73 | }; |
||
74 | |||
75 | struct sWayPoint |
||
76 | { |
||
77 | double Longitude; |
||
78 | double Latitude; |
||
79 | double Altitude; |
||
80 | int Time; |
||
81 | }; |
||
82 | |||
440 | Brean | 83 | /** |
84 | * The KopterData class represents the current state of the MikroKopter. |
||
85 | * It containes all data that was sent from the Mikrokopter |
||
86 | */ |
||
87 | class KopterData { |
||
88 | public: |
||
89 | sMode mode; |
||
90 | sNaviData navi; |
||
91 | sMotor motor; |
||
92 | int analogData[MaxAnalog]; |
||
93 | // current LCD page |
||
94 | int lcd_cur; |
||
95 | //max count of LCD pages |
||
96 | int lcd_max; |
||
97 | }; |
||
98 | |||
391 | Brean | 99 | #endif |