30#include "generated/flight_plan.h"
31#include "generated/airframe.h"
39#ifndef MISSION_CHECK_UNIQUE_ID
40#define MISSION_CHECK_UNIQUE_ID TRUE
87#if MISSION_CHECK_UNIQUE_ID
344 me.element.mission_path.path_idx = 0;
379 for (i = 0; i <
me.element.mission_path.nb; i++) {
383 me.element.mission_path.path_idx = 0;
399 if (
me.element.mission_custom.reg ==
NULL) {
403 for (
int i = 0; i <
me.element.mission_custom.nb; i++) {
456 }
else {
return false; }
Handling of messages coming from ground and other A/Cs.
Common code for AP and FBW telemetry.
int32_t lat
in degrees*1e7
int32_t alt
in millimeters above WGS84 reference ellipsoid
int32_t lon
in degrees*1e7
vector in Latitude, Longitude and Altitude
int mission_parse_END_MISSION(uint8_t *buf)
int mission_parse_GOTO_WP_LLA(uint8_t *buf)
int mission_parse_CUSTOM(uint8_t *buf)
void mission_init(void)
Init mission structure.
int mission_parse_NEXT_MISSION(uint8_t *buf)
struct _mission_element * mission_get(void)
Get current mission element.
int mission_parse_PATH_LLA(uint8_t *buf)
bool mission_insert(enum MissionInsertMode insert, struct _mission_element *element)
Insert a mission element according to the insertion mode.
void mission_status_report(void)
Report mission status.
int mission_parse_SEGMENT_LLA(uint8_t *buf)
int mission_parse_GOTO_WP(uint8_t *buf)
Parsing functions called when a mission message is received.
int mission_parse_CIRCLE(uint8_t *buf)
struct _mission_element * mission_get_from_index(uint8_t index)
Get mission element by index.
int mission_parse_UPDATE(uint8_t *buf)
int mission_parse_SEGMENT(uint8_t *buf)
static void send_mission_status(struct transport_tx *trans, struct link_device *device)
int mission_parse_GOTO_MISSION(uint8_t *buf)
static struct _mission_registered * mission_get_registered(char *type)
bool mission_register(mission_custom_cb cb, char *type)
Register a new navigation or action callback function.
int mission_parse_PATH(uint8_t *buf)
int mission_parse_CIRCLE_LLA(uint8_t *buf)
#define MISSION_TYPE_SIZE
bool(* mission_custom_cb)(uint8_t nb, float *params, enum MissionRunFlag flag)
custom mission element callback
char type[MISSION_TYPE_SIZE]
mission element identifier (5 char max + 1 \0)
mission_custom_cb cb
navigation/action function callback
struct _mission_registered registered[MISSION_REGISTER_NB]
@ MissionUpdate
param update
struct _mission_element elements[MISSION_ELEMENT_NB]
float element_time
time in second spend in the current element
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.
uint8_t index
index of mission element
#define MISSION_REGISTER_NB
Max number of registered nav/action callbacks can be redefined.
#define MISSION_ELEMENT_NB
Max number of elements in the tasks' list can be redefined.
uint8_t insert_idx
inserstion index
@ ReplaceCurrent
replace current element
@ Append
add at the last position
@ ReplaceNexts
replace the next element and remove all the others
@ ReplaceAll
remove all elements and add the new one
@ Prepend
add before the current element
float duration
time to spend in the element (<= 0 to disable)
#define MISSION_CUSTOM_MAX
uint8_t current_idx
current mission element index
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.