23 from geometry_msgs.msg
import Pose
24 from cob_cartesian_controller.msg
import CartesianControllerAction, CartesianControllerGoal
25 from cob_cartesian_controller.msg
import Profile
29 action_name = rospy.get_namespace()+
'cartesian_trajectory_action' 31 rospy.logwarn(
"Waiting for ActionServer: %s", action_name)
32 success = client.wait_for_server(rospy.Duration(2.0))
34 return (success,
"ActionServer not available within timeout")
36 goal = CartesianControllerGoal()
37 goal.move_type = CartesianControllerGoal.LIN
38 goal.move_lin.pose_goal = pose_goal
39 goal.move_lin.frame_id = frame_id
40 goal.profile = profile
43 client.send_goal(goal)
45 state = client.get_state()
47 client.wait_for_result()
48 print(
"result received")
49 result = client.get_result()
50 return (result.success, result.message)
52 def move_circ(pose_center, frame_id, start_angle, end_angle, radius, profile):
53 action_name = rospy.get_namespace()+
'cartesian_trajectory_action' 55 rospy.logwarn(
"Waiting for ActionServer: %s", action_name)
56 success = client.wait_for_server(rospy.Duration(2.0))
58 return (success,
"ActionServer not available within timeout")
60 goal = CartesianControllerGoal()
61 goal.move_type = CartesianControllerGoal.CIRC
62 goal.move_circ.pose_center = pose_center
63 goal.move_circ.frame_id = frame_id
64 goal.move_circ.start_angle = start_angle
65 goal.move_circ.end_angle = end_angle
66 goal.move_circ.radius = radius
67 goal.profile = profile
70 client.send_goal(goal)
72 state = client.get_state()
74 client.wait_for_result()
75 print(
"result received")
76 result = client.get_result()
77 return (result.success, result.message)
87 Generates a geometry_msgs.Pose from (x,y,z) and (r,p,y) 91 pose.position.x, pose.position.y, pose.position.z = pos
92 pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w = tf.transformations.quaternion_from_euler(*rpy)
def gen_pose(pos=[0, rpy=[0)
helpers
def move_circ(pose_center, frame_id, start_angle, end_angle, radius, profile)
def move_lin(pose_goal, frame_id, profile)