29 #include "generated/flight_plan.h"
34 #ifndef NAV_TAKEOFF_PITCH
35 #define NAV_TAKEOFF_PITCH 15.f
38 #ifndef NAV_TAKEOFF_THROTTLE
39 #define NAV_TAKEOFF_THROTTLE 1.f
42 #ifndef NAV_TAKEOFF_HEIGHT
43 #define NAV_TAKEOFF_HEIGHT 20.f
46 #ifndef NAV_TAKEOFF_DIST
47 #define NAV_TAKEOFF_DIST 200.f
50 #ifndef NAV_TAKEOFF_AUTO_LAUNCH
51 #define NAV_TAKEOFF_AUTO_LAUNCH true
54 #ifndef NAV_LANDING_DESCEND_SPEED
55 #define NAV_LANDING_DESCEND_SPEED -1.f
58 #ifndef NAV_LANDING_AF_HEIGHT
59 #define NAV_LANDING_AF_HEIGHT 30.f
62 #ifndef NAV_LANDING_FLARE_HEIGHT
63 #define NAV_LANDING_FLARE_HEIGHT 10.f
92 float td_alt = params[0];
102 float td_alt = params[0];
103 float lat = params[1];
104 float lon = params[2];
105 float dir = params[3];
106 float dist = params[4];
150 static int start_motor_counter = 0;
155 start_motor_counter = 0;
159 start_motor_counter++;
161 start_motor_counter = 0;
163 #if NAV_TAKEOFF_AUTO_LAUNCH
238 float dist = sqrtf(dx*dx + dy*dy);
bool autopilot_set_motors_on(bool motors_on)
turn motors on/off, eventually depending of the current mode set kill_throttle accordingly FIXME is i...
struct pprz_autopilot autopilot
Global autopilot structure.
bool autopilot_get_motors_on(void)
get motors status
Core autopilot interface common to all firmwares.
bool launch
request launch
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
#define WaypointAlt(_wp)
waypoint altitude in m above MSL
Vertical control for fixed wing vehicles.
#define ENU_OF_UTM_DIFF(_pos, _utm1, _utm2)
static struct UtmCoor_f * stateGetUtmOrigin_f(void)
Get the coordinate UTM frame origin (int)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
bool mission_register(mission_custom_cb cb, char *type)
Register a new navigation or action callback function.
bool nav_approaching_xy(float x, float y, float from_x, float from_y, float approaching_time)
Decide if the UAV is approaching the current waypoint.
float nav_circle_trigo_qdr
void nav_glide_alt(float start_alt, float final_alt)
void nav_route_xy(float last_wp_x, float last_wp_y, float wp_x, float wp_y)
Computes the carrot position along the desired segment.
Fixedwing Navigation library.
#define GetPosAlt()
Get current altitude above MSL.
#define NavGotoPoint(_point)
#define GetAltRef()
Get current altitude reference for local coordinates.
#define NavVerticalClimbMode(_climb)
Set the vertical mode to climb control with the specified climb setpoint.
#define NavCircleWaypoint(wp, radius)
#define NavVerticalThrottleMode(_throttle)
Set the vertical mode to fixed throttle with the specified setpoint.
#define NAVIGATION_FREQUENCY
Default fixedwing navigation frequency.
#define NavVerticalAltitudeMode(_alt, _pre_climb)
Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command.
#define NavVerticalAutoThrottleMode(_pitch)
Set the climb control to auto-throttle with the specified pitch pre-command.
#define CloseRadAngles(_c1, _c2)
enum nav_takeoff_status status
current step
uint8_t td_id
touch down wp id
enum nav_landing_status status
current step
struct EnuCoor_f af_pos
start of descent point
float radius
circle radius for fixedwing landing
bool timeout
true if status should be set to init
struct EnuCoor_f td_pos
touch down point
uint8_t af_id
start of descent wp id
bool timeout
true if status should be set to init
struct EnuCoor_f start_pos
start position
uint8_t climb_id
climb waypoint id
struct EnuCoor_f climb_pos
climb point
@ NAV_TAKEOFF_START_MOTOR
bool nav_takeoff_from_wp(uint8_t wp_id)
Takeoff from a waypoint.
#define NAV_LANDING_DESCEND_SPEED
#define NAV_LANDING_FLARE_HEIGHT
bool nav_land_at_loc(float td_alt, float lat, float lon, float dir, float dist, float radius)
Land at lat long location.
static struct nav_landing landing
static bool nav_land_run(void)
static bool nav_takeoff_run(void)
float nav_takeoff_direction
Takeoff direction in range [0-360] (deg) set to flight plan QFU by default.
bool nav_land_at_wp(uint8_t td_id, uint8_t af_id, float radius)
Land at waypoint location.
void nav_takeoff_and_landing_init(void)
Init function.
bool nav_takeoff_from_loc(float lat, float lon)
Takeoff from lat long location.
#define NAV_TAKEOFF_PITCH
bool nav_takeoff_from_here(void)
Takeoff from current location.
static struct nav_takeoff takeoff
void nav_takeoff_and_landing_periodic(void)
Periodic timeout check function.
bool nav_land_here(float td_alt, float radius)
Land at current location.
#define NAV_TAKEOFF_HEIGHT
#define NAV_LANDING_AF_HEIGHT
#define NAV_TAKEOFF_THROTTLE
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
Paparazzi floating point math for geodetic calculations.
float alt
in meters (normally above WGS84 reference ellipsoid)
vector in Latitude, Longitude and Altitude
position in UTM coordinates Units: meters
#define CARROT
default approaching_time for a wp
#define NormCourseRad(x)
Normalize a rad angle between 0 and 2*PI.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.