Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
nav_takeoff_and_landing_fw.c File Reference
#include "modules/nav/nav_takeoff_and_landing.h"
#include "math/pprz_geodetic_float.h"
#include "generated/flight_plan.h"
#include "firmwares/fixedwing/nav.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "autopilot.h"
+ Include dependency graph for nav_takeoff_and_landing_fw.c:

Go to the source code of this file.

Macros

#define NAV_TAKEOFF_PITCH   15.f
 
#define NAV_TAKEOFF_THROTTLE   1.f
 
#define NAV_TAKEOFF_HEIGHT   20.f
 
#define NAV_TAKEOFF_DIST   200.f
 
#define NAV_TAKEOFF_AUTO_LAUNCH   true
 
#define NAV_LANDING_DESCEND_SPEED   -1.f
 
#define NAV_LANDING_AF_HEIGHT   30.f
 
#define NAV_LANDING_FLARE_HEIGHT   10.f
 

Functions

static bool nav_takeoff_run (void)
 
static bool nav_land_run (void)
 
void nav_takeoff_and_landing_init (void)
 Init function. More...
 
void nav_takeoff_and_landing_periodic (void)
 Periodic timeout check function. More...
 
bool nav_takeoff_from_wp (uint8_t wp_id)
 Takeoff from a waypoint. More...
 
bool nav_takeoff_from_loc (float lat, float lon)
 Takeoff from lat long location. More...
 
bool nav_takeoff_from_here (void)
 Takeoff from current location. More...
 
bool nav_land_at_wp (uint8_t td_id, uint8_t af_id, float radius)
 Land at waypoint location. More...
 
bool nav_land_at_loc (float td_alt, float lat, float lon, float dir, float dist, float radius)
 Land at lat long location. More...
 
bool nav_land_here (float td_alt, float radius)
 Land at current location. More...
 

Variables

static struct nav_takeoff takeoff
 
static struct nav_landing landing
 
float nav_takeoff_direction
 Takeoff direction in range [0-360] (deg) set to flight plan QFU by default. More...
 

Detailed Description

Author
Gautier Hattenberger gauti.nosp@m.er.h.nosp@m.atten.nosp@m.berg.nosp@m.er@en.nosp@m.ac.f.nosp@m.r Navigation routines for takeoff and landing Basic procedures for fixed-wing

Definition in file nav_takeoff_and_landing_fw.c.

Macro Definition Documentation

◆ NAV_LANDING_AF_HEIGHT

#define NAV_LANDING_AF_HEIGHT   30.f

Definition at line 59 of file nav_takeoff_and_landing_fw.c.

◆ NAV_LANDING_DESCEND_SPEED

#define NAV_LANDING_DESCEND_SPEED   -1.f

Definition at line 55 of file nav_takeoff_and_landing_fw.c.

◆ NAV_LANDING_FLARE_HEIGHT

#define NAV_LANDING_FLARE_HEIGHT   10.f

Definition at line 63 of file nav_takeoff_and_landing_fw.c.

◆ NAV_TAKEOFF_AUTO_LAUNCH

#define NAV_TAKEOFF_AUTO_LAUNCH   true

Definition at line 51 of file nav_takeoff_and_landing_fw.c.

◆ NAV_TAKEOFF_DIST

#define NAV_TAKEOFF_DIST   200.f

Definition at line 47 of file nav_takeoff_and_landing_fw.c.

◆ NAV_TAKEOFF_HEIGHT

#define NAV_TAKEOFF_HEIGHT   20.f

Definition at line 43 of file nav_takeoff_and_landing_fw.c.

◆ NAV_TAKEOFF_PITCH

#define NAV_TAKEOFF_PITCH   15.f

Definition at line 35 of file nav_takeoff_and_landing_fw.c.

◆ NAV_TAKEOFF_THROTTLE

#define NAV_TAKEOFF_THROTTLE   1.f

Definition at line 39 of file nav_takeoff_and_landing_fw.c.

Function Documentation

◆ nav_land_at_loc()

bool nav_land_at_loc ( float  td_alt,
float  lat,
float  lon,
float  dir,
float  dist,
float  radius 
)

Land at lat long location.

Parameters
[in]td_alttouch down altitude above ground ref (m)
[in]latlanding latitude (deg)
[in]lonlanding longitude (deg)
[in]dirdirection approach direction ([0-360], deg)
[in]distdistance to start descent (m)
[in]radiuscircle radius for final turn (if positive: turn right, if negative: turn left) (m)
Returns
true until procedure is completed

Definition at line 343 of file nav_takeoff_and_landing_fw.c.

