Skip to content

Commit a388293

Browse files
committed
Adds a workng uncertain/LPV quadrotor example
1 parent 5713716 commit a388293

12 files changed

Lines changed: 96 additions & 1 deletion
-435 Bytes
Binary file not shown.
-29 Bytes
Binary file not shown.
28 Bytes
Binary file not shown.
-37 Bytes
Binary file not shown.
-119 Bytes
Binary file not shown.
-91 Bytes
Binary file not shown.
-68 Bytes
Binary file not shown.
-42 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
function [G_veh]=define_G_quad_LPV_wrapped(dim,kp,kd,mass)
2+
% This function defines a closed-loop quadrotor model that has flocking
3+
% force as input and it preserves the integral action
4+
5+
% Define double integrator to generate references
6+
if dim~=2
7+
error('Currently just works with dimension=2')
8+
end
9+
10+
inv_mass_1=(1/mass(1));
11+
A1=[0 1; 0 -kd(1)*inv_mass_1];
12+
B1=[0;1*inv_mass_1*kp(1)];
13+
14+
inv_mass_2=(1/mass(2));
15+
A2=[0 1; 0 -kd(2)*inv_mass_2];
16+
B2=[0;1*inv_mass_2*kp(2)];
17+
18+
% Higher dimensional vehicles
19+
A_hat1=kron(A1,eye(dim));
20+
A_hat2=kron(A2,eye(dim));
21+
22+
B_hat1=kron(B1,eye(dim));
23+
B_hat2=kron(B2,eye(dim));
24+
25+
C_hat=eye(2*dim);
26+
D_hat=zeros(2*dim,dim);
27+
28+
29+
G_double_int_1=ss(A_hat1,B_hat1,C_hat,D_hat);
30+
G_double_int_2=ss(A_hat2,B_hat2,C_hat,D_hat);
31+
32+
G_quad_cl=get_quad_G_cl_LPV(mass);
33+
34+
% Compare the wrapped plant with the generic vehicle model
35+
% sigma(G_double_int)
36+
% hold on
37+
% sigma(G,'r')
38+
39+
G_veh.G1=G_quad_cl.G1*G_double_int_1;
40+
G_veh.G2=G_quad_cl.G2*G_double_int_2;
41+
end

0 commit comments

Comments
 (0)