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
guidance_h.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
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 
27 #ifndef GUIDANCE_H_H
28 #define GUIDANCE_H_H
29 
30 
31 #include "math/pprz_algebra_int.h"
32 
34 
35 #define GUIDANCE_H_MODE_KILL 0
36 #define GUIDANCE_H_MODE_RATE 1
37 #define GUIDANCE_H_MODE_ATTITUDE 2
38 #define GUIDANCE_H_MODE_HOVER 3
39 #define GUIDANCE_H_MODE_NAV 4
40 #define GUIDANCE_H_MODE_RC_DIRECT 5
41 
42 
44 
49 extern struct Int32Vect2 guidance_h_pos_sp;
50 
51 extern struct Int32Vect2 guidance_h_pos_ref;
52 extern struct Int32Vect2 guidance_h_speed_ref;
53 extern struct Int32Vect2 guidance_h_accel_ref;
54 
55 extern struct Int32Vect2 guidance_h_pos_err;
56 extern struct Int32Vect2 guidance_h_speed_err;
58 extern struct Int32Vect2 guidance_h_nav_err;
59 
60 extern struct Int32Eulers guidance_h_rc_sp;
63 
68 
69 
70 extern void guidance_h_init(void);
71 extern void guidance_h_mode_changed(uint8_t new_mode);
72 extern void guidance_h_read_rc(bool_t in_flight);
73 extern void guidance_h_run(bool_t in_flight);
74 
75 
76 #define guidance_h_SetKi(_val) { \
77  guidance_h_igain = _val; \
78  INT_VECT2_ZERO(guidance_h_pos_err_sum); \
79  }
80 
81 #endif /* GUIDANCE_H_H */
int32_t guidance_h_dgain
Definition: guidance_h.c:57
int32_t guidance_h_pgain
Definition: guidance_h.c:56
struct Int32Eulers guidance_h_command_body
with INT32_ANGLE_FRAC
Definition: guidance_h.c:54
void guidance_h_mode_changed(uint8_t new_mode)
Definition: guidance_h.c:109
int32_t guidance_h_again
Definition: guidance_h.c:59
void guidance_h_run(bool_t in_flight)
Definition: guidance_h.c:178
struct Int32Vect2 guidance_h_pos_sp
horizontal position setpoint in NED.
Definition: guidance_h.c:41
struct Int32Eulers guidance_h_rc_sp
with INT32_ANGLE_FRAC
Definition: guidance_h.c:51
struct Int32Vect2 guidance_h_pos_err
Definition: guidance_h.c:46
struct Int32Vect2 guidance_h_nav_err
Definition: guidance_h.c:49
void guidance_h_read_rc(bool_t in_flight)
Definition: guidance_h.c:143
struct Int32Vect2 guidance_h_command_earth
Definition: guidance_h.c:52
struct Int32Vect2 guidance_h_speed_err
Definition: guidance_h.c:47
struct Int32Vect2 guidance_h_pos_err_sum
Definition: guidance_h.c:48
signed long int32_t
Definition: types.h:19
struct Int32Vect2 guidance_h_speed_ref
Definition: guidance_h.c:43
void guidance_h_init(void)
Definition: guidance_h.c:94
unsigned char uint8_t
Definition: types.h:14
uint8_t guidance_h_mode
Definition: guidance_h.c:39
struct Int32Vect2 guidance_h_accel_ref
Definition: guidance_h.c:44
struct Int32Vect2 guidance_h_pos_ref
Definition: guidance_h.c:42
int32_t guidance_h_igain
Definition: guidance_h.c:58
Paparazzi fixed point algebra.
euler angles