Go to the documentation of this file.00001
00002
00003 import roslib; roslib.load_manifest('slider_gui')
00004
00005 from actions.ActionSequence import ActionSequence
00006 from actions.ActionSet import ActionSet
00007 from actions.Pr2MoveHeadAction import Pr2MoveHeadAction
00008 from actions.Pr2MoveLeftArmAction import Pr2MoveLeftArmAction
00009 from actions.Pr2MoveLeftGripperAction import Pr2MoveLeftGripperAction
00010 from actions.Pr2MoveRightArmAction import Pr2MoveRightArmAction
00011 from actions.Pr2MoveTorsoAction import Pr2MoveTorsoAction
00012 from actions.WaitAction import WaitAction
00013 import rospy
00014
00015 rospy.init_node('test_actions')
00016
00017 seq = ActionSequence()
00018
00019 action1 = Pr2MoveLeftArmAction()
00020 action1.set_values([0, 0, 0, 0, 0, 0, 0])
00021 seq.add_action(action1)
00022
00023 action2 = Pr2MoveLeftArmAction()
00024 action2.set_values([0, 88, 0, -90, 0, 0, 90])
00025 seq.add_action(action2)
00026
00027 action3 = Pr2MoveRightArmAction()
00028 action3.set_values([0, 0, 0, 0, 0, 0, 0])
00029 seq.add_action(action3)
00030
00031 action4 = Pr2MoveRightArmAction()
00032 action4.set_values([0, 88, 0, -90, 0, 0, 90])
00033 seq.add_action(action4)
00034
00035 action5 = WaitAction(3.0)
00036 seq.add_action(action5)
00037
00038 action6 = Pr2MoveLeftGripperAction()
00039 action6.set_value(0.0)
00040 seq.add_action(action6)
00041
00042 action7 = Pr2MoveLeftGripperAction()
00043 action7.set_value(0.08)
00044 seq.add_action(action7)
00045
00046 action8 = Pr2MoveHeadAction()
00047 action8.set_values([-60, -30])
00048 action9 = Pr2MoveTorsoAction()
00049 action9.set_values([0.0])
00050 set1 = ActionSet()
00051 set1.add_action(action8)
00052 set1.add_action(action9)
00053 seq.add_action(set1)
00054
00055 action10 = Pr2MoveHeadAction()
00056 action10.set_values([60, 30])
00057 action11 = Pr2MoveTorsoAction()
00058 action11.set_values([0.3])
00059 set2 = ActionSet()
00060 set2.add_action(action10)
00061 set2.add_action(action11)
00062 seq.add_action(set2)
00063
00064 action5 = WaitAction(3.0)
00065 seq.add_action(action5)
00066
00067 def execute_sequence():
00068 global seq
00069 seq.execute_all()
00070
00071 seq.execute_sequence_finished_signal.connect(execute_sequence)
00072
00073 execute_sequence()
00074
00075 rospy.spin()