45 #define WaypointX(_wp) (waypoints[_wp].x)
46 #define WaypointY(_wp) (waypoints[_wp].y)
48 #define WaypointAlt(_wp) (waypoints[_wp].a)
49 #define Height(_h) (_h + ground_alt)
73 #define NavSetGroundReferenceHere() ({ nav_reset_reference(); nav_update_waypoints_alt(); false; })
75 #define NavSetAltitudeReferenceHere() ({ nav_reset_alt(); nav_update_waypoints_alt(); false; })
77 #define NavSetWaypointHere(_wp) ({ \
78 waypoints[_wp].x = stateGetPositionEnu_f()->x; \
79 waypoints[_wp].y = stateGetPositionEnu_f()->y; \
83 #define NavSetWaypointPosAndAltHere(_wp) ({ \
84 waypoints[_wp].x = stateGetPositionEnu_f()->x; \
85 waypoints[_wp].y = stateGetPositionEnu_f()->y; \
86 waypoints[_wp].a = stateGetPositionEnu_f()->z + ground_alt; \
void compute_dist2_to_home(void)
Computes squared distance to the HOME waypoint potentially sets too_far_from_home.
const uint8_t nb_waypoint
float dist2_to_home
squared distance to home waypoint
void nav_update_waypoints_alt(void)
Shift altitude of the waypoint according to a new ground altitude.
void nav_reset_reference(void)
Reset the geographic reference to the current GPS fix.
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
void common_nav_periodic_task_4Hz(void)
void nav_reset_alt(void)
Reset the altitude reference to the current GPS alt.
void nav_reset_utm_zone(void)
Reset the UTM zone to current GPS fix.
API to get/set the generic vehicle states.
Common flight_plan functions shared between fixedwing and rotorcraft.
void nav_move_waypoint(uint8_t wp_id, float utm_east, float utm_north, float alt)
Move a waypoint to given UTM coordinates.
float dist2_to_wp
squared distance to next waypoint