31 #include "generated/flight_plan.h"
32 #include "generated/airframe.h"
110 if (j == 0) { task_list[j++] = 0; }
112 float remaining_time = -1.;
128 if (DL_MISSION_GOTO_WP_ac_id(
dl_buffer) != AC_ID) {
return false; }
144 if (DL_MISSION_GOTO_WP_LLA_ac_id(
dl_buffer) != AC_ID) {
return false; }
164 if (DL_MISSION_CIRCLE_ac_id(
dl_buffer) != AC_ID) {
return false; }
168 me.
element.mission_circle.center.center_f.x = DL_MISSION_CIRCLE_center_east(
dl_buffer);
169 me.
element.mission_circle.center.center_f.y = DL_MISSION_CIRCLE_center_north(
dl_buffer);
170 me.
element.mission_circle.center.center_f.z = DL_MISSION_CIRCLE_center_alt(
dl_buffer);
181 if (DL_MISSION_CIRCLE_LLA_ac_id(
dl_buffer) != AC_ID) {
return false; }
202 if (DL_MISSION_SEGMENT_ac_id(
dl_buffer) != AC_ID) {
return false; }
206 me.
element.mission_segment.from.from_f.x = DL_MISSION_SEGMENT_segment_east_1(
dl_buffer);
207 me.
element.mission_segment.from.from_f.y = DL_MISSION_SEGMENT_segment_north_1(
dl_buffer);
208 me.
element.mission_segment.from.from_f.z = DL_MISSION_SEGMENT_segment_alt(
dl_buffer);
209 me.
element.mission_segment.to.to_f.x = DL_MISSION_SEGMENT_segment_east_2(
dl_buffer);
210 me.
element.mission_segment.to.to_f.y = DL_MISSION_SEGMENT_segment_north_2(
dl_buffer);
211 me.
element.mission_segment.to.to_f.z = DL_MISSION_SEGMENT_segment_alt(
dl_buffer);
221 if (DL_MISSION_SEGMENT_LLA_ac_id(
dl_buffer) != AC_ID) {
return false; }
224 from_lla.
lat = DL_MISSION_SEGMENT_LLA_segment_lat_1(
dl_buffer);
225 from_lla.
lon = DL_MISSION_SEGMENT_LLA_segment_lon_1(
dl_buffer);
226 from_lla.
alt = DL_MISSION_SEGMENT_LLA_segment_alt(
dl_buffer);
227 to_lla.
lat = DL_MISSION_SEGMENT_LLA_segment_lat_2(
dl_buffer);
228 to_lla.
lon = DL_MISSION_SEGMENT_LLA_segment_lon_2(
dl_buffer);
229 to_lla.
alt = DL_MISSION_SEGMENT_LLA_segment_alt(
dl_buffer);
245 if (DL_MISSION_PATH_ac_id(
dl_buffer) != AC_ID) {
return false; }
249 me.
element.mission_path.path.path_f[0].x = DL_MISSION_PATH_point_east_1(
dl_buffer);
250 me.
element.mission_path.path.path_f[0].y = DL_MISSION_PATH_point_north_1(
dl_buffer);
251 me.
element.mission_path.path.path_f[0].z = DL_MISSION_PATH_path_alt(
dl_buffer);
252 me.
element.mission_path.path.path_f[1].x = DL_MISSION_PATH_point_east_2(
dl_buffer);
253 me.
element.mission_path.path.path_f[1].y = DL_MISSION_PATH_point_north_2(
dl_buffer);
254 me.
element.mission_path.path.path_f[1].z = DL_MISSION_PATH_path_alt(
dl_buffer);
255 me.
element.mission_path.path.path_f[2].x = DL_MISSION_PATH_point_east_3(
dl_buffer);
256 me.
element.mission_path.path.path_f[2].y = DL_MISSION_PATH_point_north_3(
dl_buffer);
257 me.
element.mission_path.path.path_f[2].z = DL_MISSION_PATH_path_alt(
dl_buffer);
258 me.
element.mission_path.path.path_f[3].x = DL_MISSION_PATH_point_east_4(
dl_buffer);
259 me.
element.mission_path.path.path_f[3].y = DL_MISSION_PATH_point_north_4(
dl_buffer);
260 me.
element.mission_path.path.path_f[3].z = DL_MISSION_PATH_path_alt(
dl_buffer);
261 me.
element.mission_path.path.path_f[4].x = DL_MISSION_PATH_point_east_5(
dl_buffer);
262 me.
element.mission_path.path.path_f[4].y = DL_MISSION_PATH_point_north_5(
dl_buffer);
263 me.
element.mission_path.path.path_f[4].z = DL_MISSION_PATH_path_alt(
dl_buffer);
266 me.
element.mission_path.path_idx = 0;
276 if (DL_MISSION_PATH_LLA_ac_id(
dl_buffer) != AC_ID) {
return false; }
279 lla[0].
lat = DL_MISSION_PATH_LLA_point_lat_1(
dl_buffer);
280 lla[0].
lon = DL_MISSION_PATH_LLA_point_lon_1(
dl_buffer);
282 lla[1].
lat = DL_MISSION_PATH_LLA_point_lat_2(
dl_buffer);
283 lla[1].
lon = DL_MISSION_PATH_LLA_point_lon_2(
dl_buffer);
285 lla[2].
lat = DL_MISSION_PATH_LLA_point_lat_3(
dl_buffer);
286 lla[2].
lon = DL_MISSION_PATH_LLA_point_lon_3(
dl_buffer);
288 lla[3].
lat = DL_MISSION_PATH_LLA_point_lat_4(
dl_buffer);
289 lla[3].
lon = DL_MISSION_PATH_LLA_point_lon_4(
dl_buffer);
291 lla[4].
lat = DL_MISSION_PATH_LLA_point_lat_5(
dl_buffer);
292 lla[4].
lon = DL_MISSION_PATH_LLA_point_lon_5(
dl_buffer);
300 for (i = 0; i < me.
element.mission_path.nb; i++) {
304 me.
element.mission_path.path_idx = 0;
314 if (DL_GOTO_MISSION_ac_id(
dl_buffer) != AC_ID) {
return false; }
319 }
else {
return false; }
326 if (DL_NEXT_MISSION_ac_id(
dl_buffer) != AC_ID) {
return false; }
337 if (DL_END_MISSION_ac_id(
dl_buffer) != AC_ID) {
return false; }
int mission_parse_NEXT_MISSION(void)
int mission_parse_SEGMENT(void)
struct _mission_element * mission_get(void)
Get current mission element.
Handling of messages coming from ground and other A/Cs.
void mission_init(void)
Init mission structure.
bool mission_insert(enum MissionInsertMode insert, struct _mission_element *element)
Insert a mission element according to the insertion mode.
bool mission_element_convert(struct _mission_element *el)
Convert mission element's points format if needed.
void mission_status_report(void)
Report mission status.
remove all elements and add the new one
float duration
time to spend in the element (<= 0 to disable)
add before the current element
vector in Latitude, Longitude and Altitude
int mission_parse_GOTO_WP(void)
Parsing functions called when a mission message is received.
int mission_parse_CIRCLE(void)
int32_t alt
in millimeters above WGS84 reference ellipsoid
float element_time
time in second spend in the current element
int mission_parse_GOTO_WP_LLA(void)
#define MISSION_ELEMENT_NB
Max number of elements in the tasks' list can be redefined.
union _mission_element::@287 element
int mission_parse_PATH(void)
int32_t lon
in degrees*1e7
uint8_t insert_idx
inserstion index
#define DefaultChannel
SITL.
int mission_parse_SEGMENT_LLA(void)
int mission_parse_GOTO_MISSION(void)
uint8_t current_idx
current mission element index
Common code for AP and FBW telemetry.
uint8_t dl_buffer[MSG_SIZE]
struct _mission_element elements[MISSION_ELEMENT_NB]
bool mission_point_of_lla(struct EnuCoor_f *point, struct LlaCoor_i *lla)
Get the ENU component of LLA mission point This function is firmware specific.
int32_t lat
in degrees*1e7
int mission_parse_PATH_LLA(void)
int mission_parse_CIRCLE_LLA(void)
int mission_parse_END_MISSION(void)