forked from multigcs/multigcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.h
155 lines (145 loc) · 2.48 KB
/
model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#ifndef MODEL_H
#define MODEL_H
#define MODELS_MAX 9
enum {
TELETYPE_MULTIWII_21,
TELETYPE_AUTOQUAD,
TELETYPE_ARDUPILOT,
TELETYPE_MEGAPIRATE_NG,
TELETYPE_OPENPILOT,
TELETYPE_GPS_NMEA,
TELETYPE_FRSKY,
TELETYPE_BASEFLIGHT,
TELETYPE_HARAKIRIML,
TELETYPE_LAST,
};
enum {
MODEL_MODE_MANUAL,
MODEL_MODE_POSHOLD,
MODEL_MODE_MISSION,
MODEL_MODE_RTL,
};
enum {
MODEL_DISARMED,
MODEL_ARMED,
MODEL_ARMING,
};
typedef struct {
float vin;
float amps;
uint16_t rpm;
uint16_t age;
uint8_t id;
uint8_t stat;
uint8_t err;
} EscStat;
typedef struct {
char name[200];
char sysstr[200];
char image[512];
uint8_t teletype;
uint8_t dronetype;
uint8_t pilottype;
char telebtaddr[200];
char telebtpin[200];
uint8_t mode;
uint8_t status;
uint8_t armed;
uint8_t heartbeat;
uint8_t heartbeat_rc;
uint8_t found_rc;
float p_lat;
float p_long;
float p_alt;
float next_lat;
float next_long;
float next_alt;
uint16_t next_count;
float alt_offset;
float baro;
float pitch;
float roll;
float yaw;
float speed;
float voltage;
float load;
int8_t gpsfix;
int8_t numSat;
float hdop;
float vdop;
int16_t radio[16];
int16_t radio_raw[8];
float acc_x;
float acc_y;
float acc_z;
float gyro_x;
float gyro_y;
float gyro_z;
float mag_x;
float mag_y;
float mag_z;
float mag2_x;
float mag2_y;
float mag2_z;
float press_abs;
float press_diff;
float mnt_pitch;
float mnt_roll;
float mnt_yaw;
uint8_t rssi_rx;
uint8_t rssi_tx;
uint8_t rssi_rc_rx;
uint8_t rssi_rc_tx;
float voltage_rx;
float voltage_zell[6];
float temperature[2];
float ampere;
float fc_voltage1;
float fc_voltage2;
uint8_t fc_i2c_errors;
uint16_t fc_status;
uint8_t chancount;
uint8_t sysid;
uint8_t compid;
uint8_t get_param;
uint32_t mavlink_update;
char telemetry_port[1024];
uint32_t telemetry_baud;
char deviceid[1024];
uint8_t use_deviceid;
uint8_t use_sysid;
uint8_t mavlink_sysid;
uint8_t mavlink_org_sysid;
uint8_t mavlink_forward;
uint8_t sysid_list[16];
uint8_t masterid;
char netip[16];
uint16_t netport;
int netsock;
int serial_fd;
float history[255][5];
uint8_t num_motors;
EscStat escstat[16];
int8_t follow;
uint8_t followme;
float fm_alt;
float fm_radius;
} Model;
typedef struct {
float p_lat;
float p_long;
float p_alt;
float dir;
uint8_t active;
float sp_alt;
float sp_radius;
int16_t wifibc_rssi[4];
int8_t gpsfix;
int8_t numSat;
float hdop;
float vdop;
} Ground;
extern uint8_t ModelActive;
extern Model ModelData[MODELS_MAX];
extern Ground GroundData;
#endif