41
41
'delta_s_hand' : 0.0 ,
42
42
}
43
43
44
+
44
45
delta_rotate_corner_left = {
45
46
'name' : 'delta_rotate_left' ,
46
47
'command_flag' : 1 ,
305
306
'delta_tangential' : 0.0 ,
306
307
}
307
308
309
+ delta_rotate_hand_left_object_corner = {
310
+ 'name' : 'delta_rotate_hand_left_object_corner' ,
311
+ 'command_flag' : 4 ,
312
+ 'mode' : - 1 ,
313
+ 'delta_theta' : np .pi / 50 , #np.pi/12,
314
+ 'delta_s_pivot' : 0.0 ,
315
+ 'delta_s_hand' : 0.0 ,
316
+ }
317
+
318
+ delta_rotate_hand_right_object_corner = {
319
+ 'name' : 'delta_rotate_hand_right_object_corner' ,
320
+ 'command_flag' : 4 ,
321
+ 'mode' : - 1 ,
322
+ 'delta_theta' : - np .pi / 50 , #-np.pi/12,
323
+ 'delta_s_pivot' : 0.0 ,
324
+ 'delta_s_hand' : 0.0 ,
325
+ }
326
+
327
+ delta_rotate_object_left_object_corner = {
328
+ 'name' : 'delta_rotate_object_left_object_corner' ,
329
+ 'command_flag' : 4 ,
330
+ 'mode' : 0 ,
331
+ 'delta_theta' : np .pi / 50 , #np.pi/12,
332
+ 'delta_s_pivot' : 0.0 ,
333
+ 'delta_s_hand' : 0.0 ,
334
+ }
335
+
336
+ delta_rotate_object_right_object_corner = {
337
+ 'name' : 'delta_rotate_object_right_object_corner' ,
338
+ 'command_flag' : 4 ,
339
+ 'mode' : 0 ,
340
+ 'delta_theta' : - np .pi / 50 , #-np.pi/12,
341
+ 'delta_s_pivot' : 0.0 ,
342
+ 'delta_s_hand' : 0.0 ,
343
+ }
344
+
345
+
308
346
309
347
def on_release (key ):
310
348
# try:
@@ -322,18 +360,18 @@ def on_press(key):
322
360
323
361
global shift_on
324
362
global ctrl_on
325
- global alt_on
363
+ global tab_on
326
364
327
365
command_msg_dict = None
328
366
329
- not_a_modifier_key = key != keyboard .Key .shift and key != keyboard .Key .ctrl and key != keyboard .Key .alt
367
+ not_a_modifier_key = key != keyboard .Key .shift and key != keyboard .Key .ctrl and key != keyboard .Key .tab
330
368
# shift_on = keyboard.Key.shift in keys_held_down
331
369
# ctrl_on = keyboard.Key.ctrl in keys_held_down
332
- # alt_on = keyboard.Key.alt in keys_held_down
370
+ # tab_on = keyboard.Key.tab in keys_held_down
333
371
334
372
if key == keyboard .Key .shift :
335
373
ctrl_on = False
336
- alt_on = False
374
+ tab_on = False
337
375
338
376
shift_on = not shift_on
339
377
@@ -344,7 +382,7 @@ def on_press(key):
344
382
345
383
if key == keyboard .Key .ctrl :
346
384
shift_on = False
347
- alt_on = False
385
+ tab_on = False
348
386
349
387
ctrl_on = not ctrl_on
350
388
@@ -353,18 +391,18 @@ def on_press(key):
353
391
else :
354
392
print ('ctrl off' )
355
393
356
- if key == keyboard .Key .alt :
394
+ if key == keyboard .Key .tab :
357
395
shift_on = False
358
396
ctrl_on = False
359
397
360
- alt_on = not alt_on
398
+ tab_on = not tab_on
361
399
362
- if alt_on :
363
- print ('alt on' )
400
+ if tab_on :
401
+ print ('tab on' )
364
402
else :
365
- print ('alt off' )
403
+ print ('tab off' )
366
404
367
- modifier_state = shift_on + 2 * ctrl_on + 4 * alt_on
405
+ modifier_state = shift_on + 2 * ctrl_on + 4 * tab_on
368
406
369
407
# if not_a_modifier_key:
370
408
# print('modifier_state: ',modifier_state)
@@ -490,6 +528,23 @@ def on_press(key):
490
528
command_msg_dict = jog_move_right
491
529
print ('jog_move_right' )
492
530
531
+ if modifier_state == 4 :
532
+ if k == 'left' :
533
+ command_msg_dict = delta_rotate_hand_left_object_corner
534
+ print ('delta_rotate_hand_left_object_corner' )
535
+
536
+ if k == 'right' :
537
+ command_msg_dict = delta_rotate_hand_right_object_corner
538
+ print ('delta_rotate_hand_right_object_corner' )
539
+
540
+ if k == 'a' :
541
+ command_msg_dict = delta_rotate_object_left_object_corner
542
+ print ('delta_rotate_object_left_object_corner' )
543
+
544
+ if k == 'd' :
545
+ command_msg_dict = delta_rotate_object_right_object_corner
546
+ print ('delta_rotate_object_right_object_corner' )
547
+
493
548
if command_msg_dict is not None :
494
549
rm .pub_barrier_func_control_command (command_msg_dict )
495
550
@@ -533,7 +588,7 @@ def on_press(key):
533
588
534
589
shift_on = False
535
590
ctrl_on = False
536
- alt_on = False
591
+ tab_on = False
537
592
538
593
rm = ros_manager ()
539
594
rospy .init_node ('barrier_func_commands' )
0 commit comments