Subversion Repositories NaviCtrl

Rev

Rev 286 | Rev 295 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
41 ingob 1
#ifndef _WAYPOINTS_H
2
#define _WAYPOINTS_H
3
 
4
#include "ubx.h"
5
 
277 killagreg 6
#define POINT_TYPE_INVALID 255
225 killagreg 7
#define POINT_TYPE_WP   0
8
#define POINT_TYPE_POI  1
291 holgerb 9
#define POINT_TYPE_BOTH 2 // only command 's'
225 killagreg 10
 
291 holgerb 11
extern u8 WPIndex;              // list index of GPS point representig the current WP, can be maximal WPCount
283 holgerb 12
extern u8 POIIndex;     // list index of GPS Point representing the current POI, can be maximal WPCount
291 holgerb 13
extern u8 WPCount;      // number of waypoints
14
extern u8 PointCount;           // number of wp in the list can be maximal equal to MAX_LIST_LEN
15
extern u8 POICount;
283 holgerb 16
 
41 ingob 17
typedef struct
18
{
19
        GPS_Pos_t Position;             // the gps position of the waypoint, see ubx.h for details
277 killagreg 20
        s16 Heading;                    // orientation, 0 no action, 1...360 fix heading, neg. = Index to POI in WP List
41 ingob 21
        u8  ToleranceRadius;    // in meters, if the MK is within that range around the target, then the next target is triggered
88 killagreg 22
        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
23
        u8  Event_Flag;                 // future implementation
162 ingob 24
        u8  Index;              // to indentify different waypoints, workaround for bad communications PC <-> NC
225 killagreg 25
        u8  Type;                               // typeof Waypoint
277 killagreg 26
        u8  WP_EventChannelValue;  //
286 killagreg 27
        u8      AltitudeRate;           // rate to change the setpoint
28
        u8  reserve[8];             // reserve
280 killagreg 29
} __attribute__((packed)) Point_t;
41 ingob 30
 
283 holgerb 31
extern Point_t* GPS_pPoi;                                               // pointer to the actual point of interrest
32
extern u8 POICount;
33
 
34
 
277 killagreg 35
// Init List, return TRUE on success
280 killagreg 36
u8 PointList_Init(void);
277 killagreg 37
// Clear List, return TRUE on success
280 killagreg 38
u8 PointList_Clear(void);
277 killagreg 39
// Returns number of points in the list
280 killagreg 40
u8 PointList_GetCount(void);
41
// return pointer to point at position
42
Point_t* PointList_GetAt(u8 index);
277 killagreg 43
// appends a point to the list, returns TRUE on success
280 killagreg 44
u8 PointList_Append(Point_t* pwp);
277 killagreg 45
// goto the first WP in the list and return pointer to it
280 killagreg 46
Point_t* PointList_WPBegin(void);
277 killagreg 47
// goto the last WP in the list and return pointer to it
280 killagreg 48
Point_t* PointList_WPEnd(void);
277 killagreg 49
// goto next WP in the list and return pointer to it
280 killagreg 50
Point_t* PointList_WPNext(void);
51
// disables waypoint function
52
void PointList_WPActive(u8 set);
277 killagreg 53
// returns pointer to actual POI
280 killagreg 54
Point_t* PointList_GetPOI(void);
41 ingob 55
 
280 killagreg 56
 
41 ingob 57
#endif // _WAYPOINTS_H