Rev 158 |
Go to most recent revision |
Blame |
Last modification |
View Log
| RSS feed
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Peter Muehlenbrock
// Definitionen fuer Modul GPS
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
extern signed int GPS_Nick;
extern signed int GPS_Roll;
extern void GPS_Neutral(void);
extern void Get_Ublox_Msg(uint8_t rx) ;
//extern short int Get_GPS_data(void);
extern short int Get_Rel_Position(void);
extern void GPS_Save_Home(void);
extern short int GPS_CRTL(short int cmd);
typedef struct {
unsigned long utm_itow; // time of week
long utm_east; // UTM Ost in cm
long utm_north; // UTM Nord in cm
long utm_alt; // hoehe in cm
uint8_t utm_zone; //
uint8_t utm_hem; // Hemisphere Indicator
uint8_t status; // 0: kein gueltiges Paket 1: alles ok
} NAV_POSUTM_t;
typedef struct {
unsigned long itow; // time of week
uint8_t gpsfix_type;// 3=3D Fix
uint8_t nav_status_flag;
uint8_t nav_diff_status;
uint8_t nav_resevd;
long nav_tff; // Time to First Fix in ms
long nav_msss; // ms since startup
uint8_t status; // 0: kein gueltiges Paket 1: alles ok
} NAV_STATUS_t;
typedef struct {
unsigned long itow;
long speed_n; // in cm/s
long speed_e; // in cm/s
long speed_alt; // in cm/s
unsigned long speed_3d; // in cm/s
unsigned long speed_gnd; // V ueber Grund in cm/s
long heading; // Richtung in deg/10000
unsigned long sacc; // Speed Genauigkeit in cm/s
unsigned long cacc; // Richtungsgenauigkeit in deg
uint8_t status; // 0: kein gueltiges Paket 1: alles ok
} NAV_VELNED_t;
typedef struct {
long utm_east; // UTM Ost in 10 cm
long utm_north; // UTM Nord in 10 cm
long utm_alt; // hoehe in 10 cm
unsigned long speed_gnd; // V ueber Grund in 10cm/s
unsigned heading; // Richtung in Grad
uint8_t status; // 0: keine gueltigen Daten 1: alles ok
} GPS_ABS_POSITION_t;
typedef struct { // Struktur fuer Relative GPS Daten (bezogen z.B. auf Home Position)
int utm_east; // UTM Ost in m
int utm_north; // UTM Nord in m
uint8_t status; // 0: keine gueltigen Daten 1: alles ok
} GPS_REL_POSITION_t;
extern GPS_ABS_POSITION_t gps_act_position;
extern GPS_ABS_POSITION_t gps_home_position;
extern GPS_REL_POSITION_t gps_rel_act_position;
extern GPS_REL_POSITION_t gps_rel_hold_position;
extern unsigned int cnt0,cnt1,cnt2;
extern short int gps_state;
extern signed int GPS_hdng_abs_2trgt;
extern signed int GPS_hdng_rel_2trgt;
extern signed int GPS_dist_2trgt;
extern signed int gps_reg_x,gps_reg_y;
// Zustaende der zentralen GPS statemachine
#define GPS_CRTL_IDLE 0 //
#define GPS_CRTL_HOLD_ACTIVE 3 // Lageregelung aktiv
// Kommandokonstanten fuer die zentrale GPS statemachine
#define GPS_CMD_REQ_INIT 0 // Initialisierung
#define GPS_CMD_REQ_HOLD 1 // Lageregelung soll aktiviert werden
#define GPS_CMD_STOP_HOLD 2 // Lageregelung soll deaktiviert werden
#define GPS_CMD_WAIT 4 // nix tun, nur Status abfragen
// Statusmeldungen der zentralen GPS statemachine
#define GPS_STST_OK 0 // Kommando erfolgreich und abgeschlossen
#define GPS_STST_PEND 1 // Kommando noch nicht komplett durchgefuehrt
#define GPS_STST_ERR 2 // Fehler
// GPS Lageregler
#define GPS_NICK_MAX 20
#define GPS_ROLL_MAX 20