-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathload_example.m
More file actions
52 lines (44 loc) · 1.51 KB
/
load_example.m
File metadata and controls
52 lines (44 loc) · 1.51 KB
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
%--------------------------------------------------------------------------
% Plot symbol's recordings from Panda Co-Manipulation Dataset
%
% Written by Giovanni Braglia, 2024
% University of Modena and Reggio Emilia
%
% tested on MATLAB R2022a
%--------------------------------------------------------------------------
clear; clc; close all;
load("Panda_CoManipulation_Data/04/symbol_data.mat");
Ts = 0.001; % Sampling-time of recordings
figure;
for i=1:6
L = length(symbol_data(i).pos);
T = Ts*L; % Recording Duration
t = linspace( 0, T, L );
label = [ 'Rec', num2str(i) ];
% Plot 2D symbol
subplot(2,2,[1,3]); hold on;
plot( symbol_data(i).pos(1,:), symbol_data(i).pos(2,:), LineWidth=2, DisplayName=label );
% Plot x velocity
subplot(2,2,2); hold on;
plot( t, symbol_data(i).vel(1,:), LineWidth=2 );
% Plot y velocity
subplot(2,2,4); hold on;
plot( t, symbol_data(i).vel(2,:), LineWidth=2 );
end
subplot(2,2,[1,3]);
%------------------
legend('Location','best'); box on; grid on;
xlim([-0.6,-0.35]);
ylim([-0.45,-0.15]);
xlabel( '$x$[m]','FontSize',14,'Interpreter','latex');
ylabel( '$y$[m]','FontSize',14,'Interpreter','latex');
subplot(2,2,2);
%------------------
box on; grid on;
xlabel( '$t$[s]','FontSize',14,'Interpreter','latex');
ylabel( '$\dot{x}$[m/s]','FontSize',14,'Interpreter','latex');
subplot(2,2,4);
%------------------
box on; grid on;
xlabel( '$t$[s]','FontSize',14,'Interpreter','latex');
ylabel( '$\dot{y}$[m/s]','FontSize',14,'Interpreter','latex');