Go to the documentation of this file.00001
00002 import roslib; roslib.load_manifest('pr2_precise_trajectory')
00003 import rospy
00004 from pr2_precise_trajectory.converter import simple_to_joint_states, load_trajectory
00005 import sys
00006
00007 if __name__ == '__main__':
00008 movements = load_trajectory( sys.argv[1] )
00009 rospy.init_node('play_as_joints')
00010 pub = rospy.Publisher('/arm_angles', JointState)
00011
00012 for state in simple_to_joint_states(movements):
00013 wait = (state.header.stamp - rospy.Time.now()).to_sec()
00014 if wait > 0:
00015 rospy.sleep(wait)
00016 pub.publish(state)
00017
00018 if rospy.is_shutdown():
00019 break
00020
00021