forked from changliuliu/VRsim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobotproperty.m
More file actions
executable file
·172 lines (142 loc) · 5.02 KB
/
robotproperty.m
File metadata and controls
executable file
·172 lines (142 loc) · 5.02 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
% Robot Property
%
function robot=robotproperty(id)
robot.name = id;
switch id
case 'LRMate200iD'
%the constants
robot.nlink=6;
robot.umax=10;
robot.margin=0.05;
robot.delta_t=0.05;
robot.thetamax=[100, 90, 130, 180, 120, 150;
-100, -90, -72, -180, -120, -150]'*pi/180;
robot.thetadotmax=[1;1.5;1.5;0.5;0.5;0.5];
%The length of each links and DH parameter and base
robot.l=[2;6;5];
robot.DH=[0,0,0.050,-1.5708;
-1.5708,0,0.330,3.1416;
0,0,0.035,-1.5708;
0,-0.335,0,1.5708;
0,0,0,-1.5708;
0,-0.080,0,3.1416];%theta,d,a,alpha
robot.base=[0;0;0.329+0.2];%origin
robot.cap={};
robot.cap{1}.p=[0 0;0 0;0 0];
robot.cap{1}.r=0;
robot.cap{2}.p=[-0.36 0;0 0;0 0];
robot.cap{2}.r=0.13;
robot.cap{3}.p=[-0.03 -0.03;0 0;0.05 0.05];
robot.cap{3}.r=0;
robot.cap{4}.p=[0 0;0 0.35;0 0];
robot.cap{4}.r=0.08;
robot.cap{5}.p=[0 0;0 0;-0.3 0.010];
robot.cap{5}.r=0.09;
robot.cap{6}.p=[0.05 0.17;0 0; 0.135 0.135];
robot.cap{6}.r=0;
load('figure\LRMate200iDCapsules.mat');
robot.boundary=RoBoundary;
robot.boundary{7} = [];
case 'LRMate200iD7L'
%the constants
robot.nlink=6;
robot.umax=10;
robot.margin=3;
robot.delta_t=0.05;
%The length of each links and DH parameter and base
robot.l=[0.65;0.77;0.1;0.74;0;0.1];
robot.DH=[0,0,0.050, -1.5708;
-1.5708,0,0.440,3.1416;
0,0,0.035,-1.5708;
0,-0.42 ,0,1.5708;
0,0,0,-1.5708;
0,-0.080,0,3.1416];%theta,d,a,alpha
robot.base=[0;0;0];%origin
robot.cap={};
robot.cap{1}.p=[0 0;0 0;-0.1 0.1];
robot.cap{1}.r=0.15;
robot.cap{2}.p=[-0.75 0;0 0;-0.15 -0.15];
robot.cap{2}.r=0.13;
robot.cap{3}.p=[-0.03 -0.03;0 0;0.05 0.05];
robot.cap{3}.r=0.22;
robot.cap{4}.p=[0 0;0 0.55;0 0];
robot.cap{4}.r=0.11;
robot.cap{5}.p=[0 0;0 0;-0.05 0.110];
robot.cap{5}.r=0.07;
robot.cap{6}.p=[-0.11 -0.11;0 0; 0.09 0.09];
robot.cap{6}.r=0.11;
load('figure/M16iBCapsules.mat');
robot.boundary=RoBoundary;
case 'M16iB'
%the constants
robot.nlink=6;
robot.umax=10;
robot.thetamax=[-pi,pi;0,pi;-pi,pi;-pi,pi;-pi/2,pi/2;-pi,pi];
robot.thetadotmax=[1;1;1;1;0.5;0.5];
robot.margin=0.5;
robot.delta_t=0.5;
%The length of each links and DH parameter and base
robot.l=[0.65;0.77;0.1;0.74;0;0.1];
robot.DH=[0, 0.65, 0.15, 1.5708;
1.5708, 0, 0.77, 0;
0, 0, 0.1, 1.5708;
0, 0.74, 0, -1.5708;
-pi/2, 0, 0, 1.5708;
pi, 0.1, 0, 0];%theta,d,a,alpha
robot.base=[0;0;0];%origin
robot.cap={};
robot.cap{1}.p=[0 0;0 0;-0.1 0.1];
robot.cap{1}.r=0.15;
robot.cap{2}.p=[-0.75 0;0 0;-0.15 -0.15];
robot.cap{2}.r=0.13;
robot.cap{3}.p=[-0.03 -0.03;0 0;0.05 0.05];
robot.cap{3}.r=0.22;
robot.cap{4}.p=[0 0;0 0.55;0 0];
robot.cap{4}.r=0.11;
robot.cap{5}.p=[0 0;0 0;-0.05 0.110];
robot.cap{5}.r=0.07;
robot.cap{6}.p=[-0.11 -0.11;0 0; 0.09 0.09];
robot.cap{6}.r=0.11;
load('figure/M16iBCapsules.mat');
robot.boundary=RoBoundary;
end
%The kinematic matrices
robot.A=[eye(robot.nlink) robot.delta_t*eye(robot.nlink);
zeros(robot.nlink) eye(robot.nlink)];
robot.B=[0.5*robot.delta_t^2*eye(robot.nlink);
robot.delta_t*eye(robot.nlink)];
robot.Ac=[eye(3) robot.delta_t*eye(3);
zeros(3) eye(3)];
robot.Bc=[0.5*robot.delta_t^2*eye(3);
robot.delta_t*eye(3)];
robot.C=[];
robot.D=[];
robot.Q=[];
robot.R=[];
robot.x(1:robot.nlink*2,1)=[robot.DH(:,1);zeros(robot.nlink,1)];%(theta1,theta2,theta,3,theta1dot,theta2dot,theta3dot)
robot.pos=CapPos(robot.base,robot.DH,robot.cap);
robot.wx(1:3,1)=robot.pos{robot.nlink}.p(:,2);
robot.wx(4:6,1)=[0;0;0];%endpoint state(x4,y4,z4,x4dot,y4dot,z4dot)
robot.mx=robot.wx;%closest point state
robot.ref.x=robot.x;
robot.innoise=0;
robot.outnoiseself=0;
robot.outnoisestar=0;
robot.obs.xself=[];
robot.obs.xstar=[];
robot.obs.goal=[];
robot.obs.A=robot.A;
robot.obs.B=robot.B;
robot.obs.C=robot.C;
robot.obs.D=robot.D;
robot.obs.Q=robot.Q;
robot.obs.R=robot.R;
robot.score=0;
robot.flag=0;
%For SSA
robot.const.P1=[eye(robot.nlink) zeros(robot.nlink);zeros(robot.nlink) zeros(robot.nlink)];
robot.const.P2=[zeros(robot.nlink) 0.5*eye(robot.nlink);0.5*eye(robot.nlink) zeros(robot.nlink)];
robot.const.P3=[zeros(robot.nlink) zeros(robot.nlink);zeros(robot.nlink) eye(robot.nlink)];
%For collision check
robot.profile={};
end