1dof_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('/mockarm_controller/init')
00021 initService = rospy.ServiceProxy('/mockarm_controller/init', Trigger)
00022 resp = initService()
00023 
00024 client = actionlib.SimpleActionClient('/mockarm_controller/follow_joint_trajectory',
00025                                       control_msgs.msg.FollowJointTrajectoryAction)
00026 client.wait_for_server()
00027 
00028 goal = control_msgs.msg.FollowJointTrajectoryGoal()
00029 
00030 
00031 p = trajectory_msgs.msg.JointTrajectoryPoint()
00032 p.positions = [0.5]
00033 p.time_from_start = rospy.Duration(3.0)
00034 
00035 goal.trajectory.points = [p]
00036 goal.trajectory.joint_names = ["mockarm_1_joint"]
00037 
00038 client.send_goal(goal)
00039 client.wait_for_result(rospy.Duration.from_sec(5.0))
00040 
00041 
00042 


ipa_canopen_tutorials
Author(s): tys
autogenerated on Mon Jan 6 2014 11:24:16