Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1470 - 1
#ifndef _WAYPOINTS_H
2
#define _WAYPOINTS_H
3
 
4
//#include "ubx.h"
5
 
6
#define POINT_TYPE_INVALID 255
7
#define POINT_TYPE_WP   0
8
#define POINT_TYPE_POI  1
9
 
10
 
11
typedef struct
12
{
13
        s32 Longitude;  // in 1E-7 deg
14
        s32 Latitude;   // in 1E-7 deg
15
        s32 Altitude;   // in mm
16
        u8 Status;// validity of data
17
} __attribute__((packed)) GPS_Pos_t;
18
 
19
 
20
typedef struct
21
{
22
        GPS_Pos_t Position;             // the gps position of the waypoint, see ubx.h for details
23
        s16 Heading;                    // orientation, 0 no action, 1...360 fix heading, neg. = Index to POI in WP List
24
        u8  ToleranceRadius;    // in meters, if the MK is within that range around the target, then the next target is triggered
25
        u8  HoldTime;                   // in seconds, if the was once in the tolerance area around a WP, this time defines the delay before the next WP is triggered
26
        u8  Event_Flag;                 // future implementation
27
        u8  Index;              // to indentify different waypoints, workaround for bad communications PC <-> NC
28
        u8  Type;                               // typeof Waypoint
29
        u8  WP_EventChannelValue;  //
30
        u8      AltitudeRate;           // rate to change the setpoint
31
        u8  reserve[8];             // reserve
32
} __attribute__((packed)) Point_t;
33
 
34
// Init List, return TRUE on success
35
u8 PointList_Init(void);
36
// Clear List, return TRUE on success
37
u8 PointList_Clear(void);
38
// Returns number of points in the list
39
u8 PointList_GetCount(void);
40
// return pointer to point at position
41
Point_t* PointList_GetAt(u8 index);
42
// set a point in the list at index, returns its index on success, else 0
43
u8 PointList_SetAt(Point_t* pPoint);
44
// goto the first WP in the list and return pointer to it
45
Point_t* PointList_WPBegin(void);
46
// goto the last WP in the list and return pointer to it
47
Point_t* PointList_WPEnd(void);
48
// goto next WP in the list and return pointer to it
49
Point_t* PointList_WPNext(void);
50
// enables/disables waypoint function
51
void PointList_WPActive(u8 set);
52
// returns pointer to actual POI
53
Point_t* PointList_GetPOI(void);
54
 
55
 
56
#endif // _WAYPOINTS_H