mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
MoveWaypoint() moved from nav to common_nav
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "std.h"
|
||||
|
||||
extern float max_dist_from_home;
|
||||
extern float dist2_to_home;
|
||||
extern float dist2_to_wp;
|
||||
extern bool_t too_far_from_home;
|
||||
@@ -17,6 +18,16 @@ struct point {
|
||||
#define WaypointY(_wp) (waypoints[_wp].y)
|
||||
#define WaypointAlt(_wp) (waypoints[_wp].a)
|
||||
|
||||
#define MoveWaypoint(_id, _ux, _uy, _a) { \
|
||||
if (_id < nb_waypoint) { \
|
||||
waypoints[_id].x = _ux - nav_utm_east0; \
|
||||
waypoints[_id].y = _uy - nav_utm_north0; \
|
||||
BoundAbs(waypoints[_id].x, max_dist_from_home); \
|
||||
BoundAbs(waypoints[_id].y, max_dist_from_home); \
|
||||
waypoints[_id].a = _a; \
|
||||
} \
|
||||
}
|
||||
|
||||
extern const uint8_t nb_waypoint;
|
||||
extern struct point waypoints[];
|
||||
/** size == nb_waypoint, waypoint 0 is a dummy waypoint */
|
||||
|
||||
@@ -66,16 +66,6 @@ extern uint8_t horizontal_mode;
|
||||
#define HORIZONTAL_MODE_ROUTE 1
|
||||
#define HORIZONTAL_MODE_CIRCLE 2
|
||||
|
||||
#define MoveWaypoint(_id, _ux, _uy, _a) { \
|
||||
if (_id < nb_waypoint) { \
|
||||
waypoints[_id].x = _ux - nav_utm_east0; \
|
||||
waypoints[_id].y = _uy - nav_utm_north0; \
|
||||
Bound(waypoints[_id].x, -MAX_DIST_FROM_HOME, MAX_DIST_FROM_HOME); \
|
||||
Bound(waypoints[_id].y, -MAX_DIST_FROM_HOME, MAX_DIST_FROM_HOME); \
|
||||
waypoints[_id].a = _a; \
|
||||
} \
|
||||
}
|
||||
|
||||
extern void nav_eight_init( void );
|
||||
extern void nav_eight(uint8_t, uint8_t, float);
|
||||
#define Eight(a, b, c) nav_eight((a), (b), (c))
|
||||
|
||||
Reference in New Issue
Block a user