Rev 295 | Rev 386 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 295 | Rev 348 | ||
---|---|---|---|
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 | 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, 0 no action, 1...360 fix heading, neg. = Index to POI in WP List |
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 |
19 | u8 WP_EventChannelValue; // |
19 | u8 WP_EventChannelValue; // |
20 | u8 AltitudeRate; // rate to change the setpoint |
20 | u8 AltitudeRate; // rate to change the setpoint |
- | 21 | u8 Speed; // rate to change the Position |
|
- | 22 | u8 CamAngle; // Camera servo angle |
|
21 | u8 reserve[8]; // reserve |
23 | u8 reserve[6]; // reserve |
22 | } __attribute__((packed)) Point_t; |
24 | } __attribute__((packed)) Point_t; |
23 | 25 | ||
24 | // Init List, return TRUE on success |
26 | // Init List, return TRUE on success |
25 | u8 PointList_Init(void); |
27 | u8 PointList_Init(void); |
26 | // Clear List, return TRUE on success |
28 | // Clear List, return TRUE on success |
27 | u8 PointList_Clear(void); |
29 | u8 PointList_Clear(void); |
28 | // Returns number of points in the list |
30 | // Returns number of points in the list |
29 | u8 PointList_GetCount(void); |
31 | u8 PointList_GetCount(void); |
30 | // return pointer to point at position |
32 | // return pointer to point at position |
31 | Point_t* PointList_GetAt(u8 index); |
33 | Point_t* PointList_GetAt(u8 index); |
32 | // set a point in the list at index, returns its index on success, else 0 |
34 | // set a point in the list at index, returns its index on success, else 0 |
33 | u8 PointList_SetAt(Point_t* pPoint); |
35 | u8 PointList_SetAt(Point_t* pPoint); |
34 | // goto the first WP in the list and return pointer to it |
36 | // goto the first WP in the list and return pointer to it |
35 | Point_t* PointList_WPBegin(void); |
37 | Point_t* PointList_WPBegin(void); |
36 | // goto the last WP in the list and return pointer to it |
38 | // goto the last WP in the list and return pointer to it |
37 | Point_t* PointList_WPEnd(void); |
39 | Point_t* PointList_WPEnd(void); |
38 | // goto next WP in the list and return pointer to it |
40 | // goto next WP in the list and return pointer to it |
39 | Point_t* PointList_WPNext(void); |
41 | Point_t* PointList_WPNext(void); |
40 | // enables/disables waypoint function |
42 | // enables/disables waypoint function |
41 | void PointList_WPActive(u8 set); |
43 | void PointList_WPActive(u8 set); |
42 | // returns pointer to actual POI |
44 | // returns pointer to actual POI |
43 | Point_t* PointList_GetPOI(void); |
45 | Point_t* PointList_GetPOI(void); |
44 | 46 | ||
45 | 47 | ||
46 | #endif // _WAYPOINTS_H |
48 | #endif // _WAYPOINTS_H |
47 | 49 |