Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mission_fw_nav.c File Reference

mission navigation for fixedwing aircraft More...

#include <stdio.h>
#include "modules/mission/mission_common.h"
#include "firmwares/fixedwing/autopilot.h"
#include "firmwares/fixedwing/nav.h"
#include "subsystems/navigation/common_nav.h"
#include "generated/flight_plan.h"
+ Include dependency graph for mission_fw_nav.c:

Go to the source code of this file.

Functions

bool_t mission_point_of_lla (struct EnuCoor_f *point, struct LlaCoor_f *lla)
 Get the ENU component of LLA mission point This function is firmware specific. More...
 
static bool_t mission_nav_wp (struct _mission_wp *wp)
 Navigation function to a single waypoint. More...
 
static bool_t mission_nav_circle (struct _mission_circle *circle)
 Navigation function on a circle. More...
 
static bool_t mission_nav_segment (struct _mission_segment *segment)
 Navigation function along a segment. More...
 
static bool_t mission_nav_path (struct _mission_path *path)
 Navigation function along a path. More...
 
int mission_run ()
 Run mission. More...
 

Variables

const float dt_navigation = 1.0 / ((float)NAVIGATION_FREQUENCY)
 
struct EnuCoor_f last_wp_f = { 0., 0., 0. }
 

Detailed Description

mission navigation for fixedwing aircraft

Implement specific navigation routines for the mission control of a fixedwing aircraft

Definition in file mission_fw_nav.c.

Function Documentation

static bool_t mission_nav_circle ( struct _mission_circle circle)
inlinestatic

Navigation function on a circle.

Definition at line 83 of file mission_fw_nav.c.

References _mission_circle::center, _mission_circle::center_f, nav_circle_XY(), NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, _mission_circle::radius, TRUE, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

Referenced by mission_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool_t mission_nav_path ( struct _mission_path path)
inlinestatic

Navigation function along a path.

Definition at line 105 of file mission_fw_nav.c.

References CARROT, FALSE, mission_nav_wp(), nav_approaching_xy(), nav_route_xy(), NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, _mission_path::nb, _mission_path::path, _mission_path::path_f, _mission_path::path_idx, TRUE, _mission_wp::wp, _mission_wp::wp_f, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

Referenced by mission_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool_t mission_nav_segment ( struct _mission_segment segment)
inlinestatic

Navigation function along a segment.

Definition at line 92 of file mission_fw_nav.c.

References CARROT, FALSE, _mission_segment::from, _mission_segment::from_f, nav_approaching_xy(), nav_route_xy(), NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, _mission_segment::to, _mission_segment::to_f, TRUE, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

Referenced by mission_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool_t mission_nav_wp ( struct _mission_wp wp)
inlinestatic

Navigation function to a single waypoint.

Definition at line 69 of file mission_fw_nav.c.

References CARROT, FALSE, fly_to_xy(), nav_approaching_xy(), NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, TRUE, _mission_wp::wp, _mission_wp::wp_f, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

Referenced by mission_nav_path(), and mission_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool_t mission_point_of_lla ( struct EnuCoor_f point,
struct LlaCoor_f lla 
)

Get the ENU component of LLA mission point This function is firmware specific.

Parameters
pointpointer to the output ENU point
llapointer to the input LLA coordinate
Returns
TRUE if conversion is succesful, FALSE otherwise

Definition at line 38 of file mission_fw_nav.c.

References LlaCoor_f::alt, UtmCoor_f::east, max_dist_from_home, nav_utm_east0, nav_utm_north0, nav_utm_zone0, UtmCoor_f::north, TRUE, utm_of_lla_f(), waypoints, EnuCoor_f::x, EnuCoor_i::x, EnuCoor_f::y, EnuCoor_i::y, EnuCoor_f::z, and UtmCoor_f::zone.

+ Here is the call graph for this function:

int mission_run ( void  )

Run mission.

This function should be implemented into a dedicated file since navigation functions are different for different firmwares

Currently, this function should be called from the flight plan

Returns
return TRUE when the mission is running, FALSE when it is finished

Definition at line 132 of file mission_fw_nav.c.

References _mission::current_idx, dt_navigation, _mission_element::duration, _mission_element::element, _mission::element_time, FALSE, mission, _mission_element::mission_circle, MISSION_ELEMENT_NB, mission_get(), mission_nav_circle(), mission_nav_path(), mission_nav_segment(), mission_nav_wp(), _mission_element::mission_path, _mission_element::mission_segment, _mission_element::mission_wp, MissionCircle, MissionPath, MissionSegment, MissionWP, TRUE, and _mission_element::type.

+ Here is the call graph for this function:

Variable Documentation

const float dt_navigation = 1.0 / ((float)NAVIGATION_FREQUENCY)

Definition at line 62 of file mission_fw_nav.c.

Referenced by mission_run().

struct EnuCoor_f last_wp_f = { 0., 0., 0. }

Definition at line 65 of file mission_fw_nav.c.