References nav_landing::af_id, nav_landing::af_pos, dir, ENU_OF_UTM_DIFF, GetAltRef, landing, LlaCoor_f::lat, LlaCoor_f::lon, nav_land_run(), NAV_LANDING_AF_HEIGHT, NAV_LANDING_INIT, nav_landing::radius, state, nav_landing::status, nav_landing::td_id, nav_landing::td_pos, utm_of_lla_f(), State::utm_origin_f, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

+ Here is the call graph for this function:

◆ nav_land_at_wp()

bool nav_land_at_wp ( uint8_t  td_id,
uint8_t  af_id,
float  radius 
)

Land at waypoint location.

set touch down (TD) and start of descent (AF)

  • rotorcraft: if TD and AF id are the same, vertical landing
Parameters
[in]td_idwaypoint ID for touch down point
[in]af_ifwaypoint ID for start of descent
[in]radiuscircle radius for final turn (if positive: turn right, if negative: turn left) (m)
Returns
true until procedure is completed

Definition at line 326 of file nav_takeoff_and_landing_fw.c.

References nav_landing::af_id, nav_landing::af_pos, GetAltRef, landing, nav_land_run(), NAV_LANDING_AF_HEIGHT, NAV_LANDING_INIT, nav_landing::radius, nav_landing::status, nav_landing::td_id, nav_landing::td_pos, WaypointAlt, WaypointX, WaypointY, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

+ Here is the call graph for this function:

◆ nav_land_here()

bool nav_land_here ( float  td_alt,
float  radius 
)

Land at current location.

emergency landing

  • fixedwing: circle down around current location
  • rotorcraft: vertical landing at current location
Parameters
[in]td_alttouch down altitude above ground ref (m)
[in]radiuscircle radius for final turn (if positive: turn right, if negative: turn left) (m)
Returns
true until procedure is completed

Definition at line 361 of file nav_takeoff_and_landing_fw.c.

References nav_landing::af_id, nav_landing::af_pos, landing, nav_land_run(), NAV_LANDING_AF_HEIGHT, NAV_LANDING_INIT, nav_landing::radius, stateGetPositionEnu_f(), nav_landing::status, nav_landing::td_id, nav_landing::td_pos, and EnuCoor_f::z.

+ Here is the call graph for this function:

◆ nav_land_run()

◆ nav_takeoff_and_landing_init()

void nav_takeoff_and_landing_init ( void  )

Init function.

Definition at line 117 of file nav_takeoff_and_landing_fw.c.

◆ nav_takeoff_and_landing_periodic()

void nav_takeoff_and_landing_periodic ( void  )

Periodic timeout check function.

Definition at line 135 of file nav_takeoff_and_landing_fw.c.

◆ nav_takeoff_from_here()

bool nav_takeoff_from_here ( void  )

Takeoff from current location.

  • fixedwing: climb direction is specified with setting
  • rotorcraft: start from current location and climb verticaly
Returns
true until procedure is completed

Definition at line 215 of file nav_takeoff_and_landing_fw.c.

Referenced by nav_takeoff_from_loc().

+ Here is the caller graph for this function:

◆ nav_takeoff_from_loc()

bool nav_takeoff_from_loc ( float  lat,
float  lon 
)

Takeoff from lat long location.

  • fixedwing: set the climb direction
  • rotorcraft: start from current location and climb verticaly (lat, lon have no effect)
Parameters
[in]lattakeoff latitude (deg)
[in]lontakeoff longitude (deg)
Returns
true until procedure is completed

Definition at line 204 of file nav_takeoff_and_landing_fw.c.

References LlaCoor_f::alt, nav_takeoff::climb_pos, ENU_OF_UTM_DIFF, LlaCoor_f::lat, LlaCoor_f::lon, nav_takeoff_from_here(), NAV_TAKEOFF_HEIGHT, NAV_TAKEOFF_INIT, state, stateGetPositionLla_f(), nav_takeoff::status, takeoff, utm_of_lla_f(), and State::utm_origin_f.

+ Here is the call graph for this function:

◆ nav_takeoff_from_wp()

bool nav_takeoff_from_wp ( uint8_t  wp_id)

Takeoff from a waypoint.

  • fixedwing: set the climb direction
  • rotorcraft: set the wp at current location and climb verticaly
Parameters
[in]wp_idwaypoint ID
Returns
true until procedure is completed

Definition at line 191 of file nav_takeoff_and_landing_fw.c.

◆ nav_takeoff_run()

Variable Documentation

◆ landing

◆ nav_takeoff_direction

float nav_takeoff_direction

Takeoff direction in range [0-360] (deg) set to flight plan QFU by default.

Definition at line 72 of file nav_takeoff_and_landing_fw.c.

Referenced by nav_takeoff_and_landing_init(), and nav_takeoff_from_here().

◆ takeoff