execute_pose.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # SVN $HeadURL$
00004 # SVN $Id$
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)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


nao_remote
Author(s): Armin Hornung
autogenerated on Sat Oct 26 2013 11:02:42