-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMAIN_MARS_UAV.m
93 lines (64 loc) · 1.53 KB
/
MAIN_MARS_UAV.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
clear all;
clc;
global Quad;
flying_space;
plot_mars_uav;
mars_uav_parameters;
SimOut = sim('QuadrotorSimulink');
for S = 1 : 1 : size(SimOut,1)
Quad.X = X_out.signals.values(S);
Quad.Y = Y_out.signals.values(S);
Quad.Z = Z_out.signals.values(S);
Quad.phi = Phi_out.signals.values(S);
Quad.theta = Theta_out.signals.values(S);
Quad.psi = Psi_out.signals.values(S);
plot_quad
drawnow;
end
% figure();
% plot(SimOut,Z_out.signals.values)
% hold on;
% plot(SimOut,Z_desired.signals.values);
% title('Altitude');
%
%
%
% figure();
% plot(SimOut,X_out.signals.values)
% hold on;
% plot(SimOut,X_desired.signals.values);
% title('X');
%
%
% figure();
% plot(SimOut,Y_out.signals.values)
% hold on;
% plot(SimOut,Y_desired.signals.values);
% title('Y');
% figure();
% plot(SimOut,Psi_out.signals.values)
% hold on;
% plot(SimOut,Psi_desired.signals.values);
% title('Psi');
figure();
grid on
plot3(X_out.signals.values,Y_out.signals.values,-Z_out.signals.values)
hold on
plot3(X_desired.signals.values,Y_desired.signals.values,-Z_desired.signals.values)
grid on
legend('PID response Mars UAV','Desired Square trajectory')
xlabel('x')
ylabel('y')
zlabel('Altitude')
% figure();
% plot(SimOut,X_out.signals.values)
% hold on
%
%
% plot(SimOut,Y_out.signals.values)
%
% hold on
% plot(SimOut,Z_out.signals.values)
% %plot(SimOut,Y_desired.signals.values);
%
% hold off