Paparazzi UAS  v6.3_unstable
Paparazzi is a free software Unmanned Aircraft System.
guidance_h.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"
28 
37 
41 
42 /* for guidance_v.thrust_coeff */
44 
45 #include "state.h"
46 
47 PRINT_CONFIG_VAR(GUIDANCE_H_USE_REF)
48 PRINT_CONFIG_VAR(GUIDANCE_H_USE_SPEED_REF)
49 
51 
53 
58 
59 static void guidance_h_update_reference(void);
60 static inline void transition_run(bool to_forward);
61 static void read_rc_setpoint_speed_i(struct Int32Vect2 *speed_sp, bool in_flight);
62 
63 #if PERIODIC_TELEMETRY
65 
66 static void send_gh(struct transport_tx *trans, struct link_device *dev)
67 {
68  struct NedCoor_i *pos = stateGetPositionNed_i();
69  pprz_msg_send_GUIDANCE_H_INT(trans, dev, AC_ID,
72  &(pos->x), &(pos->y));
73 }
74 
75 static void send_href(struct transport_tx *trans, struct link_device *dev)
76 {
77  pprz_msg_send_GUIDANCE_H_REF_INT(trans, dev, AC_ID,
84 }
85 
86 static void send_tune_hover(struct transport_tx *trans, struct link_device *dev)
87 {
88  pprz_msg_send_ROTORCRAFT_TUNE_HOVER(trans, dev, AC_ID,
92  &stabilization_cmd[COMMAND_ROLL],
93  &stabilization_cmd[COMMAND_PITCH],
94  &stabilization_cmd[COMMAND_YAW],
95  &stabilization_cmd[COMMAND_THRUST],
96  &(stateGetNedToBodyEulers_i()->phi),
97  &(stateGetNedToBodyEulers_i()->theta),
98  &(stateGetNedToBodyEulers_i()->psi));
99 }
100 
101 #endif
102 
103 void guidance_h_init(void)
104 {
105 
108 
111  guidance_h.sp.heading = 0.0;
112  guidance_h.sp.heading_rate = 0.0;
115 
116  gh_ref_init();
117 
118 #if GUIDANCE_H_MODE_MODULE_SETTING == GUIDANCE_H_MODE_MODULE
120 #endif
121 
122 #if PERIODIC_TELEMETRY
123  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_GUIDANCE_H_INT, send_gh);
124  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_GUIDANCE_H_REF_INT, send_href);
125  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_ROTORCRAFT_TUNE_HOVER, send_tune_hover);
126 #endif
127 
128 }
129 
130 
132 {
135  struct FloatVect2 ref_speed;
136  ref_speed.x = SPEED_FLOAT_OF_BFP(guidance_h.ref.speed.x);
137  ref_speed.y = SPEED_FLOAT_OF_BFP(guidance_h.ref.speed.y);
138 
140  struct FloatVect2 ref_accel;
141  FLOAT_VECT2_ZERO(ref_accel);
142  gh_set_ref(guidance_h.ref.pos, ref_speed, ref_accel);
143 }
144 
146 {
147  if (new_mode == guidance_h.mode) {
148  return;
149  }
150 
151  switch (new_mode) {
154  break;
155 
156 #if USE_STABILIZATION_RATE
159  break;
160 #endif
161 
164  /* Falls through. */
167 #if NO_ATTITUDE_RESET_ON_MODE_CHANGE
168  /* reset attitude stabilization if previous mode was not using it */
172 #endif
174  break;
175 
179 #if NO_ATTITUDE_RESET_ON_MODE_CHANGE
180  /* reset attitude stabilization if previous mode was not using it */
184 #endif
186  break;
187 
188 #if GUIDANCE_H_MODE_MODULE_SETTING == GUIDANCE_H_MODE_MODULE
191  break;
192 #endif
193 
194  case GUIDANCE_H_MODE_NAV:
196 #if NO_ATTITUDE_RESET_ON_MODE_CHANGE
197  /* reset attitude stabilization if previous mode was not using it */
201 #endif
203  break;
204 
207  break;
208 
209  default:
210  break;
211  }
212 
213  guidance_h.mode = new_mode;
214 
215 }
216 
217 
218 void guidance_h_read_rc(bool in_flight)
219 {
220 
221  switch (guidance_h.mode) {
222 
225  break;
226 
227 #if USE_STABILIZATION_RATE
229 #if SWITCH_STICKS_FOR_RATE_CONTROL
231 #else
233 #endif
234  break;
235 #endif
236 
239  break;
242  break;
245  break;
248 #if GUIDANCE_H_USE_SPEED_REF
250  /* enable x,y velocity setpoints */
251  SetBit(guidance_h.sp.mask, 5);
252 #endif
253  break;
254 
255 #if GUIDANCE_H_MODE_MODULE_SETTING == GUIDANCE_H_MODE_MODULE
258  break;
259 #endif
260 
261  case GUIDANCE_H_MODE_NAV:
262  if (radio_control.status == RC_OK) {
264  } else {
266  }
267  break;
270  break;
271  default:
272  break;
273  }
274 
275 }
276 
277 void guidance_h_run(bool in_flight)
278 {
279  switch (guidance_h.mode) {
280 
282  stabilization_none_run(in_flight);
283  break;
284 
285 #if USE_STABILIZATION_RATE
287  stabilization_rate_run(in_flight);
288  break;
289 #endif
290 
293  transition_run(true);
294  }
295  /* Falls through. */
299  transition_run(false);
300  }
301  stabilization_attitude_run(in_flight);
302 #if (STABILIZATION_FILTER_CMD_ROLL_PITCH || STABILIZATION_FILTER_CMD_YAW)
303  if (in_flight) {
305  }
306 #endif
307 
308  break;
309 
311  /* set psi command from RC */
313  /* fall trough to GUIDED to update ref, run traj and set final attitude setpoint */
314 
315  /* Falls through. */
317  guidance_h_guided_run(in_flight);
318  break;
319 
320  case GUIDANCE_H_MODE_NAV:
321  guidance_h_from_nav(in_flight);
322  break;
323 
324 #if GUIDANCE_H_MODE_MODULE_SETTING == GUIDANCE_H_MODE_MODULE
326  guidance_h_module_run(in_flight);
327  break;
328 #endif
329 
332  break;
333 
334  default:
335  break;
336  }
337 }
338 
339 
341 {
342  /* compute reference even if usage temporarily disabled via guidance_h_use_ref */
343 #if GUIDANCE_H_USE_REF
344  if (bit_is_set(guidance_h.sp.mask, 5)) {
345  struct FloatVect2 sp_speed;
346  sp_speed.x = SPEED_FLOAT_OF_BFP(guidance_h.sp.speed.x);
347  sp_speed.y = SPEED_FLOAT_OF_BFP(guidance_h.sp.speed.y);
348  gh_update_ref_from_speed_sp(sp_speed);
349  } else {
351  }
352 #endif
353 
354  /* either use the reference or simply copy the pos setpoint */
355  if (guidance_h.use_ref) {
356  /* convert our reference to generic representation */
362  } else {
367  } else { //(nav.setpoint_mode == NAV_SETPOINT_MODE_SPEED)
372  guidance_h.ref.accel.x = 0;
373  guidance_h.ref.accel.y = 0;
374  } // TODO: make accel ref set
375  }
376 
377 #if GUIDANCE_H_USE_SPEED_REF
379  VECT2_COPY(guidance_h.sp.pos, guidance_h.ref.pos); // for display only
380  }
381 #endif
382 
383  /* update heading setpoint from rate */
384  if (bit_is_set(guidance_h.sp.mask, 7)) {
385  guidance_h.sp.heading += guidance_h.sp.heading_rate / PERIODIC_FREQUENCY;
387  }
388 }
389 
391 {
392  /* reset speed setting */
393  guidance_h.sp.speed.x = 0;
394  guidance_h.sp.speed.y = 0;
395 
396  /* set horizontal setpoint to current position */
400  /* reset guidance reference */
402 
403  /* set guidance to current heading and position */
406 
407  /* call specific implementation */
409 }
410 
412 {
413  /* horizontal position setpoint from navigation/flightplan */
416 
417  /* call specific implementation */
420 }
421 
422 void guidance_h_from_nav(bool in_flight)
423 {
424  if (!in_flight) {
426  }
427 
429  stabilization_cmd[COMMAND_ROLL] = nav.cmd_roll;
430  stabilization_cmd[COMMAND_PITCH] = nav.cmd_pitch;
431  stabilization_cmd[COMMAND_YAW] = nav.cmd_yaw;
434  // directly apply quat setpoint
435  struct Int32Quat quat_i;
436  QUAT_BFP_OF_REAL(quat_i, nav.quat);
438  stabilization_attitude_run(in_flight);
439  }
440  else {
441  // it should be nav.setpoint_mode == NAV_SETPOINT_MODE_ATTITUDE
442  // TODO error handling ?
443  struct Int32Eulers sp_cmd_i;
444  sp_cmd_i.phi = ANGLE_BFP_OF_REAL(nav.roll);
445  sp_cmd_i.theta = ANGLE_BFP_OF_REAL(nav.pitch);
446  sp_cmd_i.psi = ANGLE_BFP_OF_REAL(nav.heading);
448  stabilization_attitude_run(in_flight);
449  }
451  guidance_h_guided_run(in_flight);
452  } else {
453  // update carrot for display, even if sp is changed in speed mode
455  switch (nav.setpoint_mode) {
457  // set guidance in NED
461  break;
462 
464  guidance_h_set_vel(nav.speed.y, nav.speed.x); // nav speed is in ENU frame, convert to NED
468  break;
469 
471  // TODO set_accel ref
474  break;
475 
476  default:
477  // nothing to do for other cases at the moment
478  break;
479  }
480  /* set final attitude setpoint */
482  stabilization_attitude_run(in_flight);
483 
484  }
485 }
486 
487 static inline void transition_run(bool to_forward)
488 {
489  if (to_forward) {
490  //Add 0.00625%
492  } else {
493  //Subtract 0.00625%
495  }
496 
497 #ifdef TRANSITION_MAX_OFFSET
498  const int32_t max_offset = ANGLE_BFP_OF_REAL(TRANSITION_MAX_OFFSET);
500  max_offset, INT32_ANGLE_FRAC);
501 #endif
502 }
503 
505 static void read_rc_setpoint_speed_i(struct Int32Vect2 *speed_sp, bool in_flight)
506 {
507  if (in_flight) {
508  // negative pitch is forward
509  int64_t rc_x = -radio_control.values[RADIO_PITCH];
510  int64_t rc_y = radio_control.values[RADIO_ROLL];
511  DeadBand(rc_x, MAX_PPRZ / 20);
512  DeadBand(rc_y, MAX_PPRZ / 20);
513 
514  // convert input from MAX_PPRZ range to SPEED_BFP
517  //int32_t rc_norm = sqrtf(rc_x * rc_x + rc_y * rc_y);
518  //int32_t max_pprz = rc_norm * MAX_PPRZ / Max(abs(rc_x), abs(rc_y);
519  rc_x = rc_x * max_speed / MAX_PPRZ;
520  rc_y = rc_y * max_speed / MAX_PPRZ;
521 
522  /* Rotate from body to NED frame by negative psi angle */
524  int32_t s_psi, c_psi;
525  PPRZ_ITRIG_SIN(s_psi, psi);
526  PPRZ_ITRIG_COS(c_psi, psi);
527  speed_sp->x = (int32_t)(((int64_t)c_psi * rc_x + (int64_t)s_psi * rc_y) >> INT32_TRIG_FRAC);
528  speed_sp->y = (int32_t)((-(int64_t)s_psi * rc_x + (int64_t)c_psi * rc_y) >> INT32_TRIG_FRAC);
529  } else {
530  speed_sp->x = 0;
531  speed_sp->y = 0;
532  }
533 }
534 
535 void guidance_h_guided_run(bool in_flight)
536 {
537  /* guidance_h.sp.pos and guidance_h.sp.heading need to be set from external source */
538  if (!in_flight) {
540  }
541 
543 
545  /* set final attitude setpoint */
547  stabilization_attitude_run(in_flight);
548 }
549 
550 void guidance_h_set_pos(float x, float y)
551 {
552  ClearBit(guidance_h.sp.mask, 5);
555 }
556 
558 {
559  ClearBit(guidance_h.sp.mask, 7);
562 }
563 
564 void guidance_h_set_body_vel(float vx, float vy)
565 {
566  float psi = stateGetNedToBodyEulers_f()->psi;
567  float newvx = cosf(-psi) * vx + sinf(-psi) * vy;
568  float newvy = -sinf(-psi) * vx + cosf(-psi) * vy;
569  guidance_h_set_vel(newvx, newvy);
570 }
571 
572 void guidance_h_set_vel(float vx, float vy)
573 {
574  SetBit(guidance_h.sp.mask, 5);
577 }
578 
580 {
581  SetBit(guidance_h.sp.mask, 7);
582  guidance_h.sp.heading_rate = rate;
583 }
584 
void guidance_h_module_read_rc(void)
void guidance_h_module_run(bool in_flight)
void guidance_h_module_init(void)
void guidance_h_module_enter(void)
float psi
in radians
#define FLOAT_ANGLE_NORMALIZE(_a)
#define FLOAT_EULERS_ZERO(_e)
#define FLOAT_VECT2_ZERO(_v)
#define VECT2_COPY(_a, _b)
Definition: pprz_algebra.h:68
#define QUAT_BFP_OF_REAL(_qi, _qf)
Definition: pprz_algebra.h:752
int32_t phi
in rad with INT32_ANGLE_FRAC
int32_t psi
in rad with INT32_ANGLE_FRAC
int32_t theta
in rad with INT32_ANGLE_FRAC
#define INT_MULT_RSHIFT(_a, _b, _r)
#define INT32_POS_FRAC
#define ANGLE_BFP_OF_REAL(_af)
#define INT32_PERCENTAGE_FRAC
#define ACCEL_BFP_OF_REAL(_af)
#define INT32_TRIG_FRAC
#define SPEED_FLOAT_OF_BFP(_ai)
#define INT32_ANGLE_FRAC
#define INT_VECT2_ZERO(_v)
#define INT32_VECT2_RSHIFT(_o, _i, _r)
#define POS_BFP_OF_REAL(_af)
#define SPEED_BFP_OF_REAL(_af)
euler angles
Rotation quaternion.
int32_t y
East.
int32_t x
North.
vector in North East Down coordinates
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
Definition: state.h:1125
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Definition: state.h:1143
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
Definition: state.h:710
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
Definition: state.h:665
static struct NedCoor_i * stateGetSpeedNed_i(void)
Get ground speed in local NED coordinates (int).
Definition: state.h:863
void guidance_flip_run(void)
Definition: guidance_flip.c:65
void guidance_flip_enter(void)
Definition: guidance_flip.c:56
Open Loop guidance for making a flip.
void gh_set_ref(struct Int32Vect2 pos, struct FloatVect2 speed, struct FloatVect2 accel)
void gh_ref_init(void)
void gh_update_ref_from_pos_sp(struct Int32Vect2 pos_sp)
void gh_update_ref_from_speed_sp(struct FloatVect2 speed_sp)
struct GuidanceHRef gh_ref
#define GH_POS_REF_FRAC
fixedpoint representation: Q26.37 will give a range of 67e3 km and a resolution of 1....
struct FloatVect2 accel
Reference model acceleration.
#define GUIDANCE_H_REF_MAX_SPEED
Default speed saturation.
struct Int64Vect2 pos
Reference model position.
struct FloatVect2 speed
Reference model speed.
Guidance controllers (horizontal and vertical) for Hybrid UAV configurations.
struct FloatVect3 speed_sp
Definition: guidance_indi.c:77
Guidance in a module file.
#define MAX_PPRZ
Definition: paparazzi.h:8
float y
in meters
float x
in meters
#define PPRZ_ITRIG_SIN(_s, _a)
#define PPRZ_ITRIG_COS(_c, _a)
struct RadioControl radio_control
Definition: radio_control.c:33
Generic interface for radio control modules.
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:67
uint8_t status
Definition: radio_control.h:61
#define RC_OK
Definition: radio_control.h:49
int32_t transition_percentage
Definition: guidance_h.c:52
struct StabilizationSetpoint guidance_h_cmd
horizontal guidance command.
Definition: guidance_h.c:57
void guidance_h_read_rc(bool in_flight)
Definition: guidance_h.c:218
void guidance_h_set_pos(float x, float y)
Set horizontal position setpoint.
Definition: guidance_h.c:550
void guidance_h_mode_changed(uint8_t new_mode)
Definition: guidance_h.c:145
static void send_href(struct transport_tx *trans, struct link_device *dev)
Definition: guidance_h.c:75
static void send_gh(struct transport_tx *trans, struct link_device *dev)
Definition: guidance_h.c:66
void guidance_h_hover_enter(void)
Definition: guidance_h.c:390
static void send_tune_hover(struct transport_tx *trans, struct link_device *dev)
Definition: guidance_h.c:86
void guidance_h_guided_run(bool in_flight)
Run GUIDED mode control.
Definition: guidance_h.c:535
void guidance_h_from_nav(bool in_flight)
Set horizontal guidance from NAV and run control loop.
Definition: guidance_h.c:422
void guidance_h_set_heading(float heading)
Set heading setpoint.
Definition: guidance_h.c:557
void guidance_h_init(void)
Definition: guidance_h.c:103
struct HorizontalGuidance guidance_h
Definition: guidance_h.c:50
static void read_rc_setpoint_speed_i(struct Int32Vect2 *speed_sp, bool in_flight)
read speed setpoint from RC
Definition: guidance_h.c:505
void guidance_h_nav_enter(void)
Definition: guidance_h.c:411
static void guidance_h_update_reference(void)
Definition: guidance_h.c:340
void guidance_h_set_vel(float vx, float vy)
Set horizontal velocity setpoint.
Definition: guidance_h.c:572
void guidance_h_set_body_vel(float vx, float vy)
Set body relative horizontal velocity setpoint.
Definition: guidance_h.c:564
static void reset_guidance_reference_from_current_position(void)
Definition: guidance_h.c:131
static void transition_run(bool to_forward)
Definition: guidance_h.c:487
void guidance_h_set_heading_rate(float rate)
Set heading rate setpoint.
Definition: guidance_h.c:579
void guidance_h_run(bool in_flight)
Definition: guidance_h.c:277
Horizontal guidance for rotorcrafts.
#define GUIDANCE_H_MODE_FORWARD
Definition: guidance_h.h:63
#define GUIDANCE_H_MODE_NAV
Definition: guidance_h.h:60
#define GUIDANCE_H_USE_REF
Use horizontal guidance reference trajectory.
Definition: guidance_h.h:45
struct Int32Vect2 accel
with INT32_ACCEL_FRAC
Definition: guidance_h.h:90
uint8_t mask
bit 5: vx & vy, bit 6: vz, bit 7: vyaw
Definition: guidance_h.h:84
void guidance_h_run_enter(void)
#define GUIDANCE_H_MODE_HOVER
Definition: guidance_h.h:59
struct StabilizationSetpoint guidance_h_run_pos(bool in_flight, struct HorizontalGuidance *gh)
struct Int32Vect2 pos
horizontal position setpoint in NED.
Definition: guidance_h.h:80
struct Int32Vect2 speed
with INT32_SPEED_FRAC
Definition: guidance_h.h:89
struct FloatEulers rc_sp
remote control setpoint
Definition: guidance_h.h:101
#define GUIDANCE_H_MODE_ATTITUDE
Definition: guidance_h.h:58
struct StabilizationSetpoint guidance_h_run_speed(bool in_flight, struct HorizontalGuidance *gh)
#define GUIDANCE_H_MODE_GUIDED
Definition: guidance_h.h:66
#define GUIDANCE_H_MODE_RC_DIRECT
Definition: guidance_h.h:61
struct Int32Vect2 pos
with INT32_POS_FRAC
Definition: guidance_h.h:88
struct HorizontalGuidanceReference ref
reference calculated from setpoints
Definition: guidance_h.h:99
#define GUIDANCE_H_USE_SPEED_REF
Use horizontal guidance speed reference.
Definition: guidance_h.h:53
#define GUIDANCE_H_MODE_CARE_FREE
Definition: guidance_h.h:62
struct StabilizationSetpoint guidance_h_run_accel(bool in_flight, struct HorizontalGuidance *gh)
struct Int32Vect2 speed
only used in HOVER mode if GUIDANCE_H_USE_SPEED_REF or in GUIDED mode
Definition: guidance_h.h:81
#define GUIDANCE_H_MODE_KILL
Definition: guidance_h.h:56
#define GUIDANCE_H_MODE_RATE
Definition: guidance_h.h:57
struct HorizontalGuidanceSetpoint sp
setpoints
Definition: guidance_h.h:98
#define GUIDANCE_H_MODE_FLIP
Definition: guidance_h.h:65
#define GUIDANCE_H_MODE_MODULE
Definition: guidance_h.h:64
Vertical guidance for rotorcrafts.
struct RotorcraftNavigation nav
Definition: navigation.c:51
Rotorcraft navigation functions.
#define NAV_SETPOINT_MODE_QUAT
Definition: navigation.h:104
struct EnuCoor_f speed
speed setpoint (in m/s)
Definition: navigation.h:128
int32_t cmd_pitch
pitch command (in pprz_t)
Definition: navigation.h:132
int32_t cmd_roll
roll command (in pprz_t)
Definition: navigation.h:131
int32_t cmd_yaw
yaw command (in pprz_t)
Definition: navigation.h:133
#define NAV_SETPOINT_MODE_SPEED
Definition: navigation.h:101
struct FloatQuat quat
quaternion setpoint
Definition: navigation.h:137
#define NAV_SETPOINT_MODE_ACCEL
Definition: navigation.h:102
#define NAV_HORIZONTAL_MODE_GUIDED
Definition: navigation.h:90
#define NAV_HORIZONTAL_MODE_ATTITUDE
Definition: navigation.h:88
float pitch
pitch angle (in radians)
Definition: navigation.h:135
float heading
heading setpoint (in radians)
Definition: navigation.h:136
struct EnuCoor_f carrot
carrot position (also used for GCS display)
Definition: navigation.h:127
#define NAV_SETPOINT_MODE_POS
Nav setpoint modes these modes correspond to submodes defined by navigation routines to tell which se...
Definition: navigation.h:100
#define NAV_HORIZONTAL_MODE_MANUAL
Definition: navigation.h:89
float roll
roll angle (in radians)
Definition: navigation.h:134
General attitude stabilization interface for rotorcrafts.
void stabilization_attitude_enter(void)
void stabilization_attitude_set_quat_setpoint_i(struct Int32Quat *quat)
void stabilization_attitude_set_stab_sp(struct StabilizationSetpoint *sp)
void stabilization_attitude_set_rpy_setpoint_i(struct Int32Eulers *rpy)
void stabilization_attitude_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
void stabilization_attitude_run(bool in_flight)
void stabilization_filter_commands(void)
int32_t stabilization_cmd[COMMANDS_NB]
Stabilization commands.
Definition: stabilization.c:34
General stabilization interface for rotorcrafts.
void stabilization_attitude_reset_care_free_heading(void)
reset the heading for care-free mode to current heading
int32_t transition_theta_offset
void stabilization_attitude_read_rc_setpoint_eulers_f(struct FloatEulers *sp, bool in_flight, bool in_carefree, bool coordinated_turn)
Read an attitude setpoint from the RC.
void stabilization_none_read_rc(void)
void stabilization_none_enter(void)
void stabilization_none_run(bool in_flight)
Dummy stabilization for rotorcrafts.
void stabilization_rate_read_rc(void)
void stabilization_rate_enter(void)
void stabilization_rate_read_rc_switched_sticks(void)
void stabilization_rate_run(bool in_flight)
Rate stabilization for rotorcrafts.
API to get/set the generic vehicle states.
#define TRUE
Definition: std.h:4
#define FALSE
Definition: std.h:5
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
Stabilization setpoint.
Definition: stabilization.h:42
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition: telemetry.c:51
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
Definition: telemetry.h:66
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
float heading
Definition: wedgebug.c:258