Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
guidance_h_ref.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2013 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 
27 #ifndef GUIDANCE_H_REF_H
28 #define GUIDANCE_H_REF_H
29 
30 #include "inttypes.h"
31 #include "math/pprz_algebra.h"
32 #include "math/pprz_algebra_int.h"
33 #include "generated/airframe.h"
34 
36 #ifndef GUIDANCE_H_REF_MAX_SPEED
37 #define GUIDANCE_H_REF_MAX_SPEED 5.
38 #endif
39 
43 extern float gh_max_speed;
44 
48 #ifndef GUIDANCE_H_REF_MAX_ACCEL
49 #define GUIDANCE_H_REF_MAX_ACCEL 5.66
50 #endif
51 
54 #define GH_FREQ_FRAC 9
55 #define GH_FREQ (1<<GH_FREQ_FRAC)
56 
62 extern struct Int32Vect2 gh_accel_ref;
63 #define GH_ACCEL_REF_FRAC 8
64 
70 extern struct Int32Vect2 gh_speed_ref;
71 #define GH_SPEED_REF_FRAC (GH_ACCEL_REF_FRAC + GH_FREQ_FRAC)
72 
73 /* Reference model position.
74  * in meters
75  * with fixedpoint representation: Q37.26
76  */
77 extern struct Int64Vect2 gh_pos_ref;
78 #define GH_POS_REF_FRAC (GH_SPEED_REF_FRAC + GH_FREQ_FRAC)
79 
80 extern void gh_set_ref(struct Int32Vect2 pos, struct Int32Vect2 speed, struct Int32Vect2 accel);
81 extern void gh_update_ref_from_pos_sp(struct Int32Vect2 pos_sp);
82 extern void gh_update_ref_from_speed_sp(struct Int32Vect2 speed_sp);
83 
89 extern float gh_set_max_speed(float max_speed);
90 
91 #endif /* GUIDANCE_H_REF_H */
struct Int64Vect2 gh_pos_ref
struct Int32Vect2 gh_accel_ref
Reference model acceleration.
float gh_max_speed
Current maximum speed for waypoint navigation.
struct Int32Vect2 gh_speed_ref
Reference model speed.
void gh_update_ref_from_pos_sp(struct Int32Vect2 pos_sp)
void gh_update_ref_from_speed_sp(struct Int32Vect2 speed_sp)
float gh_set_max_speed(float max_speed)
Set a new maximum speed for waypoint navigation.
void gh_set_ref(struct Int32Vect2 pos, struct Int32Vect2 speed, struct Int32Vect2 accel)
Paparazzi fixed point algebra.