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