Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ctrl_module_outerloop_demo.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015
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 
28 #include "state.h"
33 #include "autopilot.h"
34 
35 // Own Variables
36 
38 // RC Inputs
40 
41 // Output command
42  struct Int32Eulers cmd;
43 
44 } ctrl;
45 
46 
47 // Settings
48 float comode_time = 0;
49 
50 
52 // Call our controller
53 // Implement own Horizontal loops
55 {
56 }
57 
59 {
60  // Store current heading
62 
63  // Convert RC to setpoint
65 }
66 
68 {
70 }
71 
72 
73 void guidance_h_module_run(bool in_flight)
74 {
75  // YOUR NEW HORIZONTAL OUTERLOOP CONTROLLER GOES HERE
76  // ctrl.cmd = CallMyNewHorizontalOuterloopControl(ctrl);
77  float roll = 0.0;
78  float pitch = 0.0;
79 
80  ctrl.cmd.phi = ANGLE_BFP_OF_REAL(roll);
82 
84  stabilization_attitude_run(in_flight);
85 
86  // Alternatively, use the indi_guidance and send AbiMsgACCEL_SP to it instead of setting pitch and roll
87 }
88 
Int32Eulers::theta
int32_t theta
in rad with INT32_ANGLE_FRAC
Definition: pprz_algebra_int.h:148
radio_control.h
stabilization_attitude.h
guidance_h_module_read_rc
void guidance_h_module_read_rc(void)
Definition: ctrl_module_outerloop_demo.c:67
guidance_h_module_enter
void guidance_h_module_enter(void)
Definition: ctrl_module_outerloop_demo.c:58
guidance_h_module_init
void guidance_h_module_init(void)
Definition: ctrl_module_outerloop_demo.c:54
ctrl_module_demo_struct
Definition: ctrl_module_innerloop_demo.c:32
ctrl
struct ctrl_module_demo_struct ctrl
Int32Eulers::psi
int32_t psi
in rad with INT32_ANGLE_FRAC
Definition: pprz_algebra_int.h:149
comode_time
float comode_time
Definition: ctrl_module_outerloop_demo.c:48
Int32Eulers::phi
int32_t phi
in rad with INT32_ANGLE_FRAC
Definition: pprz_algebra_int.h:147
autopilot
struct pprz_autopilot autopilot
Global autopilot structure.
Definition: autopilot.c:50
pprz_autopilot::in_flight
bool in_flight
in flight status
Definition: autopilot.h:70
ANGLE_BFP_OF_REAL
#define ANGLE_BFP_OF_REAL(_af)
Definition: pprz_algebra_int.h:210
guidance_h_module_run
void guidance_h_module_run(bool in_flight)
Definition: ctrl_module_outerloop_demo.c:73
ctrl_module_demo_struct::rc_sp
struct Int32Eulers rc_sp
Definition: ctrl_module_outerloop_demo.c:39
stabilization_attitude_rc_setpoint.h
Int32Eulers
euler angles
Definition: pprz_algebra_int.h:146
stabilization_attitude_run
void stabilization_attitude_run(bool in_flight)
Definition: stabilization_attitude_euler_float.c:176
autopilot.h
ctrl_module_outerloop_demo.h
example empty controller
ctrl_module_demo_struct::cmd
struct Int32Eulers cmd
Definition: ctrl_module_outerloop_demo.c:42
stabilization_attitude_read_rc_setpoint_eulers
void stabilization_attitude_read_rc_setpoint_eulers(struct Int32Eulers *sp, bool in_flight, bool in_carefree, bool coordinated_turn)
Read attitude setpoint from RC as euler angles.
Definition: stabilization_attitude_rc_setpoint.c:173
stabilization_attitude_set_rpy_setpoint_i
void stabilization_attitude_set_rpy_setpoint_i(struct Int32Eulers *rpy)
Definition: stabilization_attitude_euler_float.c:154
stateGetNedToBodyEulers_i
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
Definition: state.h:1125
stabilization.h
state.h