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
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
30 #ifndef MISSION_COMMON_H
31 #define MISSION_COMMON_H
32 
33 #include "std.h"
35 #include "math/pprz_geodetic_int.h"
36 
38  MissionWP = 1,
45 };
46 
52 };
53 
54 struct _mission_wp {
55  union{
56  struct EnuCoor_f wp_f;
57  struct EnuCoor_i wp_i;
58  } wp;
59 };
60 
62  union{
65  } center;
66 
67  float radius;
68 };
69 
71  union{
72  struct EnuCoor_f from_f;
73  struct EnuCoor_i from_i;
74  } from;
75 
76  union{
77  struct EnuCoor_f to_f;
78  struct EnuCoor_i to_i;
79  } to;
80 };
81 
82 #define MISSION_PATH_NB 5
83 struct _mission_path {
84  union{
87  } path;
88 
91 };
92 
95  union {
100  } element;
101 
102  float duration;
103 };
104 
108 #ifndef MISSION_ELEMENT_NB
109 #define MISSION_ELEMENT_NB 20
110 #endif
111 
112 struct _mission {
114  float element_time;
117 };
118 
119 extern struct _mission mission;
120 
123 extern void mission_init(void);
124 
130 extern bool_t mission_insert(enum MissionInsertMode insert, struct _mission_element * element);
131 
136 extern bool_t mission_element_convert(struct _mission_element * el);
137 
141 extern struct _mission_element * mission_get(void);
142 
149 extern bool_t mission_point_of_lla(struct EnuCoor_f *point, struct LlaCoor_f *lla);
150 
160 extern int mission_run(void);
161 
166 extern void mission_status_report(void);
167 
170 extern int mission_parse_GOTO_WP(void);
171 extern int mission_parse_GOTO_WP_LLA(void);
172 extern int mission_parse_CIRCLE(void);
173 extern int mission_parse_CIRCLE_LLA(void);
174 extern int mission_parse_SEGMENT(void);
175 extern int mission_parse_SEGMENT_LLA(void);
176 extern int mission_parse_PATH(void);
177 extern int mission_parse_PATH_LLA(void);
178 extern int mission_parse_SURVEY(void);
179 extern int mission_parse_SURVEY_LLA(void);
180 extern int mission_parse_GOTO_MISSION(void);
181 extern int mission_parse_NEXT_MISSION(void);
182 extern int mission_parse_END_MISSION(void);
183 
184 #endif // MISSION_COMMON_H
185 
int mission_parse_CIRCLE_LLA(void)
struct EnuCoor_f path_f[MISSION_PATH_NB]
int mission_parse_NEXT_MISSION(void)
int mission_parse_SEGMENT_LLA(void)
int mission_parse_SURVEY_LLA(void)
enum MissionType type
int mission_parse_GOTO_WP(void)
Parsing functions called when a mission message is received.
union _mission_path::@17 path
struct EnuCoor_f from_f
MissionType
union _mission_wp::@13 wp
MissionInsertMode
uint8_t current_idx
current mission element index
remove all elements and add the new one
struct _mission_wp mission_wp
union _mission_circle::@14 center
add before the current element
int mission_parse_PATH(void)
replace current element
vector in Latitude, Longitude and Altitude
struct _mission_segment mission_segment
void mission_init(void)
Init mission structure.
uint8_t insert_idx
inserstion index
int mission_parse_PATH_LLA(void)
void mission_status_report(void)
Report mission status.
int mission_parse_GOTO_WP_LLA(void)
Paparazzi floating point math for geodetic calculations.
struct _mission_element * mission_get(void)
Get current mission element.
struct EnuCoor_i to_i
struct EnuCoor_i center_i
#define MISSION_ELEMENT_NB
Max number of elements in the tasks' list can be redefined.
struct EnuCoor_i wp_i
union _mission_segment::@15 from
add at the last position
struct _mission_path mission_path
struct _mission_circle mission_circle
Paparazzi fixed point math for geodetic calculations.
float element_time
time in second spend in the current element
uint8_t path_idx
bool_t mission_element_convert(struct _mission_element *el)
Convert mission element's points format if needed.
bool_t mission_insert(enum MissionInsertMode insert, struct _mission_element *element)
Insert a mission element according to the insertion mode.
struct EnuCoor_i from_i
unsigned char uint8_t
Definition: types.h:14
struct EnuCoor_i path_i[MISSION_PATH_NB]
int mission_parse_END_MISSION(void)
#define MISSION_PATH_NB
int mission_parse_CIRCLE(void)
int mission_parse_GOTO_MISSION(void)
int mission_run(void)
Run mission.
int mission_parse_SURVEY(void)
union _mission_segment::@16 to
struct EnuCoor_f to_f
vector in East North Up coordinates Units: meters
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.
struct EnuCoor_f wp_f
union _mission_element::@18 element
struct EnuCoor_f center_f
struct _mission_element elements[MISSION_ELEMENT_NB]
struct _mission mission
vector in East North Up coordinates
int mission_parse_SEGMENT(void)
float duration
time to spend in the element (<= 0 to disable)