WUT Velma robot API
object_manipulation_hw-sim.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 from __future__ import print_function
3 from __future__ import division
4 
5 import roslib; roslib.load_manifest('velma_task_cs_ros_interface')
6 import rospy
7 import math
8 import tf
9 
10 from velma_common import *
11 from rcprg_ros_utils import exitError
12 
13 def move_jnt_imp(q_dest, time):
14  global velma
15  print("Moving to the required position...")
16  velma.moveJoint(q_dest, time, start_time=0.01, position_tol=15.0/180.0*math.pi)
17  error = velma.waitForJoint()
18  if error != 0:
19  print("The action should have ended without error, but the error code is", error)
20  exitError(5)
21 
22 def switch2cart_imp_mode(rORl, timeout):
23  global velma
24  print("Switch to cart_imp mode (no trajectory)...")
25  if (rORl == "right"):
26  if not velma.moveCartImpRightCurrentPos(start_time=0.5):
27  exitError(7)
28  if velma.waitForEffectorRight(timeout_s=timeout) != 0:
29  exitError(8)
30  elif (rORl == "left"):
31  if not velma.moveCartImpLeftCurrentPos(start_time=0.5):
32  exitError(9)
33  if velma.waitForEffectorLeft(timeout_s=timeout) != 0:
34  exitError(10)
35  rospy.sleep(1.0)
36  diag = velma.getCoreCsDiag()
37  if not diag.inStateCartImp():
38  print("The core_cs should be in cart_imp state, but it is not")
39  exitError(11)
40 
42  global velma
43  print("Switch to jnt_imp mode (no trajectory)...")
44  velma.moveJointImpToCurrentPos(start_time=0.5)
45  error = velma.waitForJoint()
46  if error != 0:
47  print("The action should have ended without error, but the error code is", error)
48  exitError(12)
49  rospy.sleep(1.0)
50  diag = velma.getCoreCsDiag()
51  if not diag.inStateJntImp():
52  print("The core_cs should be in jnt_imp state, but it is not")
53  exitError(13)
54 
55 def closeORopen_gripper(rORl, dest_q):
56  global velma
57  if (rORl == "right"):
58  print("move of right gripper:", dest_q)
59  velma.moveHandRight(dest_q, [1.5,1.5,1.5,1.5], [5000,5000,5000,5000], 2000, hold=True)
60  if velma.waitForHandRight() != 0:
61  exitError(14)
62  rospy.sleep(0.1)
63  if not isHandConfigurationClose( velma.getHandRightCurrentConfiguration(), dest_q, tolerance=2.0):
64  exitError(15)
65  elif (rORl == "left"):
66  print("move of left gripper:", dest_q)
67  velma.moveHandLeft(dest_q, [1.5,1.5,1.5,1.5], [5000,5000,5000,5000], 2000, hold=True)
68  if velma.waitForHandLeft() != 0:
69  exitError(16)
70  rospy.sleep(0.1)
71  if not isHandConfigurationClose( velma.getHandLeftCurrentConfiguration(), dest_q, tolerance=2.0):
72  exitError(17)
73 
74 def tool2grip_pose(rORl):
75  if (rORl == "right"):
76  print("Moving the right tool and equilibrium pose from 'wrist' to 'grip' frame...")
77  T_B_Wr = velma.getTf("B", "Wr")
78  T_Wr_Gr = velma.getTf("Wr", "Gr")
79  if not velma.moveCartImpRight([T_B_Wr*T_Wr_Gr], [0.5], [T_Wr_Gr], [0.5], None, None, PyKDL.Wrench(PyKDL.Vector(5,5,5), PyKDL.Vector(5,5,5)), start_time=0.5):
80  exitError(18)
81  if velma.waitForEffectorRight() != 0:
82  exitError(19)
83  print("The right tool is now in 'grip' pose")
84  elif (rORl == "left"):
85  print("Moving the left tool and equilibrium pose from 'wrist' to 'grip' frame...")
86  T_B_Wl = velma.getTf("B", "Wl")
87  T_Wl_Gl = velma.getTf("Wl", "Gl")
88  if not velma.moveCartImpLeft([T_B_Wl*T_Wl_Gl], [0.5], [T_Wl_Gl], [0.5], None, None, PyKDL.Wrench(PyKDL.Vector(5,5,5), PyKDL.Vector(5,5,5)), start_time=0.5):
89  exitError(20)
90  if velma.waitForEffectorLeft() != 0:
91  exitError(21)
92  print("The left tool is now in 'grip' pose")
93  rospy.sleep(0.1)
94 
95 def move_cart_imp(rORl, T_frame, imp_list, pt_val, time):
96  t0 = 0.5
97  max_wr = PyKDL.Wrench(PyKDL.Vector(5,5,5), PyKDL.Vector(5,5,5))
98  p_tol = PyKDL.Twist(PyKDL.Vector(pt_val,pt_val,pt_val), PyKDL.Vector(pt_val,pt_val,pt_val)) # path_tolerance
99  if (rORl == "right"):
100  print("Moving right wrist to pose defined in world frame...")
101  if not velma.moveCartImpRight([T_frame], [time], None, None, [imp_list], [0.01], max_wrench = max_wr, start_time = t0, path_tol = p_tol):
102  exitError(22)
103  if velma.waitForEffectorRight() != 0:
104  exitError(23)
105  elif (rORl == "left"):
106  print("Moving left wrist to pose defined in world frame...")
107  if not velma.moveCartImpLeft([T_frame], [time], None, None, [imp_list], [0.01], max_wrench = max_wr, start_time = t0, path_tol = p_tol):
108  exitError(24)
109  if velma.waitForEffectorLeft() != 0:
110  exitError(25)
111  rospy.sleep(0.1)
112 
113 def identification_movements(rightORleft, imp_list, pt_val, dest_qGrasped, dest_qOpened, T_B_Trd, T_B_Trd2, T_B_Trd_Identif1, T_B_Trd_Identif2):
114  imp_list_id = PyKDL.Wrench(PyKDL.Vector(1000, 1000, 1000), PyKDL.Vector(400, 400, 400))
115  # checking finger's configuration required to grasped the object
116  print("*** start of identification procedure ***")
117  move_cart_imp(rightORleft, T_B_Trd, imp_list_id, pt_val, 8.0)
119  closeORopen_gripper(rightORleft, dest_qGrasped)
120  isHandConfigClose_rORl(rightORleft)
121  q_hand = velma.getHandCurrentConfiguration(rightORleft)
122  dest_qChecked = [q_hand[1], q_hand[4], q_hand[6], 0]
123  print("[FingerOneKnuckleTwo, FingerTwoKnuckleTwo, FingerThreeKnuckleTwo, Spread]:", dest_qChecked)
124  rospy.sleep(0.5)
125  closeORopen_gripper(rightORleft, dest_qOpened)
126  print("Velma's", rightORleft, "gripper opened")
127 
128  # taking mesurements before grasping the object
129  switch2cart_imp_mode(rightORleft, 1.0)
130  #exit(2)
131  tool2grip_pose(rightORleft)
132 
133  print("Moving gripper to first given pose and take first identification measurement")
134  move_cart_imp(rightORleft, T_B_Trd_Identif1, imp_list_id, pt_val, 8.0)
135  closeORopen_gripper(rightORleft, dest_qChecked)
136  rospy.sleep(0.5)
137  velma.sendIdentificationMeasurementCommand(rightORleft, 1)
138  rospy.sleep(0.5)
139  print("Moving gripper to second given pose and take second identification measurement")
140  move_cart_imp(rightORleft, T_B_Trd_Identif2, imp_list_id, pt_val, 8.0)
141  rospy.sleep(0.5)
142  velma.sendIdentificationMeasurementCommand(rightORleft, 2)
143  rospy.sleep(0.5)
144  move_cart_imp(rightORleft, T_B_Trd_Identif1, imp_list_id, pt_val, 8.0)
145 
146  # opening gripper
148  closeORopen_gripper(rightORleft, dest_qOpened)
149  print("Velma's", rightORleft, "gripper opened")
150 
151  # grabbing the object
152  switch2cart_imp_mode(rightORleft, 1.0)
153  tool2grip_pose(rightORleft)
154  print("Moving gripper to pose before grasping object...")
155  move_cart_imp(rightORleft, T_B_Trd, imp_list_id, pt_val, 8.0)
157  closeORopen_gripper(rightORleft, dest_qGrasped)
158  isHandConfigClose_rORl(rightORleft)
159 
160  # taking mesurements after grasping the object
161  switch2cart_imp_mode(rightORleft, 1.0)
162  tool2grip_pose(rightORleft)
163  print("Moving gripper up...")
164  move_cart_imp(rightORleft, T_B_Trd2, imp_list, pt_val, 3.0)
165  print("Moving gripper to first given pose and take third identification measurement")
166  move_cart_imp(rightORleft, T_B_Trd_Identif1, imp_list_id, pt_val, 8.0)
167  rospy.sleep(0.5)
168  velma.sendIdentificationMeasurementCommand(rightORleft, 3)
169  rospy.sleep(0.5)
170  print("Moving gripper to second given pose and take fourth identification measurement")
171  move_cart_imp(rightORleft, T_B_Trd_Identif2, imp_list_id, pt_val, 12.0)
172  rospy.sleep(0.5)
173  velma.sendIdentificationMeasurementCommand(rightORleft, 4)
174  rospy.sleep(0.5)
175  move_cart_imp(rightORleft, T_B_Trd_Identif1, imp_list, pt_val, 8.0)
176  print("*** end of identification procedure ***")
177 
178 def switch_weight_compensation(rightORleft, GRAV_OBJ_COMP, imp_list, pt_val):
179  if(rightORleft == 'right'):
180  T_B_Trd = velma.getTf("B", "Gr")
181  elif(rightORleft == 'left'):
182  T_B_Trd = velma.getTf("B", "Gl")
183  velma.setGraspedFlag(rightORleft, GRAV_OBJ_COMP)
184  move_cart_imp(rightORleft, T_B_Trd, imp_list, pt_val, 2.0)
185 
186 def diff_calc(rORl, T_frame):
187  print("Calculating difference between desiread and reached pose...")
188  if (rORl == "right"):
189  T_B_T_diff = PyKDL.diff(T_frame, velma.getTf("B", "Tr"), 1.0)
190  elif (rORl == "left"):
191  T_B_T_diff = PyKDL.diff(T_frame, velma.getTf("B", "Tl"), 1.0)
192  print(T_B_T_diff)
193 
194 def get_tf_rORl(rORl):
195  if (rORl == "right"):
196  T_Wo_grip = velma.getTf("Wo", "Gr") # right gripper
197  elif (rORl == "left"):
198  T_Wo_grip = velma.getTf("Wo", "Gl") # left gripper
199  return T_Wo_grip
200 
202  if (rORl == "right"):
203  if isHandConfigurationClose( velma.getHandRightCurrentConfiguration(), dest_qGrasped, tolerance=0.02):
204  print("Object not grabbed")
205  exitError(26)
206  else:
207  print("Right gripper grabbed the object")
208  elif (rORl == "left"):
209  if isHandConfigurationClose( velma.getHandLeftCurrentConfiguration(), dest_qGrasped, tolerance=0.02):
210  print("Object not grabbed")
211  exitError(27)
212  else:
213  print("Left gripper grabbed the object")
214 
215 def q_map_rORl0(rORl):
216  if (rORl == "right"):
217  q_mapR = {'torso_0_joint':0,
218  'right_arm_0_joint':-0.3, 'left_arm_0_joint':0.3,
219  'right_arm_1_joint':-1.8, 'left_arm_1_joint':1.8,
220  'right_arm_2_joint':1.25, 'left_arm_2_joint':-1.25,
221  'right_arm_3_joint':2.0, 'left_arm_3_joint':-0.85,
222  'right_arm_4_joint':0, 'left_arm_4_joint':0,
223  'right_arm_5_joint':-0.5, 'left_arm_5_joint':0.5,
224  'right_arm_6_joint':0, 'left_arm_6_joint':0 }
225  return q_mapR
226  elif (rORl == "left"):
227  q_mapL = {'torso_0_joint':0,
228  'right_arm_0_joint':-0.3, 'left_arm_0_joint':0.3,
229  'right_arm_1_joint':-1.8, 'left_arm_1_joint':1.8,
230  'right_arm_2_joint':1.25, 'left_arm_2_joint':-1.25,
231  'right_arm_3_joint':0.85, 'left_arm_3_joint':-2.0,
232  'right_arm_4_joint':0, 'left_arm_4_joint':0,
233  'right_arm_5_joint':-0.5, 'left_arm_5_joint':0.5,
234  'right_arm_6_joint':0, 'left_arm_6_joint':0 }
235  return q_mapL
236 
237 def q_map_rORl(rORl, torso_angle):
238  if (rORl == "right"):
239  q_mapR = {'torso_0_joint':torso_angle,
240  'right_arm_0_joint':0.6, 'left_arm_0_joint':0.3,
241  'right_arm_1_joint':-1.1, 'left_arm_1_joint':1.8,
242  'right_arm_2_joint':1.5, 'left_arm_2_joint':-1.25,
243  'right_arm_3_joint':1.8, 'left_arm_3_joint':-0.85,
244  'right_arm_4_joint':1.2, 'left_arm_4_joint':0,
245  'right_arm_5_joint':-1.05, 'left_arm_5_joint':0.5,
246  'right_arm_6_joint':0, 'left_arm_6_joint':0 }
247  return q_mapR
248  elif (rORl == "left"):
249  q_mapL = {'torso_0_joint':torso_angle,
250  'right_arm_0_joint':-0.3, 'left_arm_0_joint':-0.6,
251  'right_arm_1_joint':-1.8, 'left_arm_1_joint':1.1,
252  'right_arm_2_joint':1.25, 'left_arm_2_joint':-1.5,
253  'right_arm_3_joint':0.85, 'left_arm_3_joint':-1.8,
254  'right_arm_4_joint':0, 'left_arm_4_joint':-1.2,
255  'right_arm_5_joint':-0.5, 'left_arm_5_joint':1.05,
256  'right_arm_6_joint':0, 'left_arm_6_joint':0 }
257  return q_mapL
258 
259 
260 if __name__ == "__main__":
261 
262  # start position
263  q_map_starting = {'torso_0_joint':0,
264  'right_arm_0_joint':-0.3, 'left_arm_0_joint':0.3,
265  'right_arm_1_joint':-1.8, 'left_arm_1_joint':1.8,
266  'right_arm_2_joint':1.25, 'left_arm_2_joint':-1.25,
267  'right_arm_3_joint':0.85, 'left_arm_3_joint':-0.85,
268  'right_arm_4_joint':0, 'left_arm_4_joint':0,
269  'right_arm_5_joint':-0.5, 'left_arm_5_joint':0.5,
270  'right_arm_6_joint':0, 'left_arm_6_joint':0 }
271 
272  rospy.init_node('object_control_test')
273  rospy.sleep(0.5)
274 
275 
276  rightORleft = 'right'
277  #rightORleft = 'left'
278 
280  CART_TEST = False
281 
282  GRAV_OBJ_COMP = True
283  #GRAV_OBJ_COMP = False
284 
285 
286  print("Chosen gripper:", rightORleft)
287  print("CART_TEST:", CART_TEST)
288  print("GRAV_OBJ_COMP:", GRAV_OBJ_COMP)
289 
290  # defining the parametres
291  imp_list = PyKDL.Wrench(PyKDL.Vector(500, 500, 500), PyKDL.Vector(100, 100, 100)) # forces and torques
292  pt_val = 0.5
293 
294  dest_qOpened = [0, 0, 0, 0]
295  dest_qClosed = [90.0/180.0*math.pi, 90.0/180.0*math.pi, 90.0/180.0*math.pi, 0]
296  dest_qGrasped = [85.0/180.0*math.pi, 85.0/180.0*math.pi, 85.0/180.0*math.pi, 0]
297 
298  # initializing
299  print("Running python interface for Velma...")
300  velma = VelmaInterface()
301  print("Waiting for VelmaInterface initialization...")
302  if not velma.waitForInit(timeout_s=5.0):
303  print("Could not initialize VelmaInterface")
304  exitError(1)
305  print("Initialization ok!")
306 
307  # rospy.sleep(10)
308  # T_B_Gr = velma.getTf("B", "Gr")
309  # print(T_B_Gr.p)
310  # exit(0)
311 
312  diag = velma.getCoreCsDiag()
313  if not diag.motorsReady():
314  print("Motors must be homed and ready to use for this test.")
315  exitError(2)
316 
317  if velma.enableMotors() != 0:
318  exitError(4)
319 
320  # nothing grasped
321  velma.setGraspedFlag('right', False)
322  velma.setGraspedFlag('left', False)
323 
324  # closing grippers
326  closeORopen_gripper("right", dest_qClosed)
327  print("Right gripper closed")
328  closeORopen_gripper("left", dest_qClosed)
329  print("Left gripper closed")
330 
331  # [time, q_actual] = velma.getLastJointState()
332  # print(q_actual)
333  # move_jnt_imp(q_actual, 2.0)
334 
335  #move_jnt_imp(q_map_starting, 15.0)
336  #exit(1)
337 
338  # moving to proper configuration & opening gripper
339  alfa = 0.0
340  q_map_0 = q_map_rORl0(rightORleft)
341  q_map_1 = q_map_rORl(rightORleft, alfa)
342  move_jnt_imp(q_map_0, 4.0)
343  move_jnt_imp(q_map_1, 8.0)
344  closeORopen_gripper(rightORleft, dest_qOpened)
345  print("Velma's", rightORleft, "gripper opened")
346  #exit(101)
347 
348  # cart_imp_mode initializing
349  switch2cart_imp_mode(rightORleft, 1.0)
350  print("Reset tools for both arms...")
351  T_B_Wr = velma.getTf("B", "Wr")
352  T_B_Wl = velma.getTf("B", "Wl")
353  if not velma.moveCartImpRight([T_B_Wr], [0.5], [PyKDL.Frame()], [0.5], None, None, PyKDL.Wrench(PyKDL.Vector(5,5,5), PyKDL.Vector(5,5,5)), start_time=0.5):
354  exitError(29)
355  if not velma.moveCartImpLeft([T_B_Wl], [0.5], [PyKDL.Frame()], [0.5], None, None, PyKDL.Wrench(PyKDL.Vector(5,5,5), PyKDL.Vector(5,5,5)), start_time=0.5):
356  exitError(30)
357  if velma.waitForEffectorRight() != 0:
358  exitError(31)
359  if velma.waitForEffectorLeft() != 0:
360  exitError(32)
361 
362  # preparing to move gripper to the object in cart_imp_mode
363  tool2grip_pose(rightORleft)
364  T_Wo_grip = get_tf_rORl(rightORleft)
365  # do odczytania object_frame --------------------------------------------------
366  # T_Wo_obj1_pos = PyKDL.Vector(0.621926, -0.260334, 0.851752)
367  if(rightORleft == 'right'):
368  T_Wo_obj1_pos = PyKDL.Vector(0.95, -0.12, 1.3) # object
369  elif(rightORleft == 'left'):
370  T_Wo_obj1_pos = PyKDL.Vector(0.95, 0.12, 1.3) # object
371 
372  T_B_Trd = PyKDL.Frame(T_Wo_grip.M, T_Wo_obj1_pos + PyKDL.Vector(0.0, 0.0, 0.0))
373  T_B_Trd2 = PyKDL.Frame(T_Wo_grip.M, T_Wo_obj1_pos + PyKDL.Vector(0.0, 0.0, 0.05))
374 
375  dr = (T_Wo_obj1_pos - T_Wo_grip.p)
376  drL = math.sqrt(dr[0]**2 + dr[1]**2)
377  T_B_Trd_Identif1 = PyKDL.Frame(T_Wo_grip.M, T_Wo_obj1_pos + PyKDL.Vector(-0.2*dr[0]/drL, -0.2*dr[1]/drL, 0.05))
378  if (rightORleft == "right"):
379  R_z = PyKDL.Rotation.RotZ(-math.pi/2)
380  elif (rightORleft == "left"):
381  R_z = PyKDL.Rotation.RotZ(math.pi/2)
382  T_B_Trd_Identif2 = PyKDL.Frame(T_Wo_grip.M*R_z, T_Wo_obj1_pos + PyKDL.Vector(-0.2*dr[0]/drL, -0.2*dr[1]/drL, 0.05))
383 
384  # identification procedure
385  identification_movements(rightORleft, imp_list, pt_val, dest_qGrasped, dest_qOpened, T_B_Trd, T_B_Trd2, T_B_Trd_Identif1, T_B_Trd_Identif2)
386 
387  # use identified params or not
388  switch_weight_compensation(rightORleft, GRAV_OBJ_COMP, imp_list, pt_val)
389 
390  # moving gripper up
391  # print("Moving gripper up...")
392  # move_cart_imp(rightORleft, T_B_Trd2, imp_list, pt_val, 3.0)
393 
394  # if(CART_TEST == True):
395  # q_map_2 = q_map_rORl(rightORleft, 0.0)
396  # switch2jnt_imp_mode()
397  # move_jnt_imp(q_map_2, 4.0)
398 
399  # if(rightORleft == 'right'):
400  # pm = 1.0
401  # quat_z = 0.0
402  # quat_w = 1.0
403  # elif(rightORleft == 'left'):
404  # pm = -1.0
405  # quat_z = math.sin(math.pi/2) # 1.0 -> sin(theta/2)
406  # quat_w = math.cos(math.pi/2) # 0.0 -> cos(theta/2)
407  # else:
408  # print("rightORleft and pm problem...")
409  # exitError(34)
410 
411  # T_B_Trd2 = PyKDL.Frame(PyKDL.Rotation.Quaternion( 0.0 , 0.0 , quat_z , quat_w ), PyKDL.Vector( 0.7, -0.2*pm, 1.45))
412  # T_B_Trd3 = PyKDL.Frame(PyKDL.Rotation.Quaternion( 0.0 , 0.0 , quat_z , quat_w ), PyKDL.Vector( 0.7, -0.2*pm, 1.35))
413  # T_B_Trd4 = PyKDL.Frame(PyKDL.Rotation.Quaternion( 0.0 , 0.0 , quat_z , quat_w ), PyKDL.Vector( 0.7, -0.1*pm, 1.35))
414  # T_B_Trd5 = PyKDL.Frame(PyKDL.Rotation.Quaternion( 0.0 , 0.0 , quat_z , quat_w ), PyKDL.Vector( 0.7, -0.1*pm, 1.45))
415 
416  # switch2cart_imp_mode(rightORleft, 1.0) # optional
417  # move_cart_imp(rightORleft, T_B_Trd2, imp_list, pt_val, 3.0)
418  # diff_calc(rightORleft, T_B_Trd2)
419 
420  # i = 0
421  # while i < 2:
422  # move_cart_imp(rightORleft, T_B_Trd3, imp_list, pt_val, 3.0)
423  # diff_calc(rightORleft, T_B_Trd3)
424  # move_cart_imp(rightORleft, T_B_Trd4, imp_list, pt_val, 3.0)
425  # diff_calc(rightORleft, T_B_Trd4)
426  # move_cart_imp(rightORleft, T_B_Trd5, imp_list, pt_val, 3.0)
427  # diff_calc(rightORleft, T_B_Trd5)
428  # move_cart_imp(rightORleft, T_B_Trd2, imp_list, pt_val, 3.0)
429  # diff_calc(rightORleft, T_B_Trd2)
430  # rospy.sleep(1.0)
431  # i += 1
432 
433  # # calculating the angle and moving to proper configuration
434  # switch2jnt_imp_mode()
435  # q_map_end = q_map_rORl(rightORleft, alfa)
436  # move_jnt_imp(q_map_end, 8.0)
437 
438  # procedure of putting down the object
439  # switch2cart_imp_mode(rightORleft, 1.0)
440  # tool2grip_pose(rightORleft)
441  # T_Wo_grip = get_tf_rORl(rightORleft)
442 
443  print("Moving gripper to object's destination")
444  # do wpisania --------------------------------------------------------
445  #T_B_Trd = PyKDL.Frame(T_Wo_grip.M, T_Wo_obj1_pos + PyKDL.Vector(0.0, 0.0, 0.01))
446  move_cart_imp(rightORleft, T_B_Trd2, imp_list, pt_val, 12.0)
447 
448  # opening gripper
450  [time, q_actual] = velma.getLastJointState()
451  velma.setGraspedFlag(rightORleft, False)
452  move_jnt_imp(q_actual, 2.0)
453  closeORopen_gripper(rightORleft, dest_qOpened)
454  print("Velma's", rightORleft, "gripper opened")
455 
456  # moving gripper up
457  switch2cart_imp_mode(rightORleft, 1.0)
458  tool2grip_pose(rightORleft)
459  print("Moving", rightORleft, "gripper up...")
460 
461  # do wpisania --------------------------------------------------------
462  #T_B_Trd = PyKDL.Frame(T_Wo_grip.M, T_Wo_obj1_pos + PyKDL.Vector(0.0, 0.0, 0.1))
463  move_cart_imp(rightORleft, T_B_Trd_Identif1, imp_list, pt_val, 8.0)
464 
465  # closing gripper
467  closeORopen_gripper(rightORleft, dest_qClosed)
468  print("Velma's", rightORleft, "gripper closed")
469 
470  # moving to start position
471  move_jnt_imp(q_map_1, 4.0)
472  move_jnt_imp(q_map_0, 8.0)
473  move_jnt_imp(q_map_starting, 4.0)
474 
475  # opening grippers
476  # closeORopen_gripper("right", dest_qOpened)
477  # print("Right gripper opened")
478  # closeORopen_gripper("left", dest_qOpened)
479  # print("Left gripper opened")
480 
481  rospy.sleep(0.5)
482 
483  exitError(0)
def switch_weight_compensation(rightORleft, GRAV_OBJ_COMP, imp_list, pt_val)
def identification_movements(rightORleft, imp_list, pt_val, dest_qGrasped, dest_qOpened, T_B_Trd, T_B_Trd2, T_B_Trd_Identif1, T_B_Trd_Identif2)
def isHandConfigurationClose(current_q, dest_q, tolerance=0.1)
Check if two configurations of robot hand are close within tolerance.
def move_cart_imp(rORl, T_frame, imp_list, pt_val, time)