$search
00001 """autogenerated by genmsg_py from TestGripperPoseGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class TestGripperPoseGoal(roslib.message.Message): 00009 _md5sum = "60df11f60923975932351322d083f23d" 00010 _type = "pr2_object_manipulation_msgs/TestGripperPoseGoal" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00013 geometry_msgs/PoseStamped[] gripper_poses 00014 float32[] gripper_openings 00015 00016 ================================================================================ 00017 MSG: geometry_msgs/PoseStamped 00018 # A Pose with reference coordinate frame and timestamp 00019 Header header 00020 Pose pose 00021 00022 ================================================================================ 00023 MSG: std_msgs/Header 00024 # Standard metadata for higher-level stamped data types. 00025 # This is generally used to communicate timestamped data 00026 # in a particular coordinate frame. 00027 # 00028 # sequence ID: consecutively increasing ID 00029 uint32 seq 00030 #Two-integer timestamp that is expressed as: 00031 # * stamp.secs: seconds (stamp_secs) since epoch 00032 # * stamp.nsecs: nanoseconds since stamp_secs 00033 # time-handling sugar is provided by the client library 00034 time stamp 00035 #Frame this data is associated with 00036 # 0: no frame 00037 # 1: global frame 00038 string frame_id 00039 00040 ================================================================================ 00041 MSG: geometry_msgs/Pose 00042 # A representation of pose in free space, composed of postion and orientation. 00043 Point position 00044 Quaternion orientation 00045 00046 ================================================================================ 00047 MSG: geometry_msgs/Point 00048 # This contains the position of a point in free space 00049 float64 x 00050 float64 y 00051 float64 z 00052 00053 ================================================================================ 00054 MSG: geometry_msgs/Quaternion 00055 # This represents an orientation in free space in quaternion form. 00056 00057 float64 x 00058 float64 y 00059 float64 z 00060 float64 w 00061 00062 """ 00063 __slots__ = ['gripper_poses','gripper_openings'] 00064 _slot_types = ['geometry_msgs/PoseStamped[]','float32[]'] 00065 00066 def __init__(self, *args, **kwds): 00067 """ 00068 Constructor. Any message fields that are implicitly/explicitly 00069 set to None will be assigned a default value. The recommend 00070 use is keyword arguments as this is more robust to future message 00071 changes. You cannot mix in-order arguments and keyword arguments. 00072 00073 The available fields are: 00074 gripper_poses,gripper_openings 00075 00076 @param args: complete set of field values, in .msg order 00077 @param kwds: use keyword arguments corresponding to message field names 00078 to set specific fields. 00079 """ 00080 if args or kwds: 00081 super(TestGripperPoseGoal, self).__init__(*args, **kwds) 00082 #message fields cannot be None, assign default values for those that are 00083 if self.gripper_poses is None: 00084 self.gripper_poses = [] 00085 if self.gripper_openings is None: 00086 self.gripper_openings = [] 00087 else: 00088 self.gripper_poses = [] 00089 self.gripper_openings = [] 00090 00091 def _get_types(self): 00092 """ 00093 internal API method 00094 """ 00095 return self._slot_types 00096 00097 def serialize(self, buff): 00098 """ 00099 serialize message into buffer 00100 @param buff: buffer 00101 @type buff: StringIO 00102 """ 00103 try: 00104 length = len(self.gripper_poses) 00105 buff.write(_struct_I.pack(length)) 00106 for val1 in self.gripper_poses: 00107 _v1 = val1.header 00108 buff.write(_struct_I.pack(_v1.seq)) 00109 _v2 = _v1.stamp 00110 _x = _v2 00111 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00112 _x = _v1.frame_id 00113 length = len(_x) 00114 buff.write(struct.pack('<I%ss'%length, length, _x)) 00115 _v3 = val1.pose 00116 _v4 = _v3.position 00117 _x = _v4 00118 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00119 _v5 = _v3.orientation 00120 _x = _v5 00121 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00122 length = len(self.gripper_openings) 00123 buff.write(_struct_I.pack(length)) 00124 pattern = '<%sf'%length 00125 buff.write(struct.pack(pattern, *self.gripper_openings)) 00126 except struct.error as se: self._check_types(se) 00127 except TypeError as te: self._check_types(te) 00128 00129 def deserialize(self, str): 00130 """ 00131 unpack serialized message in str into this message instance 00132 @param str: byte array of serialized message 00133 @type str: str 00134 """ 00135 try: 00136 end = 0 00137 start = end 00138 end += 4 00139 (length,) = _struct_I.unpack(str[start:end]) 00140 self.gripper_poses = [] 00141 for i in range(0, length): 00142 val1 = geometry_msgs.msg.PoseStamped() 00143 _v6 = val1.header 00144 start = end 00145 end += 4 00146 (_v6.seq,) = _struct_I.unpack(str[start:end]) 00147 _v7 = _v6.stamp 00148 _x = _v7 00149 start = end 00150 end += 8 00151 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00152 start = end 00153 end += 4 00154 (length,) = _struct_I.unpack(str[start:end]) 00155 start = end 00156 end += length 00157 _v6.frame_id = str[start:end] 00158 _v8 = val1.pose 00159 _v9 = _v8.position 00160 _x = _v9 00161 start = end 00162 end += 24 00163 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00164 _v10 = _v8.orientation 00165 _x = _v10 00166 start = end 00167 end += 32 00168 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00169 self.gripper_poses.append(val1) 00170 start = end 00171 end += 4 00172 (length,) = _struct_I.unpack(str[start:end]) 00173 pattern = '<%sf'%length 00174 start = end 00175 end += struct.calcsize(pattern) 00176 self.gripper_openings = struct.unpack(pattern, str[start:end]) 00177 return self 00178 except struct.error as e: 00179 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00180 00181 00182 def serialize_numpy(self, buff, numpy): 00183 """ 00184 serialize message with numpy array types into buffer 00185 @param buff: buffer 00186 @type buff: StringIO 00187 @param numpy: numpy python module 00188 @type numpy module 00189 """ 00190 try: 00191 length = len(self.gripper_poses) 00192 buff.write(_struct_I.pack(length)) 00193 for val1 in self.gripper_poses: 00194 _v11 = val1.header 00195 buff.write(_struct_I.pack(_v11.seq)) 00196 _v12 = _v11.stamp 00197 _x = _v12 00198 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00199 _x = _v11.frame_id 00200 length = len(_x) 00201 buff.write(struct.pack('<I%ss'%length, length, _x)) 00202 _v13 = val1.pose 00203 _v14 = _v13.position 00204 _x = _v14 00205 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00206 _v15 = _v13.orientation 00207 _x = _v15 00208 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00209 length = len(self.gripper_openings) 00210 buff.write(_struct_I.pack(length)) 00211 pattern = '<%sf'%length 00212 buff.write(self.gripper_openings.tostring()) 00213 except struct.error as se: self._check_types(se) 00214 except TypeError as te: self._check_types(te) 00215 00216 def deserialize_numpy(self, str, numpy): 00217 """ 00218 unpack serialized message in str into this message instance using numpy for array types 00219 @param str: byte array of serialized message 00220 @type str: str 00221 @param numpy: numpy python module 00222 @type numpy: module 00223 """ 00224 try: 00225 end = 0 00226 start = end 00227 end += 4 00228 (length,) = _struct_I.unpack(str[start:end]) 00229 self.gripper_poses = [] 00230 for i in range(0, length): 00231 val1 = geometry_msgs.msg.PoseStamped() 00232 _v16 = val1.header 00233 start = end 00234 end += 4 00235 (_v16.seq,) = _struct_I.unpack(str[start:end]) 00236 _v17 = _v16.stamp 00237 _x = _v17 00238 start = end 00239 end += 8 00240 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00241 start = end 00242 end += 4 00243 (length,) = _struct_I.unpack(str[start:end]) 00244 start = end 00245 end += length 00246 _v16.frame_id = str[start:end] 00247 _v18 = val1.pose 00248 _v19 = _v18.position 00249 _x = _v19 00250 start = end 00251 end += 24 00252 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00253 _v20 = _v18.orientation 00254 _x = _v20 00255 start = end 00256 end += 32 00257 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00258 self.gripper_poses.append(val1) 00259 start = end 00260 end += 4 00261 (length,) = _struct_I.unpack(str[start:end]) 00262 pattern = '<%sf'%length 00263 start = end 00264 end += struct.calcsize(pattern) 00265 self.gripper_openings = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00266 return self 00267 except struct.error as e: 00268 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00269 00270 _struct_I = roslib.message.struct_I 00271 _struct_4d = struct.Struct("<4d") 00272 _struct_2I = struct.Struct("<2I") 00273 _struct_3d = struct.Struct("<3d")