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
rover_guidance.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 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
28#ifndef ROVER_GUIDANCE_H
29#define ROVER_GUIDANCE_H
30
31
33#include "generated/airframe.h"
34#include "std.h"
35
44
45// TODO write a generic PID somewhere else ?
47 float p;
48 float i;
49 float d;
50 float err;
51 float d_err;
52 float sum_err;
53};
54
59
66
67extern struct RoverGuidance rover_guidance;
68
69extern void rover_guidance_init(void);
70extern void rover_guidance_periodic(void); // call state machine
71extern void rover_guidance_run(float *heading_sp); // run control loop
72extern void rover_guidance_enter(void);
73
76
77#ifdef GUIDANCE_MODE_GUIDED
80extern void rover_guidance_guided_run(bool in_flight);
81
87extern bool rover_guidance_set_guided_pos(float x, float y);
88
94
100extern bool rover_guidance_set_guided_body_vel(float vx, float vy);
101
107extern bool rover_guidance_set_guided_vel(float vx, float vy);
108
113extern bool rover_guidance_set_guided_heading_rate(float rate);
114#endif
115
116//static inline void rover_guidance_SetMaxSpeed(float speed)
117//{
118// gh_set_max_speed(speed);
119//}
120//
121//static inline void rover_guidance_SetOmega(float omega)
122//{
123// gh_set_omega(omega);
124//}
125//
126//static inline void rover_guidance_SetZeta(float zeta)
127//{
128// gh_set_zeta(zeta);
129//}
130//
131//static inline void rover_guidance_SetTau(float tau)
132//{
133// gh_set_tau(tau);
134//}
135
136#endif /* ROVER_GUIDANCE_H */
uint16_t foo
Definition main_demo5.c:58
Paparazzi floating point algebra.
void rover_guidance_run(float *heading_sp)
void rover_guidance_set_speed_igain(uint32_t igain)
uint8_t mask
bit 5: vx & vy, bit 6: vz, bit 7: vyaw
void rover_guidance_set_turn_igain(uint32_t igain)
struct RoverGuidanceSetpoint sp
setpoints
void rover_guidance_enter(void)
struct RoverGuidancePID turn_pid
turn rate controller
float heading
heading setpoint
struct FloatVect2 speed
speed setpoint
void rover_guidance_periodic(void)
void rover_guidance_init(void)
struct RoverGuidance rover_guidance
struct RoverGuidancePID speed_pid
motor speed controller
struct FloatVect2 pos
position setpoint in NED.
struct RoverGuidanceControl cmd
commands
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
float heading
Definition wedgebug.c:258