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