Subversion Repositories Projects

Rev

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