32 #include "generated/airframe.h"
35 #ifndef GVF_ELLIPSE_KE
36 #define GVF_ELLIPSE_KE 1
40 #ifndef GVF_ELLIPSE_KN
41 #define GVF_ELLIPSE_KN 1
46 #define GVF_ELLIPSE_A 80
51 #define GVF_ELLIPSE_B 80
55 #ifndef GVF_ELLIPSE_ALPHA
56 #define GVF_ELLIPSE_ALPHA 0
76 float cosa = cosf(
alpha);
77 float sina = sinf(
alpha);
80 float xel = (px - wx) * cosa - (py - wy) * sina;
81 float yel = (px - wx) * sina + (py - wy) * cosa;
82 *phi = (xel / a) * (xel / a) + (yel /
b) * (yel /
b) - 1;
85 grad->
nx = (2 * xel / (a * a)) * cosa + (2 * yel / (
b *
b)) * sina;
86 grad->
ny = (2 * yel / (
b *
b)) * cosa - (2 * xel / (a * a)) * sina;
89 hess->
H11 = 2 * (cosa * cosa / (a * a)
90 + sina * sina / (
b *
b));
91 hess->
H12 = 2 * sina * cosa * (1 / (
b *
b) - 1 / (a * a));
93 hess->
H22 = 2 * (sina * sina / (a * a)
94 + cosa * cosa / (
b *
b));
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
void gvf_ellipse_info(float *phi, struct gvf_grad *grad, struct gvf_Hess *hess)
gvf_ell_par gvf_ellipse_par
#define GVF_ELLIPSE_ALPHA
Guidance algorithm based on vector fields 2D Ellipse trajectory.
vector in East North Up coordinates Units: meters