$search
00001 #!/usr/bin/env python 00002 00003 # SVN $HeadURL: http://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_stacks/nao_common/nao_remote/scripts/execute_pose.py $ 00004 # SVN $Id: execute_pose.py 2738 2012-05-20 20:31:05Z hornunga@informatik.uni-freiburg.de $ 00005 00006 # A simple action client calling the pose_manager 00007 # 00008 # Author: Armin Hornung, University of Freiburg 00009 00010 00011 00012 import roslib 00013 roslib.load_manifest('nao_remote') 00014 import rospy 00015 import sys 00016 import actionlib 00017 00018 from nao_msgs.msg import BodyPoseAction, BodyPoseGoal 00019 00020 if __name__ == '__main__': 00021 if len(sys.argv) != 2: 00022 sys.exit('\nUSAGE: %s pose_name\n\n' % sys.argv[0]) 00023 00024 rospy.init_node('execute_pose') 00025 00026 poseClient = actionlib.SimpleActionClient("body_pose", BodyPoseAction) 00027 if not poseClient.wait_for_server(rospy.Duration(3.0)): 00028 rospy.logfatal("Could not connect to required \"body_pose\" action server, is the pose_manager node running?"); 00029 rospy.signal_shutdown(); 00030 00031 goal = BodyPoseGoal 00032 goal.pose_name = str(sys.argv[1]) 00033 rospy.loginfo("Calling pose_manager for pose %s...", goal.pose_name) 00034 00035 00036 poseClient.send_goal_and_wait(goal, rospy.Duration(5.0)) 00037 #TODO: check for errors 00038 exit(0)