12#include "generated/flight_plan.h"
15#define BUFFER_ZONE_DIST 10
73 if (
el->duration > 0.f) {
75 }
else {
return false; }
90 float radius =
el->element.mission_circle.radius;
99 if (
el-> duration <= 0.f){
111 struct EnuCoor_f *from_wp = &(
el->element.mission_segment.from);
112 struct EnuCoor_f *to_wp = &(
el->element.mission_segment.to);
118 if (
el->duration > 0.f) {
120 }
else {
return false; }
130#ifndef MISSION_PATH_SKIP_GOTO
131#define MISSION_PATH_SKIP_GOTO FALSE
138 if (
el->element.mission_path.nb == 0) {
142 if (
el->element.mission_path.path_idx == 0) {
143 el->element.mission_wp.wp =
el->element.mission_path.path[0];
147 else if (
el->element.mission_path.path_idx <
el->element.mission_path.nb) {
149 struct EnuCoor_f *from_wp = &(
el->element.mission_path.path[(
el->element.mission_path.path_idx) - 1]);
150 struct EnuCoor_f *to_wp = &(
el->element.mission_path.path[
el->element.mission_path.path_idx]);
156 if (
el->duration > 0.f) {
158 el->element.mission_path.path_idx++;
160 }
else {
el->element.mission_path.path_idx++; }
164 }
else {
return false; }
183#ifndef MISSION_WAIT_TIMEOUT
184#define MISSION_WAIT_TIMEOUT 30
188#if MISSION_WAIT_TIMEOUT
Core autopilot interface common to all firmwares.
static float float_vect2_norm(struct FloatVect2 *v)
#define VECT2_SMUL(_vo, _vi, _s)
#define VECT2_DIFF(_c, _a, _b)
#define VECT3_SMUL(_vo, _vi, _s)
int32_t alt
in millimeters above WGS84 reference ellipsoid
void enu_of_lla_point_i(struct EnuCoor_i *enu, struct LtpDef_i *def, struct LlaCoor_i *lla)
Convert a point from LLA to local ENU.
vector in East North Up coordinates
vector in Latitude, Longitude and Altitude
bool ned_initialized_i
true if local int coordinate frame is initialsed
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct LtpDef_i * stateGetNedOrigin_i(void)
Get the coordinate NED frame origin (int)
struct _mission_element * mission_get(void)
Get current mission element.
union _mission_element::@299 element
float element_time
time in second spend in the current element
#define MISSION_ELEMENT_NB
Max number of elements in the tasks' list can be redefined.
uint8_t current_idx
current mission element index
static bool mission_wait_pattern(void)
struct EnuCoor_f last_mission_wp
static bool mission_nav_wp(struct _mission_element *el)
Navigation function to a single waypoint (2D)
static bool mission_nav_segment(struct _mission_element *el)
Navigation function along a segment (2D)
static bool mission_nav_circle(struct _mission_element *el)
Navigation function on a circle.
static bool mission_nav_custom(struct _mission_custom *custom, bool init)
Call custom navigation function.
int mission_run()
Run mission.
bool mission_point_of_lla(struct EnuCoor_f *point, struct LlaCoor_i *lla)
Utility function: converts lla (int) to local point (float)
static const float dt_navigation
#define MISSION_WAIT_TIMEOUT
Implement waiting pattern Only called when MISSION_WAIT_TIMEOUT is not 0.
static bool mission_nav_path(struct _mission_element *el)
Navigation function along a path (2D)
#define MISSION_PATH_SKIP_GOTO
static bool mission_wait_started
float waypoint_get_x(uint8_t wp_id)
Get X/East coordinate of waypoint in meters.
float waypoint_get_y(uint8_t wp_id)
Get Y/North coordinate of waypoint in meters.
#define NAVIGATION_FREQUENCY
Default fixedwing navigation frequency.
vector in East North Up coordinates Units: meters
struct RotorcraftNavigation nav
bool nav_check_wp_time(struct EnuCoor_f *wp, uint16_t stay_time)
Check the time spent in a radius of 'ARRIVED_AT_WAYPOINT' around a wp
navigation_approaching nav_approaching
navigation_circle nav_circle
#define CARROT
default approaching_time for a wp
navigation_route nav_route
Rover navigation functions.