Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
143 | salvo | 1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 | // Peter Muehlenbrock |
||
3 | // Definitionen fuer Modul GPS |
||
4 | |||
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; |
158 | salvo | 80 | |
81 | // Zustaende der zentralen GPS statemachine |
||
82 | #define GPS_CRTL_IDLE 0 // |
||
159 | salvo | 83 | #define GPS_CRTL_HOLD_ACTIVE 3 // Lageregelung aktiv |
158 | salvo | 84 | |
85 | // Kommandokonstanten fuer die zentrale GPS statemachine |
||
86 | #define GPS_CMD_REQ_INIT 0 // Initialisierung |
||
87 | #define GPS_CMD_REQ_HOLD 1 // Lageregelung soll aktiviert werden |
||
88 | #define GPS_CMD_STOP_HOLD 2 // Lageregelung soll deaktiviert werden |
||
89 | #define GPS_CMD_WAIT 4 // nix tun, nur Status abfragen |
||
90 | |||
91 | // Statusmeldungen der zentralen GPS statemachine |
||
92 | #define GPS_STST_OK 0 // Kommando erfolgreich und abgeschlossen |
||
93 | #define GPS_STST_PEND 1 // Kommando noch nicht komplett durchgefuehrt |
||
94 | #define GPS_STST_ERR 2 // Fehler |
||
159 | salvo | 95 | |
96 | // GPS Lageregler |
||
97 | #define GPS_NICK_MAX 20 |
||
98 | #define GPS_ROLL_MAX 20 |