37 from StringIO
import StringIO
40 from io
import BytesIO
as StringIO
42 from .exception
import MoveItCommanderException
43 from geometry_msgs.msg
import Pose, PoseStamped, Transform
60 pose.append(pose_msg.position.x)
61 pose.append(pose_msg.position.y)
62 pose.append(pose_msg.position.z)
63 pose.append(pose_msg.orientation.x)
64 pose.append(pose_msg.orientation.y)
65 pose.append(pose_msg.orientation.z)
66 pose.append(pose_msg.orientation.w)
72 if len(pose_list) == 7:
73 pose_msg.position.x = pose_list[0]
74 pose_msg.position.y = pose_list[1]
75 pose_msg.position.z = pose_list[2]
76 pose_msg.orientation.x = pose_list[3]
77 pose_msg.orientation.y = pose_list[4]
78 pose_msg.orientation.z = pose_list[5]
79 pose_msg.orientation.w = pose_list[6]
80 elif len(pose_list) == 6:
81 pose_msg.position.x = pose_list[0]
82 pose_msg.position.y = pose_list[1]
83 pose_msg.position.z = pose_list[2]
84 q = tf.transformations.quaternion_from_euler(
85 pose_list[3], pose_list[4], pose_list[5]
87 pose_msg.orientation.x = q[0]
88 pose_msg.orientation.y = q[1]
89 pose_msg.orientation.z = q[2]
90 pose_msg.orientation.w = q[3]
93 "Expected either 6 or 7 elements in list: (x,y,z,r,p,y) or (x,y,z,qx,qy,qz,qw)"
99 pose_msg = PoseStamped()
101 pose_msg.header.frame_id = target_frame
102 pose_msg.header.stamp = rospy.Time.now()
108 trf.append(trf_msg.translation.x)
109 trf.append(trf_msg.translation.y)
110 trf.append(trf_msg.translation.z)
111 trf.append(trf_msg.rotation.x)
112 trf.append(trf_msg.rotation.y)
113 trf.append(trf_msg.rotation.z)
114 trf.append(trf_msg.rotation.w)
119 trf_msg = Transform()
120 trf_msg.translation.x = trf_list[0]
121 trf_msg.translation.y = trf_list[1]
122 trf_msg.translation.z = trf_list[2]
123 trf_msg.rotation.x = trf_list[3]
124 trf_msg.rotation.y = trf_list[4]
125 trf_msg.rotation.z = trf_list[5]
126 trf_msg.rotation.w = trf_list[6]
def list_to_pose(pose_list)
def list_to_transform(trf_list)
def msg_from_string(msg, data)
def pose_to_list(pose_msg)
def list_to_pose_stamped(pose_list, target_frame)
def transform_to_list(trf_msg)