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);
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;
319 }
else {
return FALSE; }
int mission_parse_NEXT_MISSION(void)
int mission_parse_SEGMENT(void)
struct _mission_element * mission_get(void)
Get current mission element.
bool_t 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.
Handling of messages coming from ground and other A/Cs.
void mission_init(void)
Init mission structure.
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
union _mission_element::@21 element
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.
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)
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.
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]
int32_t lat
in degrees*1e7
int mission_parse_PATH_LLA(void)
int mission_parse_CIRCLE_LLA(void)
int mission_parse_END_MISSION(void)