Subversion Repositories NaviCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
491 killagreg 1
#ifndef _GPS_POS_H
2
#define _GPS_POS_H
3
 
4
#define INVALID         0x00
5
#define NEWDATA         0x01
6
#define PROCESSED       0x02
557 holgerb 7
#define SIMULATION      0x03
491 killagreg 8
 
9
typedef struct
10
{
11
        s32 Longitude;  // in 1E-7 deg
12
        s32 Latitude;   // in 1E-7 deg
13
        s32 Altitude;   // in mm
14
        u8 Status;              // validity of data
15
} __attribute__((packed)) GPS_Pos_t;
16
 
17
typedef struct
18
{
19
        u8  Status;     // invalid, newdata, processed
20
        s32 North;              // in cm deviation from target
21
        s32 East;               // in cm deviation from target
22
        s32 Bearing;    // in deg to target
735 holgerb 23
        s32 Distance_cm;        // in cm to target
491 killagreg 24
} __attribute__((packed)) GPS_Pos_Deviation_t;
25
 
26
/*
27
// transform the integer 1E-7 deg into float radians
28
float GPSPos_ToRadians(s32 deg);
29
// transform the integer 1E-7 deg into float deg
30
float GPSPos_ToDeg(s32 deg);
31
*/
32
// clear GPS position data
33
u8 GPSPos_Clear(GPS_Pos_t* pGPSPos);
34
// copy GPS position from source position to target position
35
u8 GPSPos_Copy(GPS_Pos_t* pGPSPosSrc, GPS_Pos_t* pGPSPosTgt);
36
// calculate the deviation from the source position to the target position
37
u8 GPSPos_Deviation(GPS_Pos_t* pReferencePos, GPS_Pos_t* pTargetPos, GPS_Pos_Deviation_t* pDeviation);
492 killagreg 38
// clear position deviation
39
u8 GPSPos_Deviation_Clear(GPS_Pos_Deviation_t* pDeviation);
491 killagreg 40
// Move the gps position according to north and east shift in cm
41
u8 GPSPos_ShiftCartesian(GPS_Pos_t* pGPSPos, s32 NorthShift, s32 EastShift);
42
// Move the gps position according to the direction of bearing in deg by the given distance in cm
43
u8 GPSPos_ShiftGeodetic(GPS_Pos_t* pGPSPos, s32 Bearing, s32 Distance);
44
// Move Pos so that distance to ReferencePos is limited to MaxDistance in cm
45
// returns 1 if Pos has been moved to fit the limit
46
u8 GPSPos_CatchDistance(GPS_Pos_t* pPos, GPS_Pos_t*  pReferencePos, s32 MaxDistance);
47
 
48
#endif //_GPS_POS_H