Rev 440 | Rev 449 | 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 |
||
442 | Brean | 12 | #define VERSION_SERIAL_MAJOR 10 |
13 | #define VERSION_SERIAL_MINOR 0 |
||
391 | Brean | 14 | |
442 | Brean | 15 | // Basis-Adresses for different hardware components |
16 | #define ADDRESS_ALL 0 |
||
17 | #define ADDRESS_FC 1 |
||
18 | #define ADDRESS_NC 2 |
||
19 | #define ADDRESS_MK3MAG 3 |
||
391 | Brean | 20 | |
442 | Brean | 21 | //maximum amount of motors |
22 | #define MAX_MOTORS 12 |
||
23 | |||
391 | Brean | 24 | // settings ID |
442 | Brean | 25 | #define SETTINGS_ID 2 |
391 | Brean | 26 | |
27 | static const string HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"}; |
||
28 | |||
29 | static const int MaxTickerEvents = 5; |
||
30 | |||
31 | static const int MaxAnalog = 32; |
||
32 | static const int MaxPlot = 50000; |
||
33 | |||
34 | static const int MaxNaviPos = 2000; |
||
35 | |||
442 | Brean | 36 | struct sMotorData |
391 | Brean | 37 | { |
442 | Brean | 38 | int mixer_gas[MAX_MOTORS]; |
39 | int mixer_nick[MAX_MOTORS]; |
||
40 | int mixer_roll[MAX_MOTORS]; |
||
41 | int mixer_yaw[MAX_MOTORS]; |
||
42 | int desired_speed[MAX_MOTORS]; |
||
43 | string mixer_name; |
||
44 | int mixer_version; |
||
391 | Brean | 45 | }; |
46 | |||
47 | struct sMode |
||
48 | { |
||
442 | Brean | 49 | int id; |
50 | int version_major; |
||
51 | int version_minor; |
||
52 | int version_patch; |
||
53 | int version_serial_major; |
||
54 | int version_serial_minor; |
||
55 | string hardware; |
||
56 | string version; |
||
391 | Brean | 57 | }; |
58 | |||
59 | struct sGPS_Pos |
||
60 | { |
||
61 | long Longitude; |
||
62 | long Latitude; |
||
63 | long Altitude; |
||
64 | }; |
||
65 | |||
66 | struct sNaviData |
||
67 | { |
||
68 | sGPS_Pos Current; |
||
69 | sGPS_Pos Target; |
||
70 | sGPS_Pos Home; |
||
71 | |||
72 | long Longitude; |
||
73 | long Latitude; |
||
74 | long Altitude; |
||
75 | }; |
||
76 | |||
77 | struct sWayPoint |
||
78 | { |
||
79 | double Longitude; |
||
80 | double Latitude; |
||
81 | double Altitude; |
||
82 | int Time; |
||
83 | }; |
||
84 | |||
440 | Brean | 85 | /** |
86 | * The KopterData class represents the current state of the MikroKopter. |
||
87 | * It containes all data that was sent from the Mikrokopter |
||
88 | */ |
||
89 | class KopterData { |
||
90 | public: |
||
91 | sMode mode; |
||
92 | sNaviData navi; |
||
442 | Brean | 93 | sMotorData motor; |
440 | Brean | 94 | int analogData[MaxAnalog]; |
95 | // current LCD page |
||
96 | int lcd_cur; |
||
97 | //max count of LCD pages |
||
98 | int lcd_max; |
||
99 | }; |
||
100 | |||
391 | Brean | 101 | #endif |