-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlotTailobatics.m
65 lines (51 loc) · 2.19 KB
/
PlotTailobatics.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
%% Plot output
if exist('F1','var')==0
F1 = figure('Units','normalized','Position',[0 0 0.7 0.5]);
else
clf
end
set(gcf,'color','w');
plotVars.fontSize = 14;
plotVars.lineWidth = 2;
plotVars.rows = 2;
plotVars.colums = 1;
plotVars.colors = winter(10);
%% Angles
subplot(plotVars.rows,plotVars.colums,1);
hold on
L1 = plot(Time,180/pi*BodyRoll,'Color',plotVars.colors(3,:),'LineWidth',plotVars.lineWidth);
L1 = plot(Time,180/pi*BodyPitch,'Color',plotVars.colors(5,:),'LineWidth',plotVars.lineWidth);
L1 = plot(Time,180/pi*BodyYaw,'Color',plotVars.colors(7,:),'LineWidth',plotVars.lineWidth);
plot(Time,Time*0+0, 'k:','LineWidth',plotVars.lineWidth);
plot(Time,Time*0-180,'k:','LineWidth',plotVars.lineWidth);
xlabel ('Time (s)'), ylabel('Angle (deg)');
title('Body Orientation')
set(gca,'fontsize',plotVars.fontSize)
grid on; grid minor;
legend('Roll','Pitch','Yaw','Location','East')
xlim([0 1])
ylim([-90 90])
%% Joint Angles
subplot(plotVars.rows,plotVars.colums,2);
hold on
L1 = plot(Time,180/pi*TailPitchPosition,'Color',plotVars.colors(3,:),'LineWidth',plotVars.lineWidth);
L1 = plot(Time,180/pi*PitchInput,':','Color',plotVars.colors(3,:),'LineWidth',plotVars.lineWidth+2);
SplinePoints = TrajectoryParams(1:numel(WaypointTime));
L1 = plot(WaypointTime,SplinePoints,'ro','LineWidth',plotVars.lineWidth);
L1 = plot(Time,180/pi*TailRollPosition,'Color',plotVars.colors(5,:),'LineWidth',plotVars.lineWidth);
L1 = plot(Time,180/pi*RollInput,':','Color',plotVars.colors(5,:),'LineWidth',plotVars.lineWidth+2);
SplinePoints = TrajectoryParams(numel(WaypointTime)+1:end);
L1 = plot(WaypointTime,SplinePoints,'rs','LineWidth',plotVars.lineWidth);
xlabel ('Time (s)'), ylabel('Joint Angles (deg)');
title('Joint Angles')
set(gca,'fontsize',plotVars.fontSize)
grid on; grid minor;
legend('Tail Pitch Joint Angle','Demanded Pitch Joint Angle','Colocation Points',...
'Tail Roll Joint Angle','Demanded Roll Joint Angle','Colocation Points','Location','East')
xlim([0 1])
ylim([-360 360])
%% Save
% tightfig
% J2 = getframe(gcf);
% writeVideo(videoFWrite,J2);
save2pdf('TailFlip_ICB3')