Subversion Repositories NaviCtrl

Rev

Rev 259 | Rev 280 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 259 Rev 277
Line 1... Line 1...
1
#ifndef _WAYPOINTS_H
1
#ifndef _WAYPOINTS_H
2
#define _WAYPOINTS_H
2
#define _WAYPOINTS_H
Line 3... Line 3...
3
 
3
 
Line 4... Line 4...
4
#include "ubx.h"
4
#include "ubx.h"
5
 
5
 
6
//#define POINT_TYPE_INVALID
6
#define POINT_TYPE_INVALID 255
Line 7... Line 7...
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
typedef struct
10
typedef struct
11
{
11
{
12
        GPS_Pos_t Position;             // the gps position of the waypoint, see ubx.h for details
12
        GPS_Pos_t Position;             // the gps position of the waypoint, see ubx.h for details
13
        s16 Heading;                    // orientation, future implementation
13
        s16 Heading;                    // orientation, 0 no action, 1...360 fix heading, neg. = Index to POI in WP List
14
        u8  ToleranceRadius;    // in meters, if the MK is within that range around the target, then the next target is triggered
14
        u8  ToleranceRadius;    // in meters, if the MK is within that range around the target, then the next target is triggered
15
        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
15
        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
16
        u8  Event_Flag;                 // future implementation
16
        u8  Event_Flag;                 // future implementation
17
        u8  Index;              // to indentify different waypoints, workaround for bad communications PC <-> NC
17
        u8  Index;              // to indentify different waypoints, workaround for bad communications PC <-> NC
18
        u8  Type;                               // typeof Waypoint
18
        u8  Type;                               // typeof Waypoint
Line -... Line 19...
-
 
19
        u8  WP_EventChannelValue;  //
19
        u8  WP_EventChannelValue;  // 
20
        u8  reserve[9];             // reserve
-
 
21
} __attribute__((packed)) Waypoint_t;
20
        u8  reserve[9];             // reserve
22
 
-
 
23
// Init List, return TRUE on success
21
} __attribute__((packed)) Waypoint_t;
24
u8 WPList_Init(void);
-
 
25
// Clear List, return TRUE on success
22
 
26
u8 WPList_Clear(void);
-
 
27
// Returns number of points in the list
23
u8 WPList_Init(void);
28
u8 WPList_GetCount(void);
-
 
29
// appends a point to the list, returns TRUE on success
24
u8 WPList_Clear(void);
30
u8 WPList_Append(Waypoint_t* pwp);
-
 
31
// goto the first WP in the list and return pointer to it
25
u8 WPList_GetCount(void);
32
Waypoint_t* WPList_Begin(void);
-
 
33
// goto the last WP in the list and return pointer to it
26
u8 WPList_Append(Waypoint_t* pwp);
34
Waypoint_t* WPList_End(void);
-
 
35
// goto next WP in the list and return pointer to it
27
Waypoint_t* WPList_Begin(void);
36
Waypoint_t* WPList_Next(void);
Line 28... Line 37...
28
Waypoint_t* WPList_End(void);
37
// return pointer to point at position