Subversion Repositories NaviCtrl

Rev

Rev 283 | Rev 291 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 283 Rev 286
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
 
9
 
10
extern u8 POIIndex;     // list index of GPS Point representing the current POI, can be maximal WPCount
10
extern u8 POIIndex;     // list index of GPS Point representing the current POI, can be maximal WPCount
11
 
11
 
12
typedef struct
12
typedef struct
13
{
13
{
14
        GPS_Pos_t Position;             // the gps position of the waypoint, see ubx.h for details
14
        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
15
        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
16
        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
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
18
        u8  Event_Flag;                 // future implementation
18
        u8  Event_Flag;                 // future implementation
19
        u8  Index;              // to indentify different waypoints, workaround for bad communications PC <-> NC
19
        u8  Index;              // to indentify different waypoints, workaround for bad communications PC <-> NC
20
        u8  Type;                               // typeof Waypoint
20
        u8  Type;                               // typeof Waypoint
21
        u8  WP_EventChannelValue;  //
21
        u8  WP_EventChannelValue;  //
22
    s16 DesiredAltitude;
-
 
23
        u8      ClimbingSpeed;
22
        u8      AltitudeRate;           // rate to change the setpoint
24
        u8  reserve[6];             // reserve
23
        u8  reserve[8];             // reserve
25
} __attribute__((packed)) Point_t;
24
} __attribute__((packed)) Point_t;
26
 
25
 
27
extern Point_t* GPS_pPoi;                                               // pointer to the actual point of interrest
26
extern Point_t* GPS_pPoi;                                               // pointer to the actual point of interrest
28
extern u8 POICount;
27
extern u8 POICount;
29
 
28
 
30
 
29
 
31
// Init List, return TRUE on success
30
// Init List, return TRUE on success
32
u8 PointList_Init(void);
31
u8 PointList_Init(void);
33
// Clear List, return TRUE on success
32
// Clear List, return TRUE on success
34
u8 PointList_Clear(void);
33
u8 PointList_Clear(void);
35
// Returns number of points in the list
34
// Returns number of points in the list
36
u8 PointList_GetCount(void);
35
u8 PointList_GetCount(void);
37
// return pointer to point at position
36
// return pointer to point at position
38
Point_t* PointList_GetAt(u8 index);
37
Point_t* PointList_GetAt(u8 index);
39
// appends a point to the list, returns TRUE on success
38
// appends a point to the list, returns TRUE on success
40
u8 PointList_Append(Point_t* pwp);
39
u8 PointList_Append(Point_t* pwp);
41
// goto the first WP in the list and return pointer to it
40
// goto the first WP in the list and return pointer to it
42
Point_t* PointList_WPBegin(void);
41
Point_t* PointList_WPBegin(void);
43
// goto the last WP in the list and return pointer to it
42
// goto the last WP in the list and return pointer to it
44
Point_t* PointList_WPEnd(void);
43
Point_t* PointList_WPEnd(void);
45
// goto next WP in the list and return pointer to it
44
// goto next WP in the list and return pointer to it
46
Point_t* PointList_WPNext(void);
45
Point_t* PointList_WPNext(void);
47
// disables waypoint function
46
// disables waypoint function
48
void PointList_WPActive(u8 set);
47
void PointList_WPActive(u8 set);
49
// returns pointer to actual POI
48
// returns pointer to actual POI
50
Point_t* PointList_GetPOI(void);
49
Point_t* PointList_GetPOI(void);
51
 
50
 
52
 
51
 
53
#endif // _WAYPOINTS_H
52
#endif // _WAYPOINTS_H
54
 
53