23 from sr_robot_commander.sr_hand_commander
import SrHandCommander
25 rospy.init_node(
"store_left_hand", anonymous=
True)
27 hand_commander = SrHandCommander(name=
"left_hand")
29 open_hand = {
'lh_FFJ1': 0.0,
'lh_FFJ2': 0.0,
'lh_FFJ3': 0.0,
'lh_FFJ4': 0.0,
30 'lh_MFJ1': 0.0,
'lh_MFJ2': 0.0,
'lh_MFJ3': 0.0,
'lh_MFJ4': 0.0,
31 'lh_RFJ1': 0.0,
'lh_RFJ2': 0.0,
'lh_RFJ3': 0.0,
'lh_RFJ4': 0.0,
32 'lh_LFJ1': 0.0,
'lh_LFJ2': 0.0,
'lh_LFJ3': 0.0,
'lh_LFJ4': 0.0,
'lh_LFJ5': 0.0,
33 'lh_THJ1': 0.0,
'lh_THJ2': 0.0,
'lh_THJ3': 0.0,
'lh_THJ4': 0.0,
'lh_THJ5': 0.0,
34 'lh_WRJ1': 0.0,
'lh_WRJ2': 0.0}
36 pack_hand_1 = {
'lh_FFJ1': 1.5707,
'lh_FFJ2': 1.5707,
'lh_FFJ3': 1.5707,
'lh_FFJ4': 0.0,
37 'lh_MFJ1': 1.5707,
'lh_MFJ2': 1.5707,
'lh_MFJ3': 1.5707,
'lh_MFJ4': 0.0,
38 'lh_RFJ1': 1.5707,
'lh_RFJ2': 1.5707,
'lh_RFJ3': 1.5707,
'lh_RFJ4': 0.0,
39 'lh_LFJ1': 1.5707,
'lh_LFJ2': 1.5707,
'lh_LFJ3': 1.5707,
'lh_LFJ4': 0.0,
'lh_LFJ5': 0.0}
41 pack_hand_2 = {
'lh_THJ4': 1.2}
43 pack_hand_3 = {
'lh_THJ1': 0.73,
'lh_THJ2': 0.41,
'lh_THJ5': 0.43}
47 joint_states = open_hand
48 rospy.loginfo(
"Moving hand to open position")
49 hand_commander.move_to_joint_value_target_unsafe(joint_states, 2.0,
False)
53 joint_states = pack_hand_1
54 rospy.loginfo(
"Moving hand to pack position")
55 hand_commander.move_to_joint_value_target_unsafe(joint_states, 2.0,
False)
58 joint_states = pack_hand_2
59 hand_commander.move_to_joint_value_target_unsafe(joint_states, 2.0,
False)
62 joint_states = pack_hand_3
63 hand_commander.move_to_joint_value_target_unsafe(joint_states, 2.0,
False)