store_right_hand_unsafe.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import rospy
00004 from sr_robot_commander.sr_hand_commander import SrHandCommander
00005 
00006 rospy.init_node("store_right_hand", anonymous=True) 
00007 
00008 hand_commander = SrHandCommander()
00009 
00010 open_hand = {'rh_FFJ1': 0.0, 'rh_FFJ2': 0.0, 'rh_FFJ3': 0.0, 'rh_FFJ4': 0.0,
00011              'rh_MFJ1': 0.0, 'rh_MFJ2': 0.0, 'rh_MFJ3': 0.0, 'rh_MFJ4': 0.0,
00012              'rh_RFJ1': 0.0, 'rh_RFJ2': 0.0, 'rh_RFJ3': 0.0, 'rh_RFJ4': 0.0,
00013              'rh_LFJ1': 0.0, 'rh_LFJ2': 0.0, 'rh_LFJ3': 0.0, 'rh_LFJ4': 0.0, 'rh_LFJ5': 0.0,
00014              'rh_THJ1': 0.0, 'rh_THJ2': 0.0, 'rh_THJ3': 0.0, 'rh_THJ4': 0.0, 'rh_THJ5': 0.0,
00015              'rh_WRJ1': 0.0, 'rh_WRJ2': 0.0}
00016 pack_hand = {'rh_FFJ1': 1.5707, 'rh_FFJ2': 1.5707, 'rh_FFJ3': 1.5707, 'rh_FFJ4': 0.0,
00017              'rh_MFJ1': 1.5707, 'rh_MFJ2': 1.5707, 'rh_MFJ3': 1.5707, 'rh_MFJ4': 0.0,
00018              'rh_RFJ1': 1.5707, 'rh_RFJ2': 1.5707, 'rh_RFJ3': 1.5707, 'rh_RFJ4': 0.0,
00019              'rh_LFJ1': 1.5707, 'rh_LFJ2': 1.5707, 'rh_LFJ3': 1.5707, 'rh_LFJ4': 0.0, 'rh_LFJ5': 0.0,
00020              'rh_THJ1': 0.71, 'rh_THJ2': 0.62, 'rh_THJ3': 0.0, 'rh_THJ4': 1.15, 'rh_THJ5': 0.26,
00021              'rh_WRJ1': 0.0, 'rh_WRJ2': 0.0}
00022 
00023 
00024 # Move hand
00025 joint_states = open_hand
00026 rospy.loginfo("Moving hand to joint states\n" + str(joint_states) + "\n")
00027 hand_commander.move_to_joint_value_target_unsafe(joint_states, 2.0, True)
00028 
00029 joint_states = pack_hand
00030 rospy.loginfo("Moving hand to joint states\n" + str(joint_states) + "\n")
00031 hand_commander.move_to_joint_value_target_unsafe(joint_states, 2.0, True)
00032 


sr_example
Author(s): Ugo Cupcic
autogenerated on Fri Aug 21 2015 12:25:43