forked from woo-rookie/Simscape-Robot-Fish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotAll.m
69 lines (53 loc) · 1.41 KB
/
plotAll.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
%{
File Plots qd, qd_dot, q, q_dot, u
%}
addpath('Data/');
load('Data/q.mat'); % q_rad
load('Data/qd.mat'); % qd_rad
load('Data/q_dot.mat'); % q_dot_rad
load('Data/qd_dot.mat'); % qd_dot_rad
load('Data/u.mat'); % u_torque
t = q_rad(1,:);
q = q_rad(2,:);
q_dot = q_dot_rad(2,:);
qd = qd_rad(2,:);
qd_dot = qd_dot_rad(2,:);
u = u_torque(2,:);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot q
figure(1);
plot(t, q_rad(4:8,:));
title('measured angle q (rad) vs. time (s)');
xlabel('time (s)');
ylabel('angle (rad)');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot q_dot
figure(2);
plot(t, q_dot_rad(4:8,:));
title('measured angular velocity dq/dt (rad/s) vs. time (s)');
xlabel('time (s)');
ylabel('angular velocity (rad/s)');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot qd
figure(3);
plot(t, qd_rad(4:8,:));
title('reference angle q_d (rad) vs. time (s)');
xlabel('time (s)');
ylabel('angle (rad)');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot qd_dot
figure(4);
plot(t, qd_dot_rad(4:8,:));
ylim([-3, 3]);
title('reference angular velocity dq_d/dt (rad/s) vs. time (s)');
xlabel('time (s)');
ylabel('Plots');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot u
figure(5);
plot(t, u_torque(4:8,:));
ylim([-0.2, 0.2]);
title('joint control torque u (gcm^2/s^2) vs. time (s)');
xlabel('time (s)');
ylabel('u (gcm^2/s^2)');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%