-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewSim.m
More file actions
30 lines (30 loc) · 702 Bytes
/
ViewSim.m
File metadata and controls
30 lines (30 loc) · 702 Bytes
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
function ViewSim(t,js, record)
if (record==1)
writerObj = VideoWriter('record.avi');
writerObj.FrameRate = 20;
open(writerObj);
end
%Setup the figure and start drawing
figure();
set(gcf,'color','w');
set(gcf,'position',[0 0 1400 900]);
grid on;
axis equal;
xlim([-1.2 1.2]);
ylim([-1.2 1.2]);
zlim([0 1.2]);
view(30,30);
for i=1:5:size(js,2)
gth=ComputeFK(js(1:end/2,i));
DrawRobot(gth,0.08);
title(t(i));
drawnow;
if (record==1)
frame = getframe(gcf);
writeVideo(writerObj,frame);
end
end
if (record==1)
close(writerObj);
end
end