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_common.h File Reference

mission planner library More...

#include "std.h"
#include "math/pprz_geodetic_float.h"
#include "math/pprz_geodetic_int.h"
+ Include dependency graph for mission_common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _mission_wp
 
struct  _mission_circle
 
struct  _mission_segment
 
struct  _mission_path
 
struct  _mission_element
 
struct  _mission
 

Macros

#define MISSION_PATH_NB   5
 
#define MISSION_ELEMENT_NB   20
 Max number of elements in the tasks' list can be redefined. More...
 

Enumerations

enum  MissionType {
  MissionWP = 1, MissionCircle = 2, MissionSegment = 3, MissionPath = 4,
  MissionSurvey = 5, MissionEight = 6, MissionOval = 7
}
 
enum  MissionInsertMode { Append, Prepend, ReplaceCurrent, ReplaceAll }
 

Functions

void mission_init (void)
 Init mission structure. More...
 
bool_t mission_insert (enum MissionInsertMode insert, struct _mission_element *element)
 Insert a mission element according to the insertion mode. More...
 
bool_t mission_element_convert (struct _mission_element *el)
 Convert mission element's points format if needed. More...
 
struct _mission_elementmission_get (void)
 Get current mission element. More...
 
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...
 
int mission_run (void)
 Run mission. More...
 
void mission_status_report (void)
 Report mission status. More...
 
int mission_parse_GOTO_WP (void)
 Parsing functions called when a mission message is received. More...
 
int mission_parse_GOTO_WP_LLA (void)
 
int mission_parse_CIRCLE (void)
 
int mission_parse_CIRCLE_LLA (void)
 
int mission_parse_SEGMENT (void)
 
int mission_parse_SEGMENT_LLA (void)
 
int mission_parse_PATH (void)
 
int mission_parse_PATH_LLA (void)
 
int mission_parse_SURVEY (void)
 
int mission_parse_SURVEY_LLA (void)
 
int mission_parse_GOTO_MISSION (void)
 
int mission_parse_NEXT_MISSION (void)
 
int mission_parse_END_MISSION (void)
 

Variables

struct _mission mission
 

Detailed Description

mission planner library

Provide the generic interface for the mission control Handle the parsing of datalink messages

Definition in file mission_common.h.

Macro Definition Documentation

#define MISSION_ELEMENT_NB   20

Max number of elements in the tasks' list can be redefined.

Definition at line 109 of file mission_common.h.

Referenced by mission_insert(), mission_parse_GOTO_MISSION(), mission_parse_NEXT_MISSION(), mission_run(), and mission_status_report().

#define MISSION_PATH_NB   5

Definition at line 82 of file mission_common.h.

Referenced by mission_parse_PATH(), and mission_parse_PATH_LLA().

Enumeration Type Documentation

Enumerator
Append 

add at the last position

Prepend 

add before the current element

ReplaceCurrent 

replace current element

ReplaceAll 

remove all elements and add the new one

Definition at line 47 of file mission_common.h.

Enumerator
MissionWP 
MissionCircle 
MissionSegment 
MissionPath 
MissionSurvey 
MissionEight 
MissionOval 

Definition at line 37 of file mission_common.h.

Function Documentation

struct _mission_element* mission_get ( void  )

Get current mission element.

Returns
return a pointer to the next mission element or NULL if no more elements

Definition at line 89 of file mission_common.c.

References _mission::current_idx, _mission::elements, _mission::insert_idx, and mission.

Referenced by mission_run().

+ Here is the caller graph for this function:

void mission_init ( void  )

Init mission structure.

Definition at line 38 of file mission_common.c.

References _mission::current_idx, _mission::element_time, _mission::insert_idx, and mission.

bool_t mission_insert ( enum MissionInsertMode  insert,
struct _mission_element element 
)

Insert a mission element according to the insertion mode.

Parameters
insertinsertion mode
elementmission element structure
Returns
return TRUE if insertion is succesful, FALSE otherwise

Definition at line 46 of file mission_common.c.

References Append, _mission::current_idx, _mission::elements, FALSE, _mission::insert_idx, mission, mission_element_convert(), MISSION_ELEMENT_NB, Prepend, ReplaceAll, ReplaceCurrent, and TRUE.

Referenced by mission_parse_CIRCLE(), mission_parse_CIRCLE_LLA(), mission_parse_GOTO_WP(), mission_parse_GOTO_WP_LLA(), mission_parse_PATH(), mission_parse_PATH_LLA(), mission_parse_SEGMENT(), and mission_parse_SEGMENT_LLA().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mission_parse_END_MISSION ( void  )

Definition at line 322 of file mission_common.c.

References _mission::current_idx, dl_buffer, FALSE, _mission::insert_idx, mission, and TRUE.

int mission_parse_GOTO_MISSION ( void  )

Definition at line 300 of file mission_common.c.

References _mission::current_idx, dl_buffer, FALSE, mission, MISSION_ELEMENT_NB, and TRUE.

int mission_parse_GOTO_WP ( void  )

Parsing functions called when a mission message is received.

Definition at line 122 of file mission_common.c.

References dl_buffer, _mission_element::duration, _mission_element::element, FALSE, mission_insert(), _mission_element::mission_wp, MissionWP, _mission_element::type, _mission_wp::wp, _mission_wp::wp_f, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

+ Here is the call graph for this function:

int mission_parse_NEXT_MISSION ( void  )
int mission_parse_SURVEY ( void  )
int mission_parse_SURVEY_LLA ( void  )
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, BUFFER_ZONE_DIST, UtmCoor_f::east, ENU_FLOAT_OF_BFP, enu_of_lla_point_f(), FALSE, FLOAT_VECT2_DIFF, FLOAT_VECT2_NORM, FLOAT_VECT2_SMUL, FLOAT_VECT2_SUM, LtpDef_f::hmsl, LtpDef_f::lla, max_dist_from_home, nav_utm_east0, nav_utm_north0, nav_utm_zone0, State::ned_origin_f, UtmCoor_f::north, state, stateIsLocalCoordinateValid(), 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.

Referenced by mission_parse_CIRCLE_LLA(), mission_parse_GOTO_WP_LLA(), mission_parse_PATH_LLA(), and mission_parse_SEGMENT_LLA().

+ Here is the call graph for this function:

+ Here is the caller 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:

void mission_status_report ( void  )

Variable Documentation