Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 import roslib; roslib.load_manifest('rosie_torso_action')
00023 import rospy
00024
00025 from actionlib_msgs.msg import *
00026 from pr2_common_action_msgs.msg import *
00027 from pr2_controllers_msgs.msg import *
00028 import actionlib
00029
00030 class TorsoActionServer:
00031 def __init__(self, node_name):
00032 self.node_name = node_name
00033 self.action_server = actionlib.simple_action_server.SimpleActionServer(node_name, SingleJointPositionAction, self.executeCB)
00034
00035 def executeCB(self, goal):
00036 print("executing a torso action!")
00037
00038 result = SingleJointPositionResult()
00039 self.action_server.set_succeeded(result)
00040
00041 def main():
00042 action_name = 'rosie_torso_action'
00043 action_name = '/torso_controller/position_joint_action'
00044 rospy.loginfo("%s: Starting up!" %(action_name))
00045
00046 rospy.init_node("torso_action")
00047 tuck_arms_action_server = TorsoActionServer(action_name)
00048 rospy.spin()
00049
00050 if __name__ == '__main__':
00051 main()