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_pid.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 Gautier Hattenberger <gautier.hattenberger@enac.fr>
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_PID_H
27#define GUIDANCE_PID_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "std.h"
37
39 // horizontal gains
45 // vertical gains
49 // outputs
50 struct Int32Vect2 cmd_earth; // Horizontal guidance command (north/east with #INT32_ANGLE_FRAC)
51 int32_t cmd_thrust; // Vertical guidance command (in pprz_t)
52 // options
53 bool approx_force_by_thrust; // Correction of force commands from thrust
54 bool adapt_throttle_enabled; // Use adaptive throttle command estimation
55};
56
59extern struct GuidancePID guidance_pid;
60
61extern void guidance_pid_init(void);
62extern void guidance_pid_h_enter(void);
63extern void guidance_pid_v_enter(void);
67extern struct ThrustSetpoint guidance_pid_v_run_pos(bool in_flight, struct VerticalGuidance *gv);
68extern struct ThrustSetpoint guidance_pid_v_run_speed(bool in_flight, struct VerticalGuidance *gv);
70
71extern void guidance_pid_set_h_igain(uint32_t igain);
72extern void guidance_pid_set_v_igain(uint32_t igain);
73
78extern const struct Int32Vect2 *guidance_pid_get_h_pos_err(void);
79
80#ifdef __cplusplus
81}
82#endif
83
84#endif /* GUIDANCE_PID_H */
void guidance_pid_set_h_igain(uint32_t igain)
settings handler
int32_t v_ki
void guidance_pid_init(void)
struct StabilizationSetpoint guidance_pid_h_run_pos(bool in_flight, struct HorizontalGuidance *gh)
int32_t cmd_thrust
struct StabilizationSetpoint guidance_pid_h_run_speed(bool in_flight, struct HorizontalGuidance *gh)
bool approx_force_by_thrust
struct ThrustSetpoint guidance_pid_v_run_pos(bool in_flight, struct VerticalGuidance *gv)
const struct Int32Vect2 * guidance_pid_get_h_pos_err(void)
Gets the position error.
void guidance_pid_set_v_igain(uint32_t igain)
struct ThrustSetpoint guidance_pid_v_run_speed(bool in_flight, struct VerticalGuidance *gv)
bool adapt_throttle_enabled
struct GuidancePID guidance_pid
Guidance PID structyre.
int32_t v_kp
struct ThrustSetpoint guidance_pid_v_run_accel(bool in_flight, struct VerticalGuidance *gv)
struct Int32Vect2 cmd_earth
struct StabilizationSetpoint guidance_pid_h_run_accel(bool in_flight, struct HorizontalGuidance *gh)
void guidance_pid_v_enter(void)
void guidance_pid_h_enter(void)
int32_t v_kd
uint16_t foo
Definition main_demo5.c:58
Paparazzi fixed point algebra.
Horizontal guidance for rotorcrafts.
Vertical guidance for rotorcrafts.
Stabilization setpoint.
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 int uint32_t
Typedef defining 32 bit unsigned int type.