30 #include "generated/flight_plan.h"
31 #include "generated/airframe.h"
149 if (j == 0) { index_list[j++] = 0; }
151 float remaining_time = -1.;
167 if (DL_MISSION_GOTO_WP_ac_id(buf) != AC_ID) {
return false; }
171 me.
element.mission_wp.wp.wp_f.x = DL_MISSION_GOTO_WP_wp_east(buf);
172 me.
element.mission_wp.wp.wp_f.y = DL_MISSION_GOTO_WP_wp_north(buf);
173 me.
element.mission_wp.wp.wp_f.z = DL_MISSION_GOTO_WP_wp_alt(buf);
174 me.
duration = DL_MISSION_GOTO_WP_duration(buf);
175 me.
index = DL_MISSION_GOTO_WP_index(buf);
184 if (DL_MISSION_GOTO_WP_LLA_ac_id(buf) != AC_ID) {
return false; }
187 lla.
lat = DL_MISSION_GOTO_WP_LLA_wp_lat(buf);
188 lla.
lon = DL_MISSION_GOTO_WP_LLA_wp_lon(buf);
189 lla.
alt = DL_MISSION_GOTO_WP_LLA_wp_alt(buf);
195 me.
duration = DL_MISSION_GOTO_WP_LLA_duration(buf);
196 me.
index = DL_MISSION_GOTO_WP_LLA_index(buf);
205 if (DL_MISSION_CIRCLE_ac_id(buf) != AC_ID) {
return false; }
209 me.
element.mission_circle.center.center_f.x = DL_MISSION_CIRCLE_center_east(buf);
210 me.
element.mission_circle.center.center_f.y = DL_MISSION_CIRCLE_center_north(buf);
211 me.
element.mission_circle.center.center_f.z = DL_MISSION_CIRCLE_center_alt(buf);
212 me.
element.mission_circle.radius = DL_MISSION_CIRCLE_radius(buf);
213 me.
duration = DL_MISSION_CIRCLE_duration(buf);
214 me.
index = DL_MISSION_CIRCLE_index(buf);
223 if (DL_MISSION_CIRCLE_LLA_ac_id(buf) != AC_ID) {
return false; }
226 lla.
lat = DL_MISSION_CIRCLE_LLA_center_lat(buf);
227 lla.
lon = DL_MISSION_CIRCLE_LLA_center_lon(buf);
228 lla.
alt = DL_MISSION_CIRCLE_LLA_center_alt(buf);
234 me.
element.mission_circle.radius = DL_MISSION_CIRCLE_LLA_radius(buf);
235 me.
duration = DL_MISSION_CIRCLE_LLA_duration(buf);
236 me.
index = DL_MISSION_CIRCLE_LLA_index(buf);
245 if (DL_MISSION_SEGMENT_ac_id(buf) != AC_ID) {
return false; }
249 me.
element.mission_segment.from.from_f.x = DL_MISSION_SEGMENT_segment_east_1(buf);
250 me.
element.mission_segment.from.from_f.y = DL_MISSION_SEGMENT_segment_north_1(buf);
251 me.
element.mission_segment.from.from_f.z = DL_MISSION_SEGMENT_segment_alt(buf);
252 me.
element.mission_segment.to.to_f.x = DL_MISSION_SEGMENT_segment_east_2(buf);
253 me.
element.mission_segment.to.to_f.y = DL_MISSION_SEGMENT_segment_north_2(buf);
254 me.
element.mission_segment.to.to_f.z = DL_MISSION_SEGMENT_segment_alt(buf);
255 me.
duration = DL_MISSION_SEGMENT_duration(buf);
256 me.
index = DL_MISSION_SEGMENT_index(buf);
265 if (DL_MISSION_SEGMENT_LLA_ac_id(buf) != AC_ID) {
return false; }
268 from_lla.
lat = DL_MISSION_SEGMENT_LLA_segment_lat_1(buf);
269 from_lla.
lon = DL_MISSION_SEGMENT_LLA_segment_lon_1(buf);
270 from_lla.
alt = DL_MISSION_SEGMENT_LLA_segment_alt(buf);
271 to_lla.
lat = DL_MISSION_SEGMENT_LLA_segment_lat_2(buf);
272 to_lla.
lon = DL_MISSION_SEGMENT_LLA_segment_lon_2(buf);
273 to_lla.
alt = DL_MISSION_SEGMENT_LLA_segment_alt(buf);
280 me.
duration = DL_MISSION_SEGMENT_LLA_duration(buf);
281 me.
index = DL_MISSION_SEGMENT_LLA_index(buf);
290 if (DL_MISSION_PATH_ac_id(buf) != AC_ID) {
return false; }
294 me.
element.mission_path.path.path_f[0].x = DL_MISSION_PATH_point_east_1(buf);
295 me.
element.mission_path.path.path_f[0].y = DL_MISSION_PATH_point_north_1(buf);
296 me.
element.mission_path.path.path_f[0].z = DL_MISSION_PATH_path_alt(buf);
297 me.
element.mission_path.path.path_f[1].x = DL_MISSION_PATH_point_east_2(buf);
298 me.
element.mission_path.path.path_f[1].y = DL_MISSION_PATH_point_north_2(buf);
299 me.
element.mission_path.path.path_f[1].z = DL_MISSION_PATH_path_alt(buf);
300 me.
element.mission_path.path.path_f[2].x = DL_MISSION_PATH_point_east_3(buf);
301 me.
element.mission_path.path.path_f[2].y = DL_MISSION_PATH_point_north_3(buf);
302 me.
element.mission_path.path.path_f[2].z = DL_MISSION_PATH_path_alt(buf);
303 me.
element.mission_path.path.path_f[3].x = DL_MISSION_PATH_point_east_4(buf);
304 me.
element.mission_path.path.path_f[3].y = DL_MISSION_PATH_point_north_4(buf);
305 me.
element.mission_path.path.path_f[3].z = DL_MISSION_PATH_path_alt(buf);
306 me.
element.mission_path.path.path_f[4].x = DL_MISSION_PATH_point_east_5(buf);
307 me.
element.mission_path.path.path_f[4].y = DL_MISSION_PATH_point_north_5(buf);
308 me.
element.mission_path.path.path_f[4].z = DL_MISSION_PATH_path_alt(buf);
309 me.
element.mission_path.nb = DL_MISSION_PATH_nb(buf);
311 me.
element.mission_path.path_idx = 0;
312 me.
duration = DL_MISSION_PATH_duration(buf);
313 me.
index = DL_MISSION_PATH_index(buf);
322 if (DL_MISSION_PATH_LLA_ac_id(buf) != AC_ID) {
return false; }
325 lla[0].
lat = DL_MISSION_PATH_LLA_point_lat_1(buf);
326 lla[0].
lon = DL_MISSION_PATH_LLA_point_lon_1(buf);
327 lla[0].
alt = DL_MISSION_PATH_LLA_path_alt(buf);
328 lla[1].
lat = DL_MISSION_PATH_LLA_point_lat_2(buf);
329 lla[1].
lon = DL_MISSION_PATH_LLA_point_lon_2(buf);
330 lla[1].
alt = DL_MISSION_PATH_LLA_path_alt(buf);
331 lla[2].
lat = DL_MISSION_PATH_LLA_point_lat_3(buf);
332 lla[2].
lon = DL_MISSION_PATH_LLA_point_lon_3(buf);
333 lla[2].
alt = DL_MISSION_PATH_LLA_path_alt(buf);
334 lla[3].
lat = DL_MISSION_PATH_LLA_point_lat_4(buf);
335 lla[3].
lon = DL_MISSION_PATH_LLA_point_lon_4(buf);
336 lla[3].
alt = DL_MISSION_PATH_LLA_path_alt(buf);
337 lla[4].
lat = DL_MISSION_PATH_LLA_point_lat_5(buf);
338 lla[4].
lon = DL_MISSION_PATH_LLA_point_lon_5(buf);
339 lla[4].
alt = DL_MISSION_PATH_LLA_path_alt(buf);
344 me.
element.mission_path.nb = DL_MISSION_PATH_LLA_nb(buf);
346 for (i = 0; i < me.
element.mission_path.nb; i++) {
350 me.
element.mission_path.path_idx = 0;
351 me.
duration = DL_MISSION_PATH_LLA_duration(buf);
352 me.
index = DL_MISSION_PATH_LLA_index(buf);
361 if (DL_MISSION_CUSTOM_ac_id(buf) != AC_ID) {
return false; }
366 if (me.
element.mission_custom.reg == NULL) {
369 me.
element.mission_custom.nb = DL_MISSION_CUSTOM_params_length(buf);
370 for (
int i = 0; i < me.
element.mission_custom.nb; i++) {
371 me.
element.mission_custom.params[i] = DL_MISSION_CUSTOM_params(buf)[i];
373 me.
duration = DL_MISSION_CUSTOM_duration(buf);
374 me.
index = DL_MISSION_CUSTOM_index(buf);
383 if (DL_GOTO_MISSION_ac_id(buf) != AC_ID) {
return false; }
385 uint8_t mission_id = DL_GOTO_MISSION_mission_id(buf);
388 }
else {
return false; }
395 if (DL_NEXT_MISSION_ac_id(buf) != AC_ID) {
return false; }
406 if (DL_END_MISSION_ac_id(buf) != AC_ID) {
return false; }