Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
34
35#define GUIDANCE_V_MODE_KILL 0
36#define GUIDANCE_V_MODE_RC_DIRECT 1
37#define GUIDANCE_V_MODE_RC_CLIMB 2
38#define GUIDANCE_V_MODE_CLIMB 3
39#define GUIDANCE_V_MODE_HOVER 4
40#define GUIDANCE_V_MODE_NAV 5
41#define GUIDANCE_V_MODE_GUIDED 6
42
112
113extern struct VerticalGuidance guidance_v;
114
115extern void guidance_v_init(void);
117extern void guidance_v_notify_in_flight(bool in_flight);
118extern void guidance_v_thrust_adapt(bool in_flight);
119extern void guidance_v_update_ref(void);
120extern void guidance_v_z_enter(void);
121extern void guidance_v_run_enter(void);
122
126extern struct ThrustSetpoint guidance_v_run(bool in_flight);
127extern struct ThrustSetpoint guidance_v_run_pos(bool in_flight, struct VerticalGuidance *gv);
128extern struct ThrustSetpoint guidance_v_run_speed(bool in_flight, struct VerticalGuidance *gv);
129extern struct ThrustSetpoint guidance_v_run_accel(bool in_flight, struct VerticalGuidance *gv);
130
133extern void guidance_v_set_ref(int32_t pos, int32_t speed, int32_t accel);
134// macro for backward compatibility
135#define GuidanceVSetRef guidance_v_set_ref
136
139extern struct ThrustSetpoint guidance_v_from_nav(bool in_flight);
140
143extern void guidance_v_guided_enter(void);
144
147extern struct ThrustSetpoint guidance_v_guided_run(bool in_flight);
148
152extern void guidance_v_set_z(float z);
153
157extern void guidance_v_set_vz(float vz);
158
162extern void guidance_v_set_th(float th);
163
169extern void guidance_v_set_all(float z, float vz, float az);
170
171#endif /* GUIDANCE_V_H */
Adaptation block of the vertical guidance.
Reference generation for vertical guidance.
uint16_t foo
Definition main_demo5.c:58
void guidance_v_thrust_adapt(bool in_flight)
Definition guidance_v.c:201
void guidance_v_set_vz(float vz)
Set z velocity setpoint.
Definition guidance_v.c:390
struct ThrustSetpoint guidance_v_run_accel(bool in_flight, struct VerticalGuidance *gv)
void guidance_v_z_enter(void)
Definition guidance_v.c:269
void guidance_v_notify_in_flight(bool in_flight)
Definition guidance_v.c:165
float nominal_throttle
nominal throttle for hover.
Definition guidance_v.h:108
struct ThrustSetpoint guidance_v_from_nav(bool in_flight)
Set guidance setpoint from NAV and run hover loop.
Definition guidance_v.c:303
int32_t z_sp
altitude setpoint in meters (input).
Definition guidance_v.h:50
int32_t zd_sp
vertical speed setpoint in meter/s (input).
Definition guidance_v.h:56
struct ThrustSetpoint thrust
Final thrust setpoint summation of feed-forward and feed-back commands, can be a total thrust or incr...
Definition guidance_v.h:102
void guidance_v_run_enter(void)
int32_t z_ref
altitude reference in meters.
Definition guidance_v.h:68
struct ThrustSetpoint guidance_v_run_speed(bool in_flight, struct VerticalGuidance *gv)
void guidance_v_set_z(float z)
Set z position setpoint.
Definition guidance_v.c:379
void guidance_v_guided_enter(void)
Enter GUIDED mode control.
Definition guidance_v.c:334
void guidance_v_set_all(float z, float vz, float az)
Set z position, velocity and acceleration setpoint.
Definition guidance_v.c:411
int32_t zdd_sp
vertical acceleration setpoint in meter/s^2.
Definition guidance_v.h:62
struct ThrustSetpoint guidance_v_run_pos(bool in_flight, struct VerticalGuidance *gv)
int32_t zd_ref
vertical speed reference in meter/s.
Definition guidance_v.h:74
void guidance_v_set_ref(int32_t pos, int32_t speed, int32_t accel)
Set guidance ref parameters.
Definition guidance_v.c:283
int32_t th_sp
input thrust setpoint.
Definition guidance_v.h:96
void guidance_v_set_th(float th)
Set throttle setpoint.
Definition guidance_v.c:400
struct ThrustSetpoint guidance_v_guided_run(bool in_flight)
Run GUIDED mode control.
Definition guidance_v.c:344
int32_t rc_zd_sp
Vertical speed setpoint from radio control.
Definition guidance_v.h:91
void guidance_v_mode_changed(uint8_t new_mode)
Definition guidance_v.c:133
struct VerticalGuidance guidance_v
Definition guidance_v.c:60
void guidance_v_update_ref(void)
Definition guidance_v.c:292
void guidance_v_init(void)
Definition guidance_v.c:92
int32_t thrust_coeff
Definition guidance_v.h:110
int32_t zdd_ref
vertical acceleration reference in meter/s^2.
Definition guidance_v.h:80
int32_t rc_delta_t
Direct throttle from radio control.
Definition guidance_v.h:85
struct ThrustSetpoint guidance_v_run(bool in_flight)
Guidance vertical run functions.
Definition guidance_v.c:223
General stabilization interface for rotorcrafts.
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.