Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
wls_alloc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Anton Naruta && Daniel Hoppener
3  * MAVLab Delft University of Technology
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
52 #ifndef WLS_ALLOC_HEADER
53 #define WLS_ALLOC_HEADER
54 
55 #ifndef TEST_ALLOC
56 #include "generated/airframe.h"
57 #endif
58 
59 #ifndef WLS_N_U_MAX
60 #define WLS_N_U_MAX 6
61 #endif
62 
63 #ifndef WLS_N_V_MAX
64 #define WLS_N_V_MAX 4
65 #endif
66 struct WLS_t{
67  int nu; // number of actuators
68  int nv; // number of controlled axes
69  float gamma_sq; // weighting factor WLS
70  float v[WLS_N_V_MAX]; // Pseudo Control Vector
71  float u[WLS_N_U_MAX]; // Allocation of Controls
72  float Wv[WLS_N_V_MAX]; // Weighting on different control objectives
73  float Wu[WLS_N_U_MAX]; // Weighting on different actuators
74  float u_pref[WLS_N_U_MAX]; // Preferred control vector
75  float u_min[WLS_N_U_MAX]; // Minimum control vector
76  float u_max[WLS_N_U_MAX]; // Maximum control vector
77  float PC; // Primary cost
78  float SC; // Secondary cost
79  int iter; // Number of iterations
80 };
81 
82 #if PERIODIC_TELEMETRY
84 extern void send_wls_v(char *name, struct WLS_t* WLS_p, struct transport_tx *trans, struct link_device *dev);
85 extern void send_wls_u(char *name, struct WLS_t* WLS_p, struct transport_tx *trans, struct link_device *dev);
86 #endif
87 
88 
89 extern void wls_alloc(struct WLS_t* WLS_p, float **B, float *u_guess, float *W_init, int imax);
90 
91 
92 #endif
#define B
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
Periodic telemetry system header (includes downlink utility and generated code).
float gamma_sq
Definition: wls_alloc.h:69
float u[WLS_N_U_MAX]
Definition: wls_alloc.h:71
#define WLS_N_V_MAX
Definition: wls_alloc.h:64
float PC
Definition: wls_alloc.h:77
void send_wls_v(char *name, struct WLS_t *WLS_p, struct transport_tx *trans, struct link_device *dev)
Definition: wls_alloc.c:61
int iter
Definition: wls_alloc.h:79
void wls_alloc(struct WLS_t *WLS_p, float **B, float *u_guess, float *W_init, int imax)
active set algorithm for control allocation
Definition: wls_alloc.c:119
#define WLS_N_U_MAX
active set algorithm for control allocation
Definition: wls_alloc.h:60
int nv
Definition: wls_alloc.h:68
float u_min[WLS_N_U_MAX]
Definition: wls_alloc.h:75
float Wu[WLS_N_U_MAX]
Definition: wls_alloc.h:73
float u_max[WLS_N_U_MAX]
Definition: wls_alloc.h:76
float u_pref[WLS_N_U_MAX]
Definition: wls_alloc.h:74
float Wv[WLS_N_V_MAX]
Definition: wls_alloc.h:72
float v[WLS_N_V_MAX]
Definition: wls_alloc.h:70
int nu
Definition: wls_alloc.h:67
float SC
Definition: wls_alloc.h:78
void send_wls_u(char *name, struct WLS_t *WLS_p, struct transport_tx *trans, struct link_device *dev)
Definition: wls_alloc.c:71