Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
actuators_pwm_supervision.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2012 The Paparazzi Team
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 
26 #include "generated/airframe.h"
30 
31 /* warn if SUPERVISION_STOP_MOTOR is not define in the airframe file */
32 #ifndef SUPERVISION_STOP_MOTOR
33 #warning "STOP_MOTOR is not defined in the SUPERVISION section, are you sure you want to use the default of 0?"
34 #endif
35 
37 
38 /* let's start butchery now and use the actuators_pwm arch functions */
40 
41 #define actuators actuators_pwm_values
42 #define Actuator(_x) actuators_pwm_values[_x]
43 #define ActuatorsCommit() {}
44 
47 
48 void actuators_init(void)
49 {
52 }
53 
54 void actuators_set(bool_t motors_on) {
55 
56  /* set normal control surface actuators, i.e. servos */
57  SetActuatorsFromCommands(commands);
58 
59  /* run supervision for actuators (motor controllers) that need mixing */
60  supervision_run(motors_on, FALSE, commands);
61 
62  for (int i = 0; i < SUPERVISION_NB_MOTOR; i++) {
64  }
66 
67 }
68 
PWM actuators with supervision.
void supervision_run(bool_t motors_on, bool_t override_on, int32_t in_cmd[])
Definition: supervision.c:142
int32_t actuators_pwm_values[ACTUATORS_PWM_NB]
actuator PWM values in usec.
#define FALSE
Definition: imu_chimu.h:141
void supervision_init(void)
Definition: supervision.c:68
void actuators_init(void)
void actuators_pwm_arch_init(void)
signed long int32_t
Definition: types.h:19
pprz_t commands[COMMANDS_NB]
Definition: commands.c:42
int32_t commands[SUPERVISION_NB_MOTOR]
Definition: supervision.h:35
void actuators_set(bool_t motors_on)
#define ACTUATORS_PWM_NB
struct Supervision supervision
Definition: supervision.c:66
void actuators_pwm_commit(void)