forked from UMich-BipedLab/Cassie_FlatGround_Controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze_hd.m
55 lines (50 loc) · 1.48 KB
/
analyze_hd.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
%%
Data_control = load("Analyze/Data_compare.mat");
Data_control = Data_control.Data_yukai;
% load("Analyze/hd_gait_v1.mat")
% load("Analyze/hd_gait_v2.mat")
Data_me = Data;
close all;
%%
[w_me,~,l_me] = size(Data_me.hd.Data);
hd_me = reshape(Data_me.hd.Data,[w_me,l_me]);
time_me = Data_me.computer_time.Time;
[w_control,~,l_control] = size(Data_control.hd.Data);
hd_control = reshape(Data_control.hd.Data,[w_control,l_control]);
time_control = Data_control.computer_time.Time;
%%
figure()
% title_list = {"abduction-sw","rotation-sw","swing leg pitch","swing leg length", "toe",...
% "abduction-st","rotation-st","stance leg pitch","stance leg length","toe"};
for i = 1:1
id = i;
% subplot(2,5,id)
grid on
box on
hold on
% plot(time_me,hd_me(id,:),'r')
% plot(time_control,hd_control(id,:),'b-.')
% GRF = movmean(reshape(Data_me.s_LR.Data,[l_me,2]),5);
GRF = movmean(reshape(Data_me.GRF.Data,[l_me,2]),2);
plot(time_me,GRF)
ylim([-300,600])
% title(title_list{i})
end
% legend("new","yukai",'contact')
legend("new",'contact')
%%
GRF_fil = GRF * 0;
for i = 2:length(GRF_fil)
GRF_fil(i,:) = YToolkits.first_order_filter(GRF_fil(i-1,:),GRF(i,:),0.5);
end
hold on
plot(time_me,GRF_fil)
plot(time_me,movmean(reshape(Data_me.GRF.Data,[l_me,2]),2))
%%
%{
figure()
hold on
plot(time_control,reshape(Data_control.stanceLeg.Data,[l_control,1]),'b-.')
plot(time_me,reshape(Data_me.stanceLeg.Data,[l_me,1]),'r')
legend("control","me")
%}