31 #include "generated/flight_plan.h"
32 #include "generated/airframe.h"
36 #if defined WP_RELEASE
39 #define TRIGGER_DELAY 1.
49 #define ALPHA_M (ALPHA / MASS)
66 #ifndef AIRSPEED_AT_RELEASE
67 #define AIRSPEED_AT_RELEASE 14.
71 float airspeed = AIRSPEED_AT_RELEASE;
74 static float nav_drop_x, nav_drop_y, nav_drop_z;
75 static float nav_drop_vx, nav_drop_vy, nav_drop_vz;
78 static void integrate(
uint8_t wp_target)
82 while (nav_drop_z > 0. && i < MAX_STEPS) {
86 float airz = -nav_drop_vz;
89 float beta = ALPHA_M * sqrt(airx * airx + airy * airy + airz * airz);
92 nav_drop_vx += airx * beta * DT;
93 nav_drop_vy += airy * beta * DT;
96 nav_drop_x += nav_drop_vx * DT;
97 nav_drop_y += nav_drop_vy * DT;
98 nav_drop_z += nav_drop_vz * DT;
103 if (nav_drop_z > 0.) {
106 float t = - nav_drop_z / nav_drop_vz;
107 nav_drop_x += nav_drop_vx * t;
108 nav_drop_y += nav_drop_vy * t;
128 integrate(wp_target);
137 float nav_drop_radius)
150 float d = sqrt(x_0 * x_0 + y_0 * y_0);
158 if (nav_drop_radius < 0) {
173 float vx0 = nav_drop_vx;
174 float vy0 = nav_drop_vy;
176 integrate(wp_target);
189 imcu_set_command(COMMAND_HATCH,
MAX_PPRZ);
200 float d = sqrt(x_0 * x_0 + y_0 * y_0);