Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
nav.c
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2003-2005 Pascal Brisset, Antoine Drouin
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
29 #define NAV_C
30 
31 #include <math.h>
32 
33 #include "subsystems/nav.h"
34 #include "subsystems/gps.h"
35 #include "estimator.h"
38 #include "inter_mcu.h"
40 
41 #define RCLost() bit_is_set(fbw_state->status, RADIO_REALLY_LOST)
42 
44 
45 float last_x, last_y;
46 
48 static uint8_t last_wp __attribute__ ((unused));
49 
50 float rc_pitch;
52 
54 float nav_circle_radians; /* Cumulated */
55 float nav_circle_radians_no_rewind; /* Cumulated */
56 float nav_circle_trigo_qdr; /* Angle from center to mobile */
58 
59 
61 static float nav_leg_progress;
62 
64 static float nav_leg_length;
65 
71 float circle_bank = 0;
72 
75 
77 #ifndef NAV_GLIDE_PITCH_TRIM
78 #define NAV_GLIDE_PITCH_TRIM 0.
79 #endif
80 
81 
82 
84 
85 /* Used in nav_survey_rectangle. Defined here for downlink and uplink */
89 
91 
92 void nav_init_stage( void ) {
94  stage_time = 0;
95  nav_circle_radians = 0;
96  nav_circle_radians_no_rewind = 0;
97  nav_in_circle = FALSE;
98  nav_in_segment = FALSE;
99  nav_shift = 0;
100  nav_pitch = 0.;
101 }
102 
103 #define PowerVoltage() (vsupply/10.)
104 #define RcRoll(travel) (fbw_state->channels[RADIO_ROLL]* (float)travel /(float)MAX_PPRZ)
105 
106 #define MIN_DX ((int16_t)(MAX_PPRZ * 0.05))
107 
108 
110 void nav_circle_XY(float x, float y, float radius) {
111  float last_trigo_qdr = nav_circle_trigo_qdr;
112  nav_circle_trigo_qdr = atan2(estimator_y - y, estimator_x - x);
113  float sign_radius = radius > 0 ? 1 : -1;
114 
115  if (nav_in_circle) {
116  float trigo_diff = nav_circle_trigo_qdr - last_trigo_qdr;
117  NormRadAngle(trigo_diff);
118  nav_circle_radians += trigo_diff;
119  trigo_diff *= - sign_radius;
120  if (trigo_diff > 0) // do not rewind if the change in angle is in the opposite sense than nav_radius
121  nav_circle_radians_no_rewind += trigo_diff;
122  }
123 
124  float dist2_center = DistanceSquare(estimator_x, estimator_y, x, y);
125  float dist_carrot = CARROT*NOMINAL_AIRSPEED;
126 
127  radius += -nav_shift;
128 
129  float abs_radius = fabs(radius);
130 
132  circle_bank =
133  (dist2_center > Square(abs_radius + dist_carrot)
134  || dist2_center < Square(abs_radius - dist_carrot)) ?
135  0 :
137 
138  float carrot_angle = dist_carrot / abs_radius;
139  carrot_angle = Min(carrot_angle, M_PI/4);
140  carrot_angle = Max(carrot_angle, M_PI/16);
141  float alpha_carrot = nav_circle_trigo_qdr - sign_radius * carrot_angle;
142  horizontal_mode = HORIZONTAL_MODE_CIRCLE;
143  float radius_carrot = abs_radius;
144  if (nav_mode == NAV_MODE_COURSE)
145  radius_carrot += (abs_radius / cos(carrot_angle) - abs_radius);
146  fly_to_xy(x+cos(alpha_carrot)*radius_carrot,
147  y+sin(alpha_carrot)*radius_carrot);
148  nav_in_circle = TRUE;
149  nav_circle_x = x;
150  nav_circle_y = y;
151  nav_circle_radius = radius;
152 }
153 
154 
155 #define NavGlide(_last_wp, _wp) { \
156  float start_alt = waypoints[_last_wp].a; \
157  float diff_alt = waypoints[_wp].a - start_alt; \
158  float alt = start_alt + nav_leg_progress * diff_alt; \
159  float pre_climb = estimator_hspeed_mod * diff_alt / nav_leg_length; \
160  NavVerticalAltitudeMode(alt, pre_climb); \
161 }
162 
163 
164 
165 
166 #define MAX_DIST_CARROT 250.
167 #define MIN_HEIGHT_CARROT 50.
168 #define MAX_HEIGHT_CARROT 150.
169 
170 #define Goto3D(radius) { \
171  if (pprz_mode == PPRZ_MODE_AUTO2) { \
172  int16_t yaw = fbw_state->channels[RADIO_YAW]; \
173  if (yaw > MIN_DX || yaw < -MIN_DX) { \
174  carrot_x += FLOAT_OF_PPRZ(yaw, 0, -20.); \
175  carrot_x = Min(carrot_x, MAX_DIST_CARROT); \
176  carrot_x = Max(carrot_x, -MAX_DIST_CARROT); \
177  } \
178  int16_t pitch = fbw_state->channels[RADIO_PITCH]; \
179  if (pitch > MIN_DX || pitch < -MIN_DX) { \
180  carrot_y += FLOAT_OF_PPRZ(pitch, 0, -20.); \
181  carrot_y = Min(carrot_y, MAX_DIST_CARROT); \
182  carrot_y = Max(carrot_y, -MAX_DIST_CARROT); \
183  } \
184  v_ctl_mode = V_CTL_MODE_AUTO_ALT; \
185  int16_t roll = fbw_state->channels[RADIO_ROLL]; \
186  if (roll > MIN_DX || roll < -MIN_DX) { \
187  nav_altitude += FLOAT_OF_PPRZ(roll, 0, -1.0); \
188  nav_altitude = Max(nav_altitude, MIN_HEIGHT_CARROT+ground_alt); \
189  nav_altitude = Min(nav_altitude, MAX_HEIGHT_CARROT+ground_alt); \
190  } \
191  } \
192  nav_circle_XY(carrot_x, carrot_y, radius); \
193 }
194 
195 
196 #define NavFollow(_ac_id, _distance, _height) \
197  nav_follow(_ac_id, _distance, _height);
198 
199 
200 static unit_t unit __attribute__ ((unused));
201 
202 static inline void nav_follow(uint8_t _ac_id, float _distance, float _height);
203 
204 #ifdef NAV_GROUND_SPEED_PGAIN
205 
207 static void nav_ground_speed_loop( void ) {
208  if (MINIMUM_AIRSPEED < nav_ground_speed_setpoint
209  && nav_ground_speed_setpoint < MAXIMUM_AIRSPEED) {
210  float err = nav_ground_speed_setpoint - estimator_hspeed_mod;
211  v_ctl_auto_throttle_cruise_throttle += nav_ground_speed_pgain*err;
212  Bound(v_ctl_auto_throttle_cruise_throttle, V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE, V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE);
213  } else {
214  /* Reset cruise throttle to nominal value */
215  v_ctl_auto_throttle_cruise_throttle = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
216  }
217 }
218 #endif
219 
220 static float baseleg_out_qdr;
221 static inline bool_t nav_compute_baseleg(uint8_t wp_af, uint8_t wp_td, uint8_t wp_baseleg, float radius ) {
222  nav_radius = radius;
223 
224  float x_0 = waypoints[wp_td].x - waypoints[wp_af].x;
225  float y_0 = waypoints[wp_td].y - waypoints[wp_af].y;
226 
227  /* Unit vector from AF to TD */
228  float d = sqrt(x_0*x_0+y_0*y_0);
229  float x_1 = x_0 / d;
230  float y_1 = y_0 / d;
231 
232  waypoints[wp_baseleg].x = waypoints[wp_af].x + y_1 * nav_radius;
233  waypoints[wp_baseleg].y = waypoints[wp_af].y - x_1 * nav_radius;
234  waypoints[wp_baseleg].a = waypoints[wp_af].a;
235  baseleg_out_qdr = M_PI - atan2(-y_1, -x_1);
236  if (nav_radius < 0)
237  baseleg_out_qdr += M_PI;
238 
239  return FALSE;
240 }
241 
242 static inline bool_t nav_compute_final_from_glide(uint8_t wp_af, uint8_t wp_td, float glide ) {
243 
244  float x_0 = waypoints[wp_td].x - waypoints[wp_af].x;
245  float y_0 = waypoints[wp_td].y - waypoints[wp_af].y;
246  float h_0 = waypoints[wp_td].a - waypoints[wp_af].a;
247 
248  /* Unit vector from AF to TD */
249  float d = sqrt(x_0*x_0+y_0*y_0);
250  float x_1 = x_0 / d;
251  float y_1 = y_0 / d;
252 
253  waypoints[wp_af].x = waypoints[wp_td].x + x_1 * h_0 * glide;
254  waypoints[wp_af].y = waypoints[wp_td].y + y_1 * h_0 * glide;
255  waypoints[wp_af].a = waypoints[wp_af].a;
256 
257  return FALSE;
258 }
259 
260 
261 /* For a landing UPWIND.
262  Computes Top Of Descent waypoint from Touch Down and Approach Fix
263  waypoints, using glide airspeed, glide vertical speed and wind */
264 static inline bool_t compute_TOD(uint8_t _af, uint8_t _td, uint8_t _tod, float glide_airspeed, float glide_vspeed) {
265  float td_af_x = WaypointX(_af) - WaypointX(_td);
266  float td_af_y = WaypointY(_af) - WaypointY(_td);
267  float td_af = sqrt( td_af_x*td_af_x + td_af_y*td_af_y);
268  float td_tod = (WaypointAlt(_af) - WaypointAlt(_td)) / glide_vspeed * (glide_airspeed - sqrt(wind_east*wind_east + wind_north*wind_north));
269  WaypointX(_tod) = WaypointX(_td) + td_af_x / td_af * td_tod;
270  WaypointY(_tod) = WaypointY(_td) + td_af_y / td_af * td_tod;
271  WaypointAlt(_tod) = WaypointAlt(_af);
272  return FALSE;
273 }
274 
275 
276 #include "generated/flight_plan.h"
277 
278 
279 #ifndef LINE_START_FUNCTION
280 #define LINE_START_FUNCTION {}
281 #endif
282 #ifndef LINE_STOP_FUNCTION
283 #define LINE_STOP_FUNCTION {}
284 #endif
285 
286 
287 
288 static inline void nav_follow(uint8_t _ac_id, float _distance, float _height) {
289  struct ac_info_ * ac = get_ac_info(_ac_id);
291  NavVerticalAltitudeMode(Max(ac->alt + _height, ground_alt+SECURITY_HEIGHT), 0.);
292  float alpha = M_PI/2 - ac->course;
293  float ca = cos(alpha), sa = sin(alpha);
294  float x = ac->east - _distance*ca;
295  float y = ac->north - _distance*sa;
296  fly_to_xy(x, y);
297 #ifdef NAV_FOLLOW_PGAIN
298  float s = (estimator_x-x)*ca+(estimator_y-y)*sa;
299  nav_ground_speed_setpoint = ac->gspeed + NAV_FOLLOW_PGAIN*s;
300  nav_ground_speed_loop();
301 #endif
302 }
303 
304 float nav_altitude = GROUND_ALT + MIN_HEIGHT_CARROT;
307 float nav_pitch; /* Rad */
308 float fp_pitch; /* deg */
309 
310 
317 bool_t nav_approaching_xy(float x, float y, float from_x, float from_y, float approaching_time) {
319  float pw_x = x - estimator_x;
321  float pw_y = y - estimator_y;
322 
323  dist2_to_wp = pw_x*pw_x + pw_y *pw_y;
324  float min_dist = approaching_time * estimator_hspeed_mod;
325  if (dist2_to_wp < min_dist*min_dist)
326  return TRUE;
327 
328  float scal_prod = (x - from_x) * pw_x + (y - from_y) * pw_y;
329 
330  return (scal_prod < 0.);
331 }
332 
333 
337 //static inline void fly_to_xy(float x, float y) {
338 void fly_to_xy(float x, float y) {
339  desired_x = x;
340  desired_y = y;
341  if (nav_mode == NAV_MODE_COURSE) {
343  if (h_ctl_course_setpoint < 0.)
344  h_ctl_course_setpoint += 2 * M_PI;
346  } else {
347  float diff = atan2(x - estimator_x, y - estimator_y) - estimator_hspeed_dir;
348  NormRadAngle(diff);
349  BoundAbs(diff,M_PI/2.);
350  float s = sin(diff);
351  h_ctl_roll_setpoint = atan(2 * estimator_hspeed_mod*estimator_hspeed_mod * s * h_ctl_course_pgain / (CARROT * NOMINAL_AIRSPEED * 9.81) );
354  }
355 }
356 
360 void nav_route_xy(float last_wp_x, float last_wp_y, float wp_x, float wp_y) {
361  float leg_x = wp_x - last_wp_x;
362  float leg_y = wp_y - last_wp_y;
363  float leg2 = Max(leg_x * leg_x + leg_y * leg_y, 1.);
364  nav_leg_progress = ((estimator_x - last_wp_x) * leg_x + (estimator_y - last_wp_y) * leg_y) / leg2;
365  nav_leg_length = sqrt(leg2);
366 
368  float carrot = CARROT * NOMINAL_AIRSPEED;
369 
370  nav_leg_progress += Max(carrot / nav_leg_length, 0.);
371  nav_in_segment = TRUE;
372  nav_segment_x_1 = last_wp_x;
373  nav_segment_y_1 = last_wp_y;
374  nav_segment_x_2 = wp_x;
375  nav_segment_y_2 = wp_y;
376  horizontal_mode = HORIZONTAL_MODE_ROUTE;
377 
378  fly_to_xy(last_wp_x + nav_leg_progress*leg_x +nav_shift*leg_y/nav_leg_length, last_wp_y + nav_leg_progress*leg_y-nav_shift*leg_x/nav_leg_length);
379 }
380 
382 
383 #ifndef FAILSAFE_HOME_RADIUS
384 #define FAILSAFE_HOME_RADIUS DEFAULT_CIRCLE_RADIUS
385 #endif
386 
387 static void nav_set_altitude(void) {
388  static float last_nav_altitude;
389  if (fabs(nav_altitude - last_nav_altitude) > 1.) {
390  flight_altitude = nav_altitude;
391  last_nav_altitude = nav_altitude;
392  }
394 }
395 
397 void nav_home(void) {
400  nav_pitch = 0.;
402  nav_altitude = ground_alt+HOME_MODE_HEIGHT;
406 }
407 
412 void nav_periodic_task(void) {
413  nav_survey_active = FALSE;
414 
416  dist2_to_wp = 0.;
417 
418  auto_nav(); /* From flight_plan.h */
419 
420  h_ctl_course_pre_bank = nav_in_circle ? circle_bank : 0;
421 
422 #ifdef AGR_CLIMB
425 #endif
426 
428 }
429 
430 
434 void nav_init(void) {
435  nav_block = 0;
436  nav_stage = 0;
437  ground_alt = GROUND_ALT;
438  nav_glide_pitch_trim = NAV_GLIDE_PITCH_TRIM;
439  nav_radius = DEFAULT_CIRCLE_RADIUS;
440  nav_survey_shift = 2*DEFAULT_CIRCLE_RADIUS;
441  nav_mode = NAV_MODE_COURSE;
442 
443 #ifdef NAV_GROUND_SPEED_PGAIN
444  nav_ground_speed_pgain = ABS(NAV_GROUND_SPEED_PGAIN);
445  nav_ground_speed_setpoint = NOMINAL_AIRSPEED;
446 #endif
447 }
448 
455 void nav_without_gps(void) {
458 
459 #ifdef SECTION_FAILSAFE
460  h_ctl_roll_setpoint = FAILSAFE_DEFAULT_ROLL;
461  nav_pitch = FAILSAFE_DEFAULT_PITCH;
462  nav_throttle_setpoint = TRIM_UPPRZ((FAILSAFE_DEFAULT_THROTTLE)*MAX_PPRZ);
463 #else
465  nav_pitch = 0;
466  nav_throttle_setpoint = TRIM_UPPRZ((V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE)*MAX_PPRZ);
467 #endif
468 }
469 
470 
471 /**************** 8 Navigation **********************************************/
472 
473 
474 enum eight_status { R1T, RT2, C2, R2T, RT1, C1 };
475 
477 void nav_eight_init( void ) {
478  eight_status = C1;
479 }
480 
489 void nav_eight(uint8_t target, uint8_t c1, float radius) {
490  float aradius = fabs(radius);
491  float alt = waypoints[target].a;
492  waypoints[c1].a = alt;
493 
494  float target_c1_x = waypoints[c1].x - waypoints[target].x;
495  float target_c1_y = waypoints[c1].y - waypoints[target].y;
496  float d = sqrt(target_c1_x*target_c1_x+target_c1_y*target_c1_y);
497  d = Max(d, 1.); /* To prevent a division by zero */
498 
499  /* Unit vector from target to c1 */
500  float u_x = target_c1_x / d;
501  float u_y = target_c1_y / d;
502 
503  /* Move [c1] closer if needed */
504  if (d > 2 * aradius) {
505  d = 2*aradius;
506  waypoints[c1].x = waypoints[target].x + d*u_x;
507  waypoints[c1].y = waypoints[target].y + d*u_y;
508  }
509 
510  /* The other center */
511  struct point c2 = {
512  waypoints[target].x - d*u_x,
513  waypoints[target].y - d*u_y,
514  alt };
515 
516  struct point c1_in = {
517  waypoints[c1].x + radius * -u_y,
518  waypoints[c1].y + radius * u_x,
519  alt };
520  struct point c1_out = {
521  waypoints[c1].x - radius * -u_y,
522  waypoints[c1].y - radius * u_x,
523  alt };
524 
525  struct point c2_in = {
526  c2.x + radius * -u_y,
527  c2.y + radius * u_x,
528  alt };
529  struct point c2_out = {
530  c2.x - radius * -u_y,
531  c2.y - radius * u_x,
532  alt };
533 
534  float qdr_out = M_PI - atan2(u_y, u_x);
535  if (radius < 0)
536  qdr_out += M_PI;
537 
538  switch (eight_status) {
539  case C1 :
540  NavCircleWaypoint(c1, radius);
541  if (NavQdrCloseTo(DegOfRad(qdr_out)-10)) {
542  eight_status = R1T;
543  InitStage();
544  }
545  return;
546 
547  case R1T:
548  nav_route_xy(c1_out.x, c1_out.y, c2_in.x, c2_in.y);
549  if (nav_approaching_xy(waypoints[target].x, waypoints[target].y, c1_out.x, c1_out.y, 0)) {
550  eight_status = RT2;
551  InitStage();
552  }
553  return;
554 
555  case RT2:
556  nav_route_xy(c1_out.x, c1_out.y, c2_in.x, c2_in.y);
557  if (nav_approaching_xy(c2_in.x, c2_in.y, c1_out.x, c1_out.y, CARROT)) {
558  eight_status = C2;
559  InitStage();
560  }
561  return;
562 
563  case C2 :
564  nav_circle_XY(c2.x, c2.y, -radius);
565  if (NavQdrCloseTo(DegOfRad(qdr_out)+10)) {
566  eight_status = R2T;
567  InitStage();
568  }
569  return;
570 
571  case R2T:
572  nav_route_xy(c2_out.x, c2_out.y, c1_in.x, c1_in.y);
573  if (nav_approaching_xy(waypoints[target].x, waypoints[target].y, c2_out.x, c2_out.y, 0)) {
574  eight_status = RT1;
575  InitStage();
576  }
577  return;
578 
579  case RT1:
580  nav_route_xy(c2_out.x, c2_out.y, c1_in.x, c1_in.y);
581  if (nav_approaching_xy(c1_in.x, c1_in.y, c2_out.x, c2_out.y, CARROT)) {
582  eight_status = C1;
583  InitStage();
584  }
585  return;
586 
587  default:/* Should not occur !!! Doing nothing */
588  return;
589  } /* switch */
590 }
591 
592 /************** Oval Navigation **********************************************/
593 
604 
605 void nav_oval_init( void ) {
606  oval_status = OC2;
607  nav_oval_count = 0;
608 }
609 
610 void nav_oval(uint8_t p1, uint8_t p2, float radius) {
611  radius = - radius; /* Historical error ? */
612 
613  float alt = waypoints[p1].a;
614  waypoints[p2].a = alt;
615 
616  float p2_p1_x = waypoints[p1].x - waypoints[p2].x;
617  float p2_p1_y = waypoints[p1].y - waypoints[p2].y;
618  float d = sqrt(p2_p1_x*p2_p1_x+p2_p1_y*p2_p1_y);
619 
620  /* Unit vector from p1 to p2 */
621  float u_x = p2_p1_x / d;
622  float u_y = p2_p1_y / d;
623 
624  /* The half circle centers and the other leg */
625  struct point p1_center = { waypoints[p1].x + radius * -u_y,
626  waypoints[p1].y + radius * u_x,
627  alt };
628  struct point p1_out = { waypoints[p1].x + 2*radius * -u_y,
629  waypoints[p1].y + 2*radius * u_x,
630  alt };
631 
632  struct point p2_in = { waypoints[p2].x + 2*radius * -u_y,
633  waypoints[p2].y + 2*radius * u_x,
634  alt };
635  struct point p2_center = { waypoints[p2].x + radius * -u_y,
636  waypoints[p2].y + radius * u_x,
637  alt };
638 
639  float qdr_out_2 = M_PI - atan2(u_y, u_x);
640  float qdr_out_1 = qdr_out_2 + M_PI;
641  if (radius < 0) {
642  qdr_out_2 += M_PI;
643  qdr_out_1 += M_PI;
644  }
645  float qdr_anticipation = (radius > 0 ? -15 : 15);
646 
647  switch (oval_status) {
648  case OC1 :
649  nav_circle_XY(p1_center.x,p1_center.y, -radius);
650  if (NavQdrCloseTo(DegOfRad(qdr_out_1)-qdr_anticipation)) {
651  oval_status = OR12;
652  InitStage();
654  }
655  return;
656 
657  case OR12:
658  nav_route_xy(p1_out.x, p1_out.y, p2_in.x, p2_in.y);
659  if (nav_approaching_xy(p2_in.x, p2_in.y, p1_out.x, p1_out.y, CARROT)) {
660  oval_status = OC2;
661  nav_oval_count++;
662  InitStage();
664  }
665  return;
666 
667  case OC2 :
668  nav_circle_XY(p2_center.x, p2_center.y, -radius);
669  if (NavQdrCloseTo(DegOfRad(qdr_out_2)-qdr_anticipation)) {
670  oval_status = OR21;
671  InitStage();
673  }
674  return;
675 
676  case OR21:
677  nav_route_xy(waypoints[p2].x, waypoints[p2].y, waypoints[p1].x, waypoints[p1].y);
678  if (nav_approaching_xy(waypoints[p1].x, waypoints[p1].y, waypoints[p2].x, waypoints[p2].y, CARROT)) {
679  oval_status = OC1;
680  InitStage();
682  }
683  return;
684 
685  default: /* Should not occur !!! Doing nothing */
686  return;
687  }
688 }
float estimator_hspeed_mod
module of horizontal ground speed in m/s
Definition: estimator.c:64
#define Min(x, y)
float v_ctl_altitude_setpoint
in meters above MSL
Definition: energy_ctrl.c:91
float h_ctl_course_setpoint
fixed wing horizontal adaptive control
int16_t pprz_t
Definition: paparazzi.h:6
float north
Definition: traffic_info.h:38
static float radius
Definition: chemotaxis.c:15
float x
Definition: hf_float.h:53
uint8_t lateral_mode
Definition: main_ap.c:112
float estimator_y
north position in meters
Definition: estimator.c:43
#define InitStage()
uint8_t nav_block
#define V_CTL_MODE_AUTO_THROTTLE
float dist2_to_home
Definition: common_nav.c:31
struct ac_info_ * get_ac_info(uint8_t id)
Definition: traffic_info.c:44
float estimator_hspeed_dir
direction of horizontal ground speed in rad (CW/North)
Definition: estimator.c:65
float east
Definition: traffic_info.h:37
#define FALSE
Definition: imu_chimu.h:141
float alt
Definition: traffic_info.h:40
#define V_CTL_AUTO_THROTTLE_STANDARD
#define TRIM_UPPRZ(pprz)
Definition: paparazzi.h:14
#define Max(x, y)
#define V_CTL_MODE_AUTO_ALT
float wind_east
Definition: estimator.c:68
Device independent GPS code (interface)
static uint16_t c1
Definition: baro_MS5534A.c:197
float course
Definition: traffic_info.h:39
float estimator_x
east position in meters
Definition: estimator.c:42
uint8_t v_ctl_auto_throttle_submode
Definition: energy_ctrl.c:79
uint8_t v_ctl_mode
Definition: energy_ctrl.c:77
#define V_CTL_MODE_AUTO_CLIMB
uint16_t stage_time
In s.
float h_ctl_roll_max_setpoint
#define TRUE
Definition: imu_chimu.h:144
uint8_t nav_stage
float h_ctl_course_pre_bank
float v_ctl_auto_throttle_cruise_throttle
Definition: energy_ctrl.c:106
unsigned char uint8_t
Definition: types.h:14
float y
Definition: hf_float.h:57
float h_ctl_roll_setpoint
float h_ctl_course_pgain
float y
Definition: common_nav.h:38
State estimation, fusioning sensors.
float dist2_to_wp
Definition: common_nav.c:32
float wind_north
Definition: estimator.c:68
#define LATERAL_MODE_ROLL
Definition: autopilot.h:62
#define MAX_PPRZ
Definition: paparazzi.h:8
#define LATERAL_MODE_COURSE
Definition: autopilot.h:63
float gspeed
Definition: traffic_info.h:41
float x
Definition: common_nav.h:37
Informations relative to the other aircrafts.