Subversion Repositories NaviCtrl

Rev

Rev 286 | Rev 295 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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