Subversion Repositories NaviCtrl

Rev

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

Rev 225 Rev 227
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
6
#define POINT_TYPE_WP   0
7
#define POINT_TYPE_WP   0
7
#define POINT_TYPE_POI  1
8
#define POINT_TYPE_POI  1
8
 
9
 
9
typedef struct
10
typedef struct
10
{
11
{
11
        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
12
        s16 Heading;                    // orientation, future implementation
13
        s16 Heading;                    // orientation, future implementation
13
        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
14
        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
15
        u8  Event_Flag;                 // future implementation
16
        u8  Event_Flag;                 // future implementation
16
        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
17
        u8  Type;                               // typeof Waypoint
18
        u8  Type;                               // typeof Waypoint
18
        u8  reserve[10];                // reserve
19
        u8  reserve[10];                // reserve
19
} __attribute__((packed)) Waypoint_t;
20
} __attribute__((packed)) Waypoint_t;
20
 
21
 
21
u8 WPList_Init(void);
22
u8 WPList_Init(void);
22
u8 WPList_Clear(void);
23
u8 WPList_Clear(void);
23
u8 WPList_GetCount(void);
24
u8 WPList_GetCount(void);
24
u8 WPList_Append(Waypoint_t* pwp);
25
u8 WPList_Append(Waypoint_t* pwp);
25
Waypoint_t* WPList_Begin(void);
26
Waypoint_t* WPList_Begin(void);
26
Waypoint_t* WPList_End(void);
27
Waypoint_t* WPList_End(void);
27
Waypoint_t* WPList_Next(void);
28
Waypoint_t* WPList_Next(void);
28
Waypoint_t* WPList_GetAt(u8 index);
29
Waypoint_t* WPList_GetAt(u8 index);
29
Waypoint_t* WPList_GetPOI(void);
30
Waypoint_t* WPList_GetPOI(void);
30
 
31
 
31
#endif // _WAYPOINTS_H
32
#endif // _WAYPOINTS_H
32
 
33