Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
guidance_v.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #include "generated/airframe.h"
30 
34 
35 #include "state.h"
36 
37 #include "math/pprz_algebra_int.h"
38 
39 
40 /* error if some gains are negative */
41 #if (GUIDANCE_V_HOVER_KP < 0) || \
42  (GUIDANCE_V_HOVER_KD < 0) || \
43  (GUIDANCE_V_HOVER_KI < 0)
44 #error "ALL control gains must be positive!!!"
45 #endif
46 
47 
48 /* If only GUIDANCE_V_NOMINAL_HOVER_THROTTLE is defined,
49  * disable the adaptive throttle estimation by default.
50  * Otherwise enable adaptive estimation by default.
51  */
52 #ifdef GUIDANCE_V_NOMINAL_HOVER_THROTTLE
53 # ifndef GUIDANCE_V_ADAPT_THROTTLE_ENABLED
54 # define GUIDANCE_V_ADAPT_THROTTLE_ENABLED FALSE
55 # endif
56 #else
57 # define GUIDANCE_V_NOMINAL_HOVER_THROTTLE 0.4
58 # ifndef GUIDANCE_V_ADAPT_THROTTLE_ENABLED
59 # define GUIDANCE_V_ADAPT_THROTTLE_ENABLED TRUE
60 # endif
61 #endif
62 PRINT_CONFIG_VAR(GUIDANCE_V_NOMINAL_HOVER_THROTTLE)
63 PRINT_CONFIG_VAR(GUIDANCE_V_ADAPT_THROTTLE_ENABLED)
64 
65 
66 #ifndef GUIDANCE_V_CLIMB_RC_DEADBAND
67 #define GUIDANCE_V_CLIMB_RC_DEADBAND MAX_PPRZ/10
68 #endif
69 
70 #ifndef GUIDANCE_V_MAX_RC_CLIMB_SPEED
71 #define GUIDANCE_V_MAX_RC_CLIMB_SPEED GUIDANCE_V_REF_MIN_ZD
72 #endif
73 
74 #ifndef GUIDANCE_V_MAX_RC_DESCENT_SPEED
75 #define GUIDANCE_V_MAX_RC_DESCENT_SPEED GUIDANCE_V_REF_MAX_ZD
76 #endif
77 
78 #ifndef GUIDANCE_V_MIN_ERR_Z
79 #define GUIDANCE_V_MIN_ERR_Z POS_BFP_OF_REAL(-10.)
80 #endif
81 
82 #ifndef GUIDANCE_V_MAX_ERR_Z
83 #define GUIDANCE_V_MAX_ERR_Z POS_BFP_OF_REAL(10.)
84 #endif
85 
86 #ifndef GUIDANCE_V_MIN_ERR_ZD
87 #define GUIDANCE_V_MIN_ERR_ZD SPEED_BFP_OF_REAL(-10.)
88 #endif
89 
90 #ifndef GUIDANCE_V_MAX_ERR_ZD
91 #define GUIDANCE_V_MAX_ERR_ZD SPEED_BFP_OF_REAL(10.)
92 #endif
93 
94 #ifndef GUIDANCE_V_MAX_SUM_ERR
95 #define GUIDANCE_V_MAX_SUM_ERR 2000000
96 #endif
97 
102 
105 
106 
111 
117 
123 
127 
129 
131 
132 
133 #define GuidanceVSetRef(_pos, _speed, _accel) { \
134  gv_set_ref(_pos, _speed, _accel); \
135  guidance_v_z_ref = _pos; \
136  guidance_v_zd_ref = _speed; \
137  guidance_v_zdd_ref = _accel; \
138  }
139 
141 static void run_hover_loop(bool_t in_flight);
142 
143 #if PERIODIC_TELEMETRY
145 
146 static void send_vert_loop(struct transport_tx *trans, struct link_device *dev)
147 {
148  pprz_msg_send_VERT_LOOP(trans, dev, AC_ID,
149  &guidance_v_z_sp, &guidance_v_zd_sp,
150  &(stateGetPositionNed_i()->z),
151  &(stateGetSpeedNed_i()->z),
152  &(stateGetAccelNed_i()->z),
153  &guidance_v_z_ref, &guidance_v_zd_ref,
154  &guidance_v_zdd_ref,
155  &gv_adapt_X,
156  &gv_adapt_P,
158  &guidance_v_z_sum_err,
159  &guidance_v_ff_cmd,
160  &guidance_v_fb_cmd,
161  &guidance_v_delta_t);
162 }
163 
164 static void send_tune_vert(struct transport_tx *trans, struct link_device *dev)
165 {
166  pprz_msg_send_TUNE_VERT(trans, dev, AC_ID,
167  &guidance_v_z_sp,
168  &(stateGetPositionNed_i()->z),
169  &guidance_v_z_ref,
170  &guidance_v_zd_ref);
171 }
172 #endif
173 
174 void guidance_v_init(void)
175 {
176 
177  guidance_v_mode = GUIDANCE_V_MODE_KILL;
178 
179  guidance_v_kp = GUIDANCE_V_HOVER_KP;
180  guidance_v_kd = GUIDANCE_V_HOVER_KD;
181  guidance_v_ki = GUIDANCE_V_HOVER_KI;
182 
183  guidance_v_z_sum_err = 0;
184 
185  guidance_v_nominal_throttle = GUIDANCE_V_NOMINAL_HOVER_THROTTLE;
186  guidance_v_adapt_throttle_enabled = GUIDANCE_V_ADAPT_THROTTLE_ENABLED;
187 
188  gv_adapt_init();
189 
190 #if GUIDANCE_V_MODE_MODULE_SETTING == GUIDANCE_V_MODE_MODULE
192 #endif
193 
194 #if PERIODIC_TELEMETRY
195  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_VERT_LOOP, send_vert_loop);
196  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_TUNE_VERT, send_tune_vert);
197 #endif
198 }
199 
200 
202 {
203 
204  /* used in RC_DIRECT directly and as saturation in CLIMB and HOVER */
205  guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE];
206 
207  /* used in RC_CLIMB */
208  guidance_v_rc_zd_sp = (MAX_PPRZ / 2) - (int32_t)radio_control.values[RADIO_THROTTLE];
209  DeadBand(guidance_v_rc_zd_sp, GUIDANCE_V_CLIMB_RC_DEADBAND);
210 
211  static const int32_t climb_scale = ABS(SPEED_BFP_OF_REAL(GUIDANCE_V_MAX_RC_CLIMB_SPEED) /
213  static const int32_t descent_scale = ABS(SPEED_BFP_OF_REAL(GUIDANCE_V_MAX_RC_DESCENT_SPEED) /
215 
216  if (guidance_v_rc_zd_sp > 0) {
217  guidance_v_rc_zd_sp *= descent_scale;
218  } else {
219  guidance_v_rc_zd_sp *= climb_scale;
220  }
221 }
222 
224 {
225 
226  if (new_mode == guidance_v_mode) {
227  return;
228  }
229 
230  switch (new_mode) {
233  guidance_v_z_sp = stateGetPositionNed_i()->z; // set current altitude as setpoint
234  guidance_v_z_sum_err = 0;
236  break;
237 
240  guidance_v_zd_sp = 0;
241  case GUIDANCE_V_MODE_NAV:
242  guidance_v_z_sum_err = 0;
244  break;
245 
246 #if GUIDANCE_V_MODE_MODULE_SETTING == GUIDANCE_V_MODE_MODULE
249  break;
250 #endif
251 
253  break;
254 
255  default:
256  break;
257 
258  }
259 
260  guidance_v_mode = new_mode;
261 
262 }
263 
264 void guidance_v_notify_in_flight(bool_t in_flight)
265 {
266  if (in_flight) {
267  gv_adapt_init();
268  }
269 }
270 
271 
272 void guidance_v_run(bool_t in_flight)
273 {
274 
275  // FIXME... SATURATIONS NOT TAKEN INTO ACCOUNT
276  // AKA SUPERVISION and co
277  guidance_v_thrust_coeff = get_vertical_thrust_coeff();
278  if (in_flight) {
279  int32_t vertical_thrust = (stabilization_cmd[COMMAND_THRUST] * guidance_v_thrust_coeff) >> INT32_TRIG_FRAC;
280  gv_adapt_run(stateGetAccelNed_i()->z, vertical_thrust, guidance_v_zd_ref);
281  } else {
282  /* reset estimate while not in_flight */
283  gv_adapt_init();
284  }
285 
286  switch (guidance_v_mode) {
287 
289  guidance_v_z_sp = stateGetPositionNed_i()->z; // for display only
290  stabilization_cmd[COMMAND_THRUST] = guidance_v_rc_delta_t;
291  break;
292 
294  guidance_v_zd_sp = guidance_v_rc_zd_sp;
295  gv_update_ref_from_zd_sp(guidance_v_zd_sp, stateGetPositionNed_i()->z);
296  run_hover_loop(in_flight);
297  stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t;
298  break;
299 
301  gv_update_ref_from_zd_sp(guidance_v_zd_sp, stateGetPositionNed_i()->z);
302  run_hover_loop(in_flight);
303 #if !NO_RC_THRUST_LIMIT
304  /* use rc limitation if available */
305  if (radio_control.status == RC_OK) {
306  stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t);
307  } else
308 #endif
309  stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t;
310  break;
311 
314  guidance_v_zd_sp = 0;
315  gv_update_ref_from_z_sp(guidance_v_z_sp);
316  run_hover_loop(in_flight);
317 #if !NO_RC_THRUST_LIMIT
318  /* use rc limitation if available */
319  if (radio_control.status == RC_OK) {
320  stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t);
321  } else
322 #endif
323  stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t;
324  break;
325 
326 #if GUIDANCE_V_MODE_MODULE_SETTING == GUIDANCE_V_MODE_MODULE
328  guidance_v_module_run(in_flight);
329  break;
330 #endif
331 
332  case GUIDANCE_V_MODE_NAV: {
334  guidance_v_z_sp = -nav_flight_altitude;
335  guidance_v_zd_sp = 0;
336  gv_update_ref_from_z_sp(guidance_v_z_sp);
337  run_hover_loop(in_flight);
338  } else if (vertical_mode == VERTICAL_MODE_CLIMB) {
339  guidance_v_z_sp = stateGetPositionNed_i()->z;
340  guidance_v_zd_sp = -nav_climb;
341  gv_update_ref_from_zd_sp(guidance_v_zd_sp, stateGetPositionNed_i()->z);
342  run_hover_loop(in_flight);
343  } else if (vertical_mode == VERTICAL_MODE_MANUAL) {
344  guidance_v_z_sp = stateGetPositionNed_i()->z;
345  guidance_v_zd_sp = stateGetSpeedNed_i()->z;
346  GuidanceVSetRef(guidance_v_z_sp, guidance_v_zd_sp, 0);
347  guidance_v_z_sum_err = 0;
348  guidance_v_delta_t = nav_throttle;
349  }
350 #if !NO_RC_THRUST_LIMIT
351  /* use rc limitation if available */
352  if (radio_control.status == RC_OK) {
353  stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t);
354  } else
355 #endif
356  stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t;
357  break;
358  }
359 
361  break;
362 
363  default:
364  break;
365  }
366 }
367 
370 {
371  // cos(30°) = 0.8660254
372  static const int32_t max_bank_coef = BFP_OF_REAL(0.8660254f, INT32_TRIG_FRAC);
373 
374  struct Int32RMat *att = stateGetNedToBodyRMat_i();
375  /* thrust vector:
376  * int32_rmat_vmult(&thrust_vect, &att, &zaxis)
377  * same as last colum of rmat with INT32_TRIG_FRAC
378  * struct Int32Vect thrust_vect = {att.m[2], att.m[5], att.m[8]};
379  *
380  * Angle between two vectors v1 and v2:
381  * angle = acos(dot(v1, v2) / (norm(v1) * norm(v2)))
382  * since here both are already of unit length:
383  * angle = acos(dot(v1, v2))
384  * since we we want the cosine of the angle we simply need
385  * thrust_coeff = dot(v1, v2)
386  * also can be simplified considering: v1 is zaxis with (0,0,1)
387  * dot(v1, v2) = v1.z * v2.z = v2.z
388  */
389  int32_t coef = att->m[8];
390  if (coef < max_bank_coef) {
391  coef = max_bank_coef;
392  }
393  return coef;
394 }
395 
396 
397 #define FF_CMD_FRAC 18
398 
399 static void run_hover_loop(bool_t in_flight)
400 {
401 
402  /* convert our reference to generic representation */
404  guidance_v_z_ref = (int32_t)tmp;
405  guidance_v_zd_ref = gv_zd_ref << (INT32_SPEED_FRAC - GV_ZD_REF_FRAC);
406  guidance_v_zdd_ref = gv_zdd_ref << (INT32_ACCEL_FRAC - GV_ZDD_REF_FRAC);
407  /* compute the error to our reference */
408  int32_t err_z = guidance_v_z_ref - stateGetPositionNed_i()->z;
410  int32_t err_zd = guidance_v_zd_ref - stateGetSpeedNed_i()->z;
412 
413  if (in_flight) {
414  guidance_v_z_sum_err += err_z;
415  Bound(guidance_v_z_sum_err, -GUIDANCE_V_MAX_SUM_ERR, GUIDANCE_V_MAX_SUM_ERR);
416  } else {
417  guidance_v_z_sum_err = 0;
418  }
419 
420  /* our nominal command : (g + zdd)*m */
421  int32_t inv_m;
422  if (guidance_v_adapt_throttle_enabled) {
423  inv_m = gv_adapt_X >> (GV_ADAPT_X_FRAC - FF_CMD_FRAC);
424  } else {
425  /* use the fixed nominal throttle */
426  inv_m = BFP_OF_REAL(9.81 / (guidance_v_nominal_throttle * MAX_PPRZ), FF_CMD_FRAC);
427  }
428 
429  const int32_t g_m_zdd = (int32_t)BFP_OF_REAL(9.81, FF_CMD_FRAC) -
430  (guidance_v_zdd_ref << (FF_CMD_FRAC - INT32_ACCEL_FRAC));
431 
432  guidance_v_ff_cmd = g_m_zdd / inv_m;
433  /* feed forward command */
434  guidance_v_ff_cmd = (guidance_v_ff_cmd << INT32_TRIG_FRAC) / guidance_v_thrust_coeff;
435 
436  /* bound the nominal command to 0.9*MAX_PPRZ */
437  Bound(guidance_v_ff_cmd, 0, 8640);
438 
439 
440  /* our error feed back command */
441  /* z-axis pointing down -> positive error means we need less thrust */
442  guidance_v_fb_cmd = ((-guidance_v_kp * err_z) >> 7) +
443  ((-guidance_v_kd * err_zd) >> 16) +
444  ((-guidance_v_ki * guidance_v_z_sum_err) >> 16);
445 
446  guidance_v_delta_t = guidance_v_ff_cmd + guidance_v_fb_cmd;
447 
448  /* bound the result */
449  Bound(guidance_v_delta_t, 0, MAX_PPRZ);
450 
451 }
452 
453 bool_t guidance_v_set_guided_z(float z)
454 {
455  if (guidance_v_mode == GUIDANCE_V_MODE_GUIDED) {
456  guidance_v_z_sp = POS_BFP_OF_REAL(z);
457  return TRUE;
458  }
459  return FALSE;
460 }
int32_t guidance_v_z_sp
altitude setpoint in meters (input).
Definition: guidance_v.c:118
#define GV_ZD_REF_FRAC
number of bits for the fractional part of gv_zd_ref
int32_t guidance_v_kd
vertical control D-gain
Definition: guidance_v.c:125
#define GUIDANCE_V_MODE_NAV
Definition: guidance_v.h:40
#define Min(x, y)
#define GUIDANCE_V_NOMINAL_HOVER_THROTTLE
Definition: guidance_v.c:57
#define GV_Z_REF_FRAC
number of bits for the fractional part of gv_z_ref
Generic transmission transport header.
Definition: transport.h:89
#define INT32_ACCEL_FRAC
#define INT32_SPEED_FRAC
int32_t guidance_v_fb_cmd
feed-back command
Definition: guidance_v.c:100
Periodic telemetry system header (includes downlink utility and generated code).
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
Definition: state.h:1090
int32_t guidance_v_delta_t
thrust command.
Definition: guidance_v.c:101
uint8_t status
Definition: radio_control.h:53
void guidance_v_run(bool_t in_flight)
Definition: guidance_v.c:272
int32_t guidance_v_kp
vertical control P-gain
Definition: guidance_v.c:124
#define GV_ADAPT_X_FRAC
void guidance_v_init(void)
Definition: guidance_v.c:174
#define POS_BFP_OF_REAL(_af)
void guidance_v_notify_in_flight(bool_t in_flight)
Definition: guidance_v.c:264
#define GUIDANCE_V_MIN_ERR_Z
Definition: guidance_v.c:79
int32_t m[3 *3]
void guidance_v_mode_changed(uint8_t new_mode)
Definition: guidance_v.c:223
float guidance_v_nominal_throttle
nominal throttle for hover.
Definition: guidance_v.c:103
Vertical guidance for rotorcrafts.
static void run_hover_loop(bool_t in_flight)
Definition: guidance_v.c:399
#define GV_ZDD_REF_FRAC
number of bits for the fractional part of gv_zdd_ref
bool_t guidance_v_adapt_throttle_enabled
Use adaptive throttle command estimation.
Definition: guidance_v.c:104
signed long long int64_t
Definition: types.h:21
bool_t guidance_v_set_guided_z(float z)
Set z setpoint in GUIDED mode.
Definition: guidance_v.c:453
int32_t guidance_v_z_sum_err
accumulator for I-gain
Definition: guidance_v.c:128
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:58
int32_t z
Down.
#define GUIDANCE_V_MODE_KILL
Definition: guidance_v.h:35
#define FALSE
Definition: std.h:5
int32_t guidance_v_rc_zd_sp
Vertical speed setpoint from radio control.
Definition: guidance_v.c:116
#define BFP_OF_REAL(_vr, _frac)
void gv_update_ref_from_z_sp(int32_t z_sp)
static struct NedCoor_i * stateGetSpeedNed_i(void)
Get ground speed in local NED coordinates (int).
Definition: state.h:840
#define TRUE
Definition: std.h:4
int32_t guidance_v_ki
vertical control I-gain
Definition: guidance_v.c:126
#define GUIDANCE_V_MODE_MODULE
Definition: guidance_v.h:41
void guidance_v_module_init(void)
void gv_adapt_init(void)
#define GUIDANCE_V_MAX_RC_DESCENT_SPEED
Definition: guidance_v.c:75
#define GUIDANCE_V_MODE_CLIMB
Definition: guidance_v.h:38
int32_t gv_zd_ref
reference model vertical speed in meters/sec (output) fixed point representation with GV_ZD_REF_FRAC ...
void guidance_v_module_run(UNUSED bool_t in_flight)
#define DefaultPeriodic
Set default periodic telemetry.
Definition: telemetry.h:66
int32_t guidance_v_zdd_ref
vertical acceleration reference in meter/s^2.
Definition: guidance_v.c:122
#define GUIDANCE_V_MAX_ERR_Z
Definition: guidance_v.c:83
#define GUIDANCE_V_MODE_HOVER
Definition: guidance_v.h:39
struct RadioControl radio_control
Definition: radio_control.c:30
void gv_adapt_run(int32_t zdd_meas, int32_t thrust_applied, int32_t zd_ref)
Adaptation function.
#define GUIDANCE_V_MAX_RC_CLIMB_SPEED
Definition: guidance_v.c:71
int32_t guidance_v_z_ref
altitude reference in meters.
Definition: guidance_v.c:120
#define RADIO_THROTTLE
Definition: spektrum_arch.h:42
#define INT32_POS_FRAC
void gv_update_ref_from_zd_sp(int32_t zd_sp, int32_t z_pos)
update vertical reference from speed setpoint.
int32_t guidance_v_zd_ref
vertical speed reference in meter/s.
Definition: guidance_v.c:121
int32_t gv_adapt_P
Covariance.
#define GuidanceVSetRef(_pos, _speed, _accel)
Definition: guidance_v.c:133
signed long int32_t
Definition: types.h:19
#define RC_OK
Definition: radio_control.h:48
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:69
#define INT32_TRIG_FRAC
#define GUIDANCE_V_CLIMB_RC_DEADBAND
Definition: guidance_v.c:67
uint8_t guidance_v_mode
Definition: guidance_v.c:98
#define GUIDANCE_V_ADAPT_THROTTLE_ENABLED
Definition: guidance_v.c:59
unsigned char uint8_t
Definition: types.h:14
void guidance_v_module_enter(void)
API to get/set the generic vehicle states.
int32_t gv_adapt_Xmeas
Measurement.
#define FF_CMD_FRAC
Definition: guidance_v.c:397
int32_t guidance_v_thrust_coeff
Definition: guidance_v.c:130
#define GUIDANCE_V_MIN_ERR_ZD
Definition: guidance_v.c:87
int64_t gv_z_ref
reference model altitude in meters (output) fixed point representation with GV_Z_REF_FRAC Q37...
static int32_t get_vertical_thrust_coeff(void)
get the cosine of the angle between thrust vector and gravity vector
Definition: guidance_v.c:369
General stabilization interface for rotorcrafts.
void guidance_v_read_rc(void)
Definition: guidance_v.c:201
int32_t stabilization_cmd[COMMANDS_NB]
Stabilization commands.
Definition: stabilization.c:28
#define GUIDANCE_V_MAX_ERR_ZD
Definition: guidance_v.c:91
#define GUIDANCE_V_MODE_FLIP
Definition: guidance_v.h:42
Guidance in a module file.
int32_t guidance_v_zd_sp
vertical speed setpoint in meter/s (input).
Definition: guidance_v.c:119
#define GUIDANCE_V_MAX_SUM_ERR
Definition: guidance_v.c:95
int32_t guidance_v_rc_delta_t
Direct throttle from radio control.
Definition: guidance_v.c:110
rotation matrix
#define SPEED_BFP_OF_REAL(_af)
int32_t guidance_v_ff_cmd
feed-forward command
Definition: guidance_v.c:99
#define GUIDANCE_V_MODE_RC_CLIMB
Definition: guidance_v.h:37
#define MAX_PPRZ
Definition: paparazzi.h:8
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
Definition: state.h:648
#define GUIDANCE_V_MODE_RC_DIRECT
Definition: guidance_v.h:36
uint8_t vertical_mode
Definition: sim_ap.c:36
int32_t gv_adapt_X
State of the estimator.
#define GUIDANCE_V_MODE_GUIDED
Definition: guidance_v.h:43
int32_t gv_zdd_ref
reference model vertical accel in meters/s^2 (output) fixed point representation with GV_ZDD_REF_FRAC...
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition: telemetry.c:46
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
Definition: state.h:991
Paparazzi fixed point algebra.