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)
77 #define NavSetGroundReferenceHere() ({ nav_reset_reference(); nav_update_waypoints_alt(); false; })
79 #define NavSetAltitudeReferenceHere() ({ nav_reset_alt(); nav_update_waypoints_alt(); false; })
81 #define NavSetWaypointHere(_wp) ({ \
82 waypoints[_wp].x = stateGetPositionEnu_f()->x; \
83 waypoints[_wp].y = stateGetPositionEnu_f()->y; \
87 #define NavSetWaypointPosAndAltHere(_wp) ({ \
88 waypoints[_wp].x = stateGetPositionEnu_f()->x; \
89 waypoints[_wp].y = stateGetPositionEnu_f()->y; \
90 waypoints[_wp].a = stateGetPositionEnu_f()->z + ground_alt; \
Common flight_plan functions shared between fixedwing and rotorcraft.
float get_time_to_home(void)
Compute time to home use wind and airspeed when available.
void nav_reset_reference(void)
Reset the geographic reference to the current GPS fix.
void nav_send_waypoint(uint8_t wp_id)
Send a waypoint throught default telemetry channel.
void nav_reset_alt(void)
Reset the altitude reference to the current GPS alt.
void nav_move_waypoint(uint8_t wp_id, float utm_east, float utm_north, float alt)
Move a waypoint to given UTM coordinates.
void compute_dist2_to_home(void)
Computes squared distance to the HOME waypoint potentially sets too_far_from_home.
void nav_move_waypoint_point(uint8_t wp_id, struct point *p)
Move a waypoint from point structure (local frame).
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
void nav_move_waypoint_enu(uint8_t wp_id, float x, float y, float alt)
Move a waypoint in local frame.
void nav_reset_utm_zone(void)
Reset the UTM zone to current GPS fix.
const uint8_t nb_waypoint
void common_nav_periodic_task(void)
void nav_update_waypoints_alt(void)
Shift altitude of the waypoint according to a new ground altitude.
API to get/set the generic vehicle states.
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.