3dof_action_client.py
Go to the documentation of this file.
00001 #!/usr/bin/python
00002 
00003 import roslib
00004 roslib.load_manifest('ipa_canopen_tutorials')
00005 import rospy
00006 import actionlib
00007 import control_msgs.msg
00008 import trajectory_msgs.msg
00009 from cob_srvs.srv import Trigger
00010 from brics_actuator.msg import JointVelocities
00011 from brics_actuator.msg import JointValue
00012 
00013 
00014 #from cob_srvs.srv import Trigger
00015 #from brics_actuator.msg import JointVelocities
00016 #from brics_actuator.msg import JointValue
00017 
00018 rospy.init_node("trajectory_controller_action_client")
00019 
00020 rospy.wait_for_service('/tray_controller/init')
00021 print "found init"
00022 initService = rospy.ServiceProxy('/tray_controller/init', Trigger)
00023 print "hO"
00024 resp = initService()
00025 print "hI"
00026 print resp
00027 
00028 client = actionlib.SimpleActionClient('/tray_controller/follow_joint_trajectory',
00029                                       control_msgs.msg.FollowJointTrajectoryAction)
00030 client.wait_for_server()
00031 
00032 goal = control_msgs.msg.FollowJointTrajectoryGoal()
00033 
00034 
00035 p = trajectory_msgs.msg.JointTrajectoryPoint()
00036 p.positions = [0.0,0.0,0.5]
00037 p.time_from_start = rospy.Duration(3.0)
00038 
00039 goal.trajectory.points = [p]
00040 goal.trajectory.joint_names = ["tray_1_joint","tray_2_joint","tray_3_joint"]
00041 
00042 client.send_goal(goal)
00043 client.wait_for_result(rospy.Duration.from_sec(5.0))
00044 
00045 
00046 
00047 


ipa_canopen_tutorials
Author(s): tys
autogenerated on Mon Oct 6 2014 10:41:52