Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
commands.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * (c) 2009 Antoine Drouin <poinix@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, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  *
22  */
23 
24 #ifndef COMMANDS_H
25 #define COMMANDS_H
26 
27 #include "paparazzi.h"
28 #include "generated/airframe.h"
29 
30 extern int32_t commands[COMMANDS_NB];
31 extern const int32_t commands_failsafe[COMMANDS_NB];
32 
33 #ifndef ROTORCRAFT_COMMANDS_YAW_ALWAYS_ENABLED
34 #define SetCommands(_in_cmd, _in_flight, _motors_on) { \
35  commands[COMMAND_PITCH] = _in_cmd[COMMAND_PITCH]; \
36  commands[COMMAND_ROLL] = _in_cmd[COMMAND_ROLL]; \
37  commands[COMMAND_YAW] = (_in_flight) ? _in_cmd[COMMAND_YAW] : 0; \
38  commands[COMMAND_THRUST] = (_motors_on) ? _in_cmd[COMMAND_THRUST] : 0; \
39  }
40 #else
41 #define SetCommands(_in_cmd, _in_flight, _motors_on) { \
42  commands[COMMAND_PITCH] = _in_cmd[COMMAND_PITCH]; \
43  commands[COMMAND_ROLL] = _in_cmd[COMMAND_ROLL]; \
44  commands[COMMAND_YAW] = _in_cmd[COMMAND_YAW]; \
45  commands[COMMAND_THRUST] = (_motors_on) ? _in_cmd[COMMAND_THRUST] : 0; \
46  }
47 #endif
48 
49 #endif /* COMMANDS_H */
pprz_t commands[COMMANDS_NB]
Definition: commands.c:48
const pprz_t commands_failsafe[COMMANDS_NB]
Definition: commands.c:49
signed long int32_t
Definition: types.h:19