Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
guidance_v.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, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
26 #ifndef GUIDANCE_V_H
27 #define GUIDANCE_V_H
28 
29 #include "std.h"
30 
33 
34 #define GUIDANCE_V_MODE_KILL 0
35 #define GUIDANCE_V_MODE_RC_DIRECT 1
36 #define GUIDANCE_V_MODE_RC_CLIMB 2
37 #define GUIDANCE_V_MODE_CLIMB 3
38 #define GUIDANCE_V_MODE_HOVER 4
39 #define GUIDANCE_V_MODE_NAV 5
40 #define GUIDANCE_V_MODE_MODULE 6
41 #define GUIDANCE_V_MODE_FLIP 7
42 #define GUIDANCE_V_MODE_GUIDED 8
43 
46 
52 
58 
64 
70 
76 
81 
87 
92 
98 
104 
106 };
107 
108 extern struct VerticalGuidance guidance_v;
109 
110 extern void guidance_v_init(void);
111 extern void guidance_v_read_rc(void);
112 extern void guidance_v_mode_changed(uint8_t new_mode);
113 extern void guidance_v_notify_in_flight(bool in_flight);
114 extern void guidance_v_thrust_adapt(bool in_flight);
115 extern void guidance_v_update_ref(void);
116 extern void guidance_v_run(bool in_flight);
117 extern void guidance_v_z_enter(void);
118 
119 extern void guidance_v_run_enter(void);
120 extern int32_t guidance_v_run_pos(bool in_flight, struct VerticalGuidance *gv);
121 extern int32_t guidance_v_run_speed(bool in_flight, struct VerticalGuidance *gv);
122 extern int32_t guidance_v_run_accel(bool in_flight, struct VerticalGuidance *gv);
123 
126 extern void guidance_v_set_ref(int32_t pos, int32_t speed, int32_t accel);
127 // macro for backward compatibility
128 #define GuidanceVSetRef guidance_v_set_ref
129 
132 extern void guidance_v_from_nav(bool in_flight);
133 
136 extern void guidance_v_guided_enter(void);
137 
140 extern void guidance_v_guided_run(bool in_flight);
141 
145 extern void guidance_v_set_z(float z);
146 
150 extern void guidance_v_set_vz(float vz);
151 
155 extern void guidance_v_set_th(float th);
156 
157 #endif /* GUIDANCE_V_H */
Adaptation block of the vertical guidance.
Reference generation for vertical guidance.
void guidance_v_read_rc(void)
Definition: guidance_v.c:105
void guidance_v_thrust_adapt(bool in_flight)
Definition: guidance_v.c:203
void guidance_v_set_vz(float vz)
Set z velocity setpoint.
Definition: guidance_v.c:403
void guidance_v_z_enter(void)
Definition: guidance_v.c:284
void guidance_v_notify_in_flight(bool in_flight)
Definition: guidance_v.c:167
float nominal_throttle
nominal throttle for hover.
Definition: guidance_v.h:103
int32_t z_sp
altitude setpoint in meters (input).
Definition: guidance_v.h:51
int32_t zd_sp
vertical speed setpoint in meter/s (input).
Definition: guidance_v.h:57
void guidance_v_run(bool in_flight)
Definition: guidance_v.c:224
void guidance_v_run_enter(void)
int32_t z_ref
altitude reference in meters.
Definition: guidance_v.h:63
void guidance_v_set_z(float z)
Set z position setpoint.
Definition: guidance_v.c:393
void guidance_v_guided_enter(void)
Enter GUIDED mode control.
Definition: guidance_v.c:349
int32_t zd_ref
vertical speed reference in meter/s.
Definition: guidance_v.h:69
int32_t guidance_v_run_accel(bool in_flight, struct VerticalGuidance *gv)
void guidance_v_set_ref(int32_t pos, int32_t speed, int32_t accel)
Set guidance ref parameters.
Definition: guidance_v.c:297
int32_t th_sp
thrust setpoint.
Definition: guidance_v.h:91
int32_t guidance_v_run_pos(bool in_flight, struct VerticalGuidance *gv)
int32_t guidance_v_run_speed(bool in_flight, struct VerticalGuidance *gv)
void guidance_v_set_th(float th)
Set throttle setpoint.
Definition: guidance_v.c:411
int32_t rc_zd_sp
Vertical speed setpoint from radio control.
Definition: guidance_v.h:86
void guidance_v_mode_changed(uint8_t new_mode)
Definition: guidance_v.c:127
int32_t delta_t
thrust command.
Definition: guidance_v.h:97
void guidance_v_guided_run(bool in_flight)
Run GUIDED mode control.
Definition: guidance_v.c:359
struct VerticalGuidance guidance_v
Definition: guidance_v.c:59
void guidance_v_from_nav(bool in_flight)
Set guidance setpoint from NAV and run hover loop.
Definition: guidance_v.c:317
void guidance_v_update_ref(void)
Definition: guidance_v.c:306
void guidance_v_init(void)
Definition: guidance_v.c:83
int32_t thrust_coeff
Definition: guidance_v.h:105
int32_t zdd_ref
vertical acceleration reference in meter/s^2.
Definition: guidance_v.h:75
int32_t rc_delta_t
Direct throttle from radio control.
Definition: guidance_v.h:80
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98