Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
autopilot_utils.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Gautier Hattenberger <gautier.hattenberger@enac.fr>
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, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
29 #include "autopilot.h"
31 #include "state.h"
33 
35 PRINT_CONFIG_VAR(FAILSAFE_DESCENT_SPEED)
36 
37 #define THRESHOLD_1_PPRZ (MIN_PPRZ / 2)
38 #define THRESHOLD_2_PPRZ (MAX_PPRZ / 2)
39 
42 {
44  return MODE_AUTO2;
46  return MODE_AUTO1;
47  } else {
48  return MODE_MANUAL;
49  }
50 }
51 
Core autopilot interface common to all firmwares.
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
Some helper functions to check RC sticks.
#define MODE_AUTO2
#define MODE_AUTO1
#define MODE_MANUAL
Default RC mode.
uint8_t ap_mode_of_3way_switch(void)
get autopilot mode as set by RADIO_MODE 3-way switch
Utility functions and includes for autopilots.
#define FAILSAFE_DESCENT_SPEED
Set descent speed in failsafe mode.
#define THRESHOLD_2_PPRZ
#define THRESHOLD_1_PPRZ
Display descent speed in failsafe mode if needed.
API to get/set the generic vehicle states.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98