23 import skilled_pr2
as spr
24 import pyride_interpreter
as pint
26 from math_tools
import general_math
as gen
27 from math_tools.geometry import trajectory
as traj, rotation
as rot, shape_trajectories
as tsh
36 array([ -1.26299826e-01, 1.77046412e+00, -1.02862191e+00,
37 -1.36864905e+00, -2.31195189e+00, -1.29253137e+00,
38 1.71195615e-01, 8.02176174e-01, -2.12167293e-03,
39 2.32811863e-04, 7.05358701e-03, 4.01010384e-01,
40 2.44565260e+00, 7.10476515e-01, -1.30808585e+00,
41 1.15357810e+00, -4.49485156e-01, -2.46943329e+00])
54 arm = self.reference_arm()
55 ori = arm.wrist_orientation()
56 self.arm_forward(self.depth, relative =
True)
57 self.arm_right_up(dx = 0.5*self.
width, dy = self.
height, relative =
True)
58 self.arm_right_down(dx = 0.5*self.
width, dy = self.
height, relative =
True)
60 self.arm_back(self.depth, relative =
True)
61 self.arm_left_up(0.75*self.
width, 0.5*self.
height, relative =
True)
62 self.arm_forward(self.depth, relative =
True)
63 self.arm_right(0.5*self.
width, relative =
True)
64 self.arm_back(self.depth, relative =
True)
65 self.arm_right_down(0.6*self.
width, 0.5*self.
height, relative =
True)
68 arm = self.reference_arm()
69 ori = arm.wrist_orientation()
70 self.arm_forward(self.depth, relative=
True)
71 B = tsh.B(height = self.
height, direction = ori)
72 self.arm_trajectory(B)
73 self.arm_back(self.depth, relative=
True)
74 self.arm_right(0.25*self.
height + 0.3*self.
width, relative=
True)
77 arm = self.reference_arm()
78 ori = arm.wrist_orientation()
79 self.arm_right_up(dy = (self.
height- self.
width/2) , dx = self.
width, relative=
True)
80 self.arm_forward(self.depth, relative=
True)
81 C = tsh.C(height = self.
height, width = self.
width, direction = ori, adjust =
False)
82 self.arm_trajectory(C)
83 self.arm_back(self.depth, relative=
True)
84 self.arm_right_down(dy = self.
width/2 , dx = 0.3*self.
width, relative=
True)
87 arm = self.reference_arm()
88 ori = arm.wrist_orientation()
89 self.arm_forward(self.depth, relative=
True)
90 D = tsh.D(height = self.
height, width = self.
width, direction = ori)
91 self.arm_trajectory(D)
92 self.arm_back(self.depth, relative=
True)
93 self.arm_right(1.3*self.
width, relative=
True)
96 arm = self.reference_arm()
97 ori = arm.wrist_orientation()
98 self.arm_right(self.
width, relative=
True)
99 self.arm_forward(self.depth, relative=
True)
100 self.arm_left(self.
width, relative=
True)
101 self.arm_up(self.
height, relative=
True)
102 self.arm_right(self.
width, relative=
True)
103 self.arm_back(self.depth, relative=
True)
104 self.arm_left_down(self.
width, 0.5*self.
height, relative=
True)
105 self.arm_forward(self.depth, relative=
True)
106 self.arm_right(0.8*self.
width, relative=
True)
107 self.arm_back(self.depth, relative=
True)
108 self.arm_right_down(dx = 0.6*self.
width, dy = 0.5*self.
height, relative =
True)
111 arm = self.reference_arm()
112 ori = arm.wrist_orientation()
113 self.arm_forward(self.depth, relative=
True)
114 self.arm_up(self.
height, relative=
True)
115 self.arm_right(self.
width, relative=
True)
116 self.arm_back(self.depth, relative=
True)
117 self.arm_left_down(self.
width, 0.5*self.
height, relative=
True)
118 self.arm_forward(self.depth, relative=
True)
119 self.arm_right(0.8*self.
width, relative=
True)
120 self.arm_back(self.depth, relative=
True)
121 self.arm_right_down(dx = 0.6*self.
width, dy = 0.5*self.
height, relative =
True)
124 arm = self.reference_arm()
125 ori = arm.wrist_orientation()
126 self.arm_right_up(dx = self.
width, dy = self.
height- self.
width/2, relative=
True)
127 self.arm_forward(self.depth, relative=
True)
128 G = tsh.G(height = self.
height, width = self.
width, direction = ori, adjust =
False)
129 self.arm_trajectory(G)
131 self.arm_back(self.depth, relative=True)
132 self.arm_left(dx= 0.25*self.height, relative=True)
133 self.arm_forward(self.depth, relative=True)
134 self.arm_right(dx= 0.4*self.height, relative=True)
136 self.arm_back(self.depth, relative=
True)
137 self.arm_right_down(dx= 0.55*self.
width, dy=self.
height/2.0, relative=
True)
140 arm = self.reference_arm()
141 ori = arm.wrist_orientation()
142 self.arm_forward(self.depth, relative=
True)
143 self.arm_up(self.
height, relative=
True)
144 self.arm_back(self.depth, relative=
True)
145 self.arm_down(0.5*self.
height, relative=
True)
146 self.arm_forward(self.depth, relative=
True)
147 self.arm_right(self.
width, relative=
True)
148 self.arm_back(self.depth, relative=
True)
149 self.arm_up(0.5*self.
height, relative=
True)
150 self.arm_forward(self.depth, relative=
True)
151 self.arm_down(self.
height, relative=
True)
152 self.arm_back(self.depth, relative=
True)
153 self.arm_right(0.3*self.
width, relative=
True)
156 arm = self.reference_arm()
157 ori = arm.wrist_orientation()
158 self.arm_forward(self.depth, relative=
True)
159 self.arm_right(0.6*self.
width, relative=
True)
160 self.arm_back(self.depth, relative=
True)
161 self.arm_left(0.3*self.
width, relative=
True)
162 self.arm_forward(self.depth, relative=
True)
163 self.arm_up(self.
height, relative=
True)
164 self.arm_back(self.depth, relative=
True)
165 self.arm_left(0.3*self.
width, relative=
True)
166 self.arm_forward(self.depth, relative=
True)
167 self.arm_right(0.6*self.
width, relative=
True)
168 self.arm_back(self.depth, relative=
True)
169 self.arm_right_down(0.3*self.
width, self.
height, relative=
True)
172 arm = self.reference_arm()
173 ori = arm.wrist_orientation()
174 self.arm_up(self.
width/2, relative=
True)
175 self.arm_forward(self.depth, relative=
True)
176 J = tsh.J(width = self.
width, height = self.
height, direction = ori)
177 self.arm_trajectory(J)
178 self.arm_back(self.depth, relative=
True)
179 self.arm_right_down(dy=self.
height, dx = 0.4*self.
width, relative=
True)
182 arm = self.reference_arm()
183 ori = arm.wrist_orientation()
184 self.arm_up(self.
height, relative=
True)
185 self.arm_forward(self.depth, relative=
True)
186 U = tsh.U(width = self.
width, height = self.
height, direction = ori)
187 self.arm_trajectory(U)
188 self.arm_back(self.depth, relative=
True)
189 self.arm_right_down(dy=self.
height, dx = 0.4*self.
width, relative=
True)
192 arm = self.reference_arm()
193 ori = arm.wrist_orientation()
194 self.arm_forward(self.depth, relative=
True)
195 self.arm_up(self.
height, relative=
True)
196 self.arm_back(self.depth, relative=
True)
197 self.arm_right(self.
width, relative=
True)
198 self.arm_forward(self.depth, relative=
True)
199 self.arm_left_down(self.
width, self.
height/2, relative=
True)
200 self.arm_right_down(self.
width, self.
height/2, relative=
True)
201 self.arm_back(self.depth, relative=
True)
202 self.arm_right(0.3*self.
width, relative=
True)
205 arm = self.reference_arm()
206 ori = arm.wrist_orientation()
207 self.arm_up(self.
height, relative=
True)
208 self.arm_forward(self.depth, relative=
True)
209 self.arm_down(self.
height, relative=
True)
210 self.arm_right(self.
width, relative=
True)
211 self.arm_back(self.depth, relative=
True)
212 self.arm_right(0.3*self.
width, relative=
True)
215 arm = self.reference_arm()
216 ori = arm.wrist_orientation()
217 self.arm_forward(self.depth, relative=
True)
218 self.arm_up(self.
height, relative=
True)
219 self.arm_right_down(dx = 0.6*self.
width, dy = 0.5*self.
height, relative=
True)
220 self.arm_right_up( dx = 0.6*self.
width, dy = 0.5*self.
height, relative=
True)
221 self.arm_down(self.
height, relative=
True)
222 self.arm_back(self.depth, relative=
True)
223 self.arm_right(0.3*self.
width, relative=
True)
226 arm = self.reference_arm()
227 ori = arm.wrist_orientation()
228 self.arm_forward(self.depth, relative=
True)
229 N = tsh.N(width = self.
width, height = self.
height, direction = ori)
230 self.arm_trajectory(N)
231 self.arm_back(self.depth, relative=
True)
232 self.arm_right_down(dy=self.
height, dx=0.3*self.
width, relative=
True)
235 arm = self.reference_arm()
236 ori = arm.wrist_orientation()
237 self.arm_up(self.
height - self.
width/2, relative=
True)
238 self.arm_forward(self.depth, relative=
True)
239 O = tsh.O(height = self.
height, width = self.
width, direction = ori, adjust =
False)
240 self.arm_trajectory(O)
241 self.arm_back(self.depth, relative=
True)
242 self.arm_right_down(dx= 1.2*self.
width, dy = self.
height - self.
width/2, relative=
True)
245 arm = self.reference_arm()
246 ori = arm.wrist_orientation()
247 self.arm_forward(self.depth, relative=
True)
248 P = tsh.P(width = 0.4*self.
height, height = self.
height, direction = ori)
249 self.arm_trajectory(P)
250 self.arm_back(self.depth, relative=
True)
251 self.arm_right_down(dy=0.5*self.
height, dx=0.25*self.
height + 0.3*self.
width, relative=
True)
254 arm = self.reference_arm()
255 ori = arm.wrist_orientation()
256 self.arm_up(self.
height - self.
width/2, relative=
True)
257 self.arm_forward(self.depth, relative=
True)
258 O = tsh.O(height = self.
height, width = self.
width, direction = ori, adjust =
False)
259 self.arm_trajectory(O)
260 self.arm_back(self.depth, relative=
True)
261 self.arm_right_down(dx= 0.3*self.
height, dy = 0.6*self.
height, relative=
True)
262 self.arm_forward(self.depth, relative=
True)
263 self.arm_right_down(dx= 0.3*self.
height, dy = 0.1*self.
height, relative=
True)
264 self.arm_back(self.depth, relative=
True)
265 self.arm_right_down(dx= 0.3*self.
width, dy = - self.
width/2 + 0.3*self.
height, relative=
True)
268 arm = self.reference_arm()
269 ori = arm.wrist_orientation()
270 self.arm_forward(self.depth, relative=
True)
271 P = tsh.P(width = 0.4*self.
height, height = self.
height, direction = ori)
272 self.arm_trajectory(P)
273 self.arm_right_down(dy=0.5*self.
height, dx=0.25*self.
height, relative=
True)
274 self.arm_back(self.depth, relative=
True)
275 self.arm_right(dx=0.3*self.
width, relative=
True)
278 cth = math.cos(math.pi/3)
279 sth = math.sin(math.pi/3)
280 arm = self.reference_arm()
281 ori = arm.wrist_orientation()
283 self.arm_right_up(dy = 0.25*self.
height*(3+cth), dx = 0.4*self.
width + 0.25*self.
height*(1+sth), relative=
True)
284 self.arm_forward(self.depth, relative=
True)
285 S = tsh.S(height = self.
height, direction = ori)
286 self.arm_trajectory(S)
287 self.arm_back(self.depth, relative=
True)
288 self.arm_right_down(dy = 0.25*self.
height*(1-cth), dx = 0.4*self.
width + 0.6*self.
width*(1+sth), relative=
True)
291 arm = self.reference_arm()
292 ori = arm.wrist_orientation()
293 self.arm_right(self.
width/2, relative=
True)
294 self.arm_forward(self.depth, relative=
True)
295 self.arm_up(self.
height, relative=
True)
296 self.arm_back(self.depth, relative=
True)
297 self.arm_left(self.
width/2, relative=
True)
298 self.arm_forward(self.depth, relative=
True)
299 self.arm_right(self.
width, relative=
True)
300 self.arm_back(self.depth, relative=
True)
301 self.arm_right_down(0.3*self.
width, self.
height, relative=
True)
304 arm = self.reference_arm()
305 ori = arm.wrist_orientation()
306 self.arm_up(self.
height, relative=
True)
307 self.arm_forward(self.depth, relative=
True)
308 self.arm_right_down(0.5*self.
width, self.
height, relative=
True)
309 self.arm_right_up(0.5*self.
width, self.
height, relative=
True)
310 self.arm_back(self.depth, relative=
True)
311 self.arm_right_down(0.3*self.
width, self.
height, relative=
True)
314 arm = self.reference_arm()
315 ori = arm.wrist_orientation()
316 self.arm_up(self.
height, relative=
True)
317 self.arm_forward(self.depth, relative=
True)
318 W = tsh.W(width = 0.4*self.
height, height = self.
height, direction = ori)
319 self.arm_trajectory(W)
320 self.arm_back(self.depth, relative=
True)
321 self.arm_right_down(dy=self.
height, dx=0.3*self.
width, relative=
True)
324 arm = self.reference_arm()
325 ori = arm.wrist_orientation()
326 self.arm_forward(self.depth, relative=
True)
327 self.arm_right_up(self.
width, self.
height, relative=
True)
328 self.arm_back(self.depth, relative=
True)
329 self.arm_left(self.
width, relative=
True)
330 self.arm_forward(self.depth, relative=
True)
331 self.arm_right_down(self.
width, self.
height, relative=
True)
332 self.arm_back(self.depth, relative=
True)
333 self.arm_right(0.3*self.
width, relative=
True)
336 arm = self.reference_arm()
337 ori = arm.wrist_orientation()
338 self.arm_up(self.
height, relative=
True)
339 self.arm_forward(self.depth, relative=
True)
340 self.arm_right_down(self.
width/2, self.
height/2, relative=
True)
341 self.arm_right_up(self.
width/2, self.
height/2, relative=
True)
342 self.arm_back(self.depth, relative=
True)
343 self.arm_left_down(self.
width/2, self.
height/2, relative=
True)
344 self.arm_forward(self.depth, relative=
True)
345 self.arm_down(self.
height/2, relative=
True)
346 self.arm_back(self.depth, relative=
True)
347 self.arm_right(0.8*self.
width, relative=
True)
350 arm = self.reference_arm()
351 ori = arm.wrist_orientation()
352 self.arm_up(self.
height, relative=
True)
353 self.arm_forward(self.depth, relative=
True)
354 self.arm_right(self.
width, relative=
True)
355 self.arm_left_down(self.
width, self.
height, relative=
True)
356 self.arm_right(self.
width, relative=
True)
357 self.arm_back(self.depth, relative=
True)
358 self.arm_right(0.3*self.
width, relative=
True)
361 arm = self.reference_arm()
362 ori = arm.wrist_orientation()
363 self.arm_forward(self.depth, relative=
True)
364 self.arm_up(self.
height, relative=
True)
365 self.arm_right_down(dx = 0.5*self.
width, dy = 0.5*self.
height, relative=
True)
366 self.arm_right_up( dx = 0.5*self.
width, dy = 0.5*self.
height, relative=
True)
367 self.arm_down(self.
height, relative=
True)
368 self.arm_back(self.depth, relative=
True)
369 self.arm_right(0.3*self.
width, relative=
True)
427 self.arm_right(0.7*self.
width, relative=
True)
430 print "Error from Skilled_PR2.write_char(): Charachter Unknown !"
433 for i
in range(len(s)):