-
Notifications
You must be signed in to change notification settings - Fork 0
/
animation.m
58 lines (53 loc) · 1.35 KB
/
animation.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
function animation
clear all;
%% ?????????
% D = 0.3; % Distance between 2 slider of the pair
% lc = 1.1; % Length of rod
% rb = 1; % Distance between origin and actuator on X-Y plane
% re = 0.4; % Radius of table
% n_time = 20;
% theta = pi/12; % rotation around Y axis
% psi = pi/16; % rotation around Z axis
% Px0 = 0.1;
% Py0 = 0.2;
% Pz0 = 1.1;
% P = [0.1,0.2,1.1]; % Position Vector of the end effector
% ls = 1.0;
%% Fabricator design parameters
% All unit is described as milimeter
D = 70; % Distance between 2 slider of the pair
lc = 580; % Length of rod
rb = 500; % Distance between origin and actuator on X-Y plane
re = 200; % Radius of table
ls = 700;
% P = [0.1,0.2,1.1]; % Position Vector of the end effector
n_time = 20;
theta = pi/12; % rotation around Y axis
psi = pi/16; % rotation around Z axis
Px0 = 0;
Py0 = 0;
Pz0 = 800;
%% ?????
figure(1);
x_o=Px0;
y_o=Py0;
z_o=Pz0;
for i_time=1:n_time
x=Px0-i_time/200.0;
y=Py0+i_time/200.0;
z=Pz0;
P = [x,y,z]; % Position Vector of the end effector
phi = pi/12*(i_time/10); % rotation around X axis
theta = pi/12*(i_time/10); % rotation around Y axis
psi = pi/16*(i_time/10); % rotation around Z axis
computeSliderControl(D,lc,ls,rb,re,P,phi,theta,psi);
u=(x-x_o);
v=(y-y_o);
w=100;
quiver3(z,u,v,w);
drawnow;
x_o = x;
y_o = y;
z_o = z;
end
end