45 #define WaypointX(_wp) (waypoints[_wp].x)
46 #define WaypointY(_wp) (waypoints[_wp].y)
47 #define WaypointAlt(_wp) (waypoints[_wp].a)
48 #define Height(_h) (_h + ground_alt)
71 #define NavSetGroundReferenceHere() ({ nav_reset_reference(); nav_update_waypoints_alt(); FALSE; })
73 #define NavSetAltitudeReferenceHere() ({ nav_reset_alt(); nav_update_waypoints_alt(); FALSE; })
75 #define NavSetWaypointHere(_wp) ({ \
76 waypoints[_wp].x = stateGetPositionEnu_f()->x; \
77 waypoints[_wp].y = stateGetPositionEnu_f()->y; \
81 #define NavSetWaypointPosAndAltHere(_wp) ({ \
82 waypoints[_wp].x = stateGetPositionEnu_f()->x; \
83 waypoints[_wp].y = stateGetPositionEnu_f()->y; \
84 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
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
void common_nav_periodic_task_4Hz(void)
unit_t nav_reset_utm_zone(void)
Reset the UTM zone to current GPS fix.
unit_t nav_reset_alt(void)
Reset the altitude reference to the current GPS alt.
unit_t nav_reset_reference(void)
Reset the geographic reference to the 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
unit_t nav_update_waypoints_alt(void)
Shift altitude of the waypoint according to a new ground altitude.