Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_direct.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-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 
31 
33 #include "generated/airframe.h"
34 #include "generated/modules.h"
35 
37 
39 {
41 }
42 
44 {
45 #ifdef RADIO_CONTROL
49 #endif
50 }
51 
53 {
55 }
56 
58  struct ThrustSetpoint *thrust UNUSED, int32_t *cmd UNUSED)
59 {
60  /* just directly pass rc commands through */
61 #ifdef COMMAND_ROLL
62  cmd[COMMAND_ROLL] = stabilization_direct_rc_cmd.p;
63 #endif
64 #ifdef COMMAND_PITCH
65  cmd[COMMAND_PITCH] = stabilization_direct_rc_cmd.q;
66 #endif
67 #ifdef COMMAND_YAW
68  cmd[COMMAND_YAW] = stabilization_direct_rc_cmd.r;
69 #endif
70 #ifdef COMMAND_THRUST
71  cmd[COMMAND_THRUST] = th_sp_to_thrust_i(thrust, 0, THRUST_AXIS_Z);
72 #endif
73 }
uint8_t last_wp UNUSED
int32_t p
in rad/s with INT32_RATE_FRAC
int32_t r
in rad/s with INT32_RATE_FRAC
int32_t q
in rad/s with INT32_RATE_FRAC
#define INT_RATES_ZERO(_e)
angular rates
Generic interface for radio control modules.
static pprz_t radio_control_get(uint8_t idx)
Get a radio control channel value.
Definition: radio_control.h:94
int32_t th_sp_to_thrust_i(struct ThrustSetpoint *th, int32_t thrust, uint8_t axis)
General stabilization interface for rotorcrafts.
#define THRUST_AXIS_Z
void stabilization_direct_read_rc(void)
void stabilization_direct_init(void)
void stabilization_direct_enter(void)
void stabilization_direct_run(bool in_flight UNUSED, struct StabilizationSetpoint *sp UNUSED, struct ThrustSetpoint *thrust UNUSED, int32_t *cmd UNUSED)
struct Int32Rates stabilization_direct_rc_cmd
Dummy stabilization for rotorcrafts.
Stabilization setpoint.
Definition: stabilization.h:53
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
Definition: stabilization.h:82
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83