Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
throttle_curve.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 C. De Wagter
3  * 2015 Freek van Tienen <freek.v.tienen@gmail.com>
4  *
5  * This file is part of paparazzi
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, see
19  * <http://www.gnu.org/licenses/>.
20  */
27 #ifndef THROTTLE_CURVE_H
28 #define THROTTLE_CURVE_H
29 
30 #include "std.h"
31 #include "paparazzi.h"
32 #include "generated/airframe.h"
33 
34 /* Throttle and collective curve */
35 struct curve_t {
37  uint16_t throttle[THROTTLE_POINTS_NB];
38  int16_t collective[THROTTLE_POINTS_NB];
39 };
40 
41 /* Main throttle curve structure */
45  struct curve_t curves[THROTTLE_CURVES_NB];
46 
49 };
50 extern struct throttle_curve_t throttle_curve;
51 
52 /* External functions */
53 extern void throttle_curve_init(void);
54 void throttle_curve_run(bool motors_on, pprz_t in_cmd[]);
56 
57 #endif
void nav_throttle_curve_set(uint8_t mode)
Set a specific throttle curve based on the mode given with this function.
unsigned short uint16_t
Definition: types.h:16
struct curve_t curves[THROTTLE_CURVES_NB]
Throttle/pitch curves.
void throttle_curve_run(bool motors_on, pprz_t in_cmd[])
Run the throttle curve and generate the output throttle and pitch This depends on the FMODE(flight mo...
int16_t pprz_t
Definition: paparazzi.h:6
struct throttle_curve_t throttle_curve
uint8_t nb_points
The number of points in the curve.
uint8_t mode
Flight mode.
uint16_t throttle
Output thrust(throttle) of the throttle curve.
signed short int16_t
Definition: types.h:17
int16_t collective[THROTTLE_POINTS_NB]
The collective points in the curve.
unsigned char uint8_t
Definition: types.h:14
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
Definition: sonar_bebop.c:66
uint8_t nb_curves
The number of throttle/pitch curves.
void throttle_curve_init(void)
Initialize the default throttle curve values.
uint16_t throttle[THROTTLE_POINTS_NB]
Throttle points in the curve.
int16_t collective
Output collective of the throttle curve.