Subversion Repositories Projects

Rev

Rev 391 | Rev 442 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 391 Rev 440
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
static const int VERSION_SERIAL_MAJOR = 10;
13
static const int VERSION_SERIAL_MINOR = 0;
13
static const int 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
static const int ADDRESS_ALL    = 0;
17
static const int ADDRESS_FC     = 1;
17
static const int ADDRESS_FC     = 1;
18
static const int ADDRESS_NC     = 2;
18
static const int ADDRESS_NC     = 2;
19
static const int ADDRESS_MK3MAG = 3;
19
static const int ADDRESS_MK3MAG = 3;
20
 
20
 
21
// settings ID
21
// settings ID
22
static const int SETTINGS_ID = 2;
22
static const int SETTINGS_ID = 2;
23
 
23
 
24
static const string HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"};
24
static const string HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"};
25
 
25
 
26
static const int MaxTickerEvents = 5;
26
static const int MaxTickerEvents = 5;
27
 
27
 
28
static const int MaxAnalog    = 32;
28
static const int MaxAnalog    = 32;
29
static const int MaxPlot      = 50000;
29
static const int MaxPlot      = 50000;
30
 
30
 
31
static const int MaxNaviPos   = 2000;
31
static const int MaxNaviPos   = 2000;
32
 
32
 
33
struct sMotor
33
struct sMotor
34
{
34
{
35
    int Speed[12];
35
    int Speed[12];
36
};
36
};
-
 
37
 
-
 
38
struct MotorData
-
 
39
{
-
 
40
    int motor[16][4];
-
 
41
    string mixerName;
-
 
42
    int mixerVersion;
-
 
43
};
37
 
44
 
38
struct sMode
45
struct sMode
39
{
46
{
40
    int ID;
47
    int ID;
41
    int VERSION_MAJOR;
48
    int VERSION_MAJOR;
42
    int VERSION_MINOR;
49
    int VERSION_MINOR;
43
    int VERSION_PATCH;
50
    int VERSION_PATCH;
44
    int VERSION_SERIAL_MAJOR;
51
    int VERSION_SERIAL_MAJOR;
45
    int VERSION_SERIAL_MINOR;
52
    int VERSION_SERIAL_MINOR;
46
    string Hardware;
53
    string Hardware;
47
    string Version;
54
    string Version;
48
};
55
};
49
 
56
 
50
struct sGPS_Pos
57
struct sGPS_Pos
51
{
58
{
52
    long Longitude;
59
    long Longitude;
53
    long Latitude;
60
    long Latitude;
54
    long Altitude;
61
    long Altitude;
55
};
62
};
56
 
63
 
57
struct sNaviData
64
struct sNaviData
58
{
65
{
59
    sGPS_Pos Current;
66
    sGPS_Pos Current;
60
    sGPS_Pos Target;
67
    sGPS_Pos Target;
61
    sGPS_Pos Home;
68
    sGPS_Pos Home;
62
 
69
 
63
    long Longitude;
70
    long Longitude;
64
    long Latitude;
71
    long Latitude;
65
    long Altitude;
72
    long Altitude;
66
};
73
};
67
 
-
 
68
struct sNaviString
-
 
69
{
-
 
70
    float Longitude;
-
 
71
    float Latitude;
-
 
72
    float Altitude;
-
 
73
};
-
 
74
 
74
 
75
struct sWayPoint
75
struct sWayPoint
76
{
76
{
77
    double Longitude;
77
    double Longitude;
78
    double Latitude;
78
    double Latitude;
79
    double Altitude;
79
    double Altitude;
80
    int Time;
80
    int Time;
81
};
81
};
-
 
82
 
-
 
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
};
82
 
98
 
83
#endif
99
#endif