Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
143 | salvo | 1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
161 | salvo | 2 | // Peter Muehlenbrock ("Salvo") |
143 | salvo | 3 | // Definitionen fuer Modul GPS |
161 | salvo | 4 | // Stand 19.9.007 |
143 | salvo | 5 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 | ingob | 6 | extern signed int GPS_Nick; |
7 | extern signed int GPS_Roll; |
||
8 | extern void GPS_Neutral(void); |
||
143 | salvo | 9 | |
10 | extern void Get_Ublox_Msg(uint8_t rx) ; |
||
156 | salvo | 11 | //extern short int Get_GPS_data(void); |
12 | extern short int Get_Rel_Position(void); |
||
13 | extern void GPS_Save_Home(void); |
||
158 | salvo | 14 | extern short int GPS_CRTL(short int cmd); |
143 | salvo | 15 | |
16 | typedef struct { |
||
17 | unsigned long utm_itow; // time of week |
||
18 | long utm_east; // UTM Ost in cm |
||
19 | long utm_north; // UTM Nord in cm |
||
20 | long utm_alt; // hoehe in cm |
||
21 | uint8_t utm_zone; // |
||
22 | uint8_t utm_hem; // Hemisphere Indicator |
||
23 | uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
||
24 | } NAV_POSUTM_t; |
||
25 | |||
26 | typedef struct { |
||
27 | unsigned long itow; // time of week |
||
28 | uint8_t gpsfix_type;// 3=3D Fix |
||
29 | uint8_t nav_status_flag; |
||
30 | uint8_t nav_diff_status; |
||
31 | uint8_t nav_resevd; |
||
32 | long nav_tff; // Time to First Fix in ms |
||
33 | long nav_msss; // ms since startup |
||
34 | uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
||
35 | } NAV_STATUS_t; |
||
36 | |||
37 | typedef struct { |
||
38 | unsigned long itow; |
||
39 | long speed_n; // in cm/s |
||
40 | long speed_e; // in cm/s |
||
41 | long speed_alt; // in cm/s |
||
42 | unsigned long speed_3d; // in cm/s |
||
43 | unsigned long speed_gnd; // V ueber Grund in cm/s |
||
44 | long heading; // Richtung in deg/10000 |
||
45 | unsigned long sacc; // Speed Genauigkeit in cm/s |
||
46 | unsigned long cacc; // Richtungsgenauigkeit in deg |
||
47 | uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
||
48 | } NAV_VELNED_t; |
||
49 | |||
50 | |||
51 | typedef struct { |
||
52 | long utm_east; // UTM Ost in 10 cm |
||
53 | long utm_north; // UTM Nord in 10 cm |
||
54 | long utm_alt; // hoehe in 10 cm |
||
55 | unsigned long speed_gnd; // V ueber Grund in 10cm/s |
||
56 | unsigned heading; // Richtung in Grad |
||
57 | uint8_t status; // 0: keine gueltigen Daten 1: alles ok |
||
58 | |||
156 | salvo | 59 | } GPS_ABS_POSITION_t; |
143 | salvo | 60 | |
61 | |||
156 | salvo | 62 | typedef struct { // Struktur fuer Relative GPS Daten (bezogen z.B. auf Home Position) |
63 | int utm_east; // UTM Ost in m |
||
64 | int utm_north; // UTM Nord in m |
||
65 | uint8_t status; // 0: keine gueltigen Daten 1: alles ok |
||
143 | salvo | 66 | |
156 | salvo | 67 | } GPS_REL_POSITION_t; |
68 | |||
69 | |||
70 | extern GPS_ABS_POSITION_t gps_act_position; |
||
71 | extern GPS_ABS_POSITION_t gps_home_position; |
||
72 | extern GPS_REL_POSITION_t gps_rel_act_position; |
||
158 | salvo | 73 | extern GPS_REL_POSITION_t gps_rel_hold_position; |
143 | salvo | 74 | extern unsigned int cnt0,cnt1,cnt2; |
158 | salvo | 75 | extern short int gps_state; |
76 | extern signed int GPS_hdng_abs_2trgt; |
||
77 | extern signed int GPS_hdng_rel_2trgt; |
||
78 | extern signed int GPS_dist_2trgt; |
||
159 | salvo | 79 | extern signed int gps_reg_x,gps_reg_y; |
160 | salvo | 80 | extern signed int GPS_dist_2trgt; |
158 | salvo | 81 | |
82 | // Zustaende der zentralen GPS statemachine |
||
83 | #define GPS_CRTL_IDLE 0 // |
||
162 | salvo | 84 | #define GPS_CRTL_HOLD_ACTIVE 1 // Lageregelung aktiv |
85 | #define GPS_CRTL_HOME_ACTIVE 2 // Rueckglug zur Basis Aktiv |
||
158 | salvo | 86 | |
87 | // Kommandokonstanten fuer die zentrale GPS statemachine |
||
88 | #define GPS_CMD_REQ_INIT 0 // Initialisierung |
||
162 | salvo | 89 | #define GPS_CMD_STOP 1 // Lageregelung soll deaktiviert werden |
90 | #define GPS_CMD_REQ_HOLD 3 // Lageregelung soll aktiviert werden |
||
91 | #define GPS_CMD_REQ_HOME 4 // Das Heimfliegen soll aktiviert werden |
||
158 | salvo | 92 | |
93 | // Statusmeldungen der zentralen GPS statemachine |
||
94 | #define GPS_STST_OK 0 // Kommando erfolgreich und abgeschlossen |
||
95 | #define GPS_STST_PEND 1 // Kommando noch nicht komplett durchgefuehrt |
||
96 | #define GPS_STST_ERR 2 // Fehler |
||
159 | salvo | 97 | |
98 | // GPS Lageregler |
||
167 | salvo | 99 | #define GPS_NICKROLL_MAX 20 //Maximaler Einfluss des GPS Lagereglers auf Nick und Roll |
161 | salvo | 100 